//This is simple naive programme(brute force)
//which runs in O(N^2)
#include <stdio.h>
#include <stdlib.h>
#include <cuda.h>
#include <math.h>
#include <sys/time.h>

#define G 6.67408E-11

struct vector
{
	float x, y;
};

//This function calculate the gravitational force
//between two bodies or particals
vector gravity (vector a, vector b, float m1, float m2)
{
	float res=G*m1*m2;

	float r=(a.y-b.y)*(a.y-b.y)+(a.x-b.x)*(a.x-b.x);

	if (r>0)	res/=r;

	vector vec;

	vec.y=a.y-b.y;
	vec.x=a.x-b.x;

	r=sqrt(r);

	if (r>0)
	{
		vec.y/=r;
		vec.x/=r;
	}

	vec.y*=res;
	vec.x*=res;

	return vec;
}

int main()
{
	int n;
	scanf("%d", &n);

	vector body[n];

	float mass[n];

	for (int i=0;i<n;i++)
	{
		body[i].x=rand()%1000000;
		body[i].y=rand()%1000000;
		mass[i]=rand()%1000000;

//		scanf("%lf %lf %lf", &body[i].x, &body[i].y, &mass[i]);
	}

	vector force[n];

	for (int i=0;i<n;i++)	force[i].x=force[i].y=0;

	struct timeval start, stop;

	gettimeofday(&start, NULL);

	float x=0, y=0;

	for (int i=0;i<n;i++)
	{
		for (int j=i+1;j<n;j++)
		{
			vector temp=gravity(body[i], body[j], mass[i], mass[j]);

			force[i].x+=temp.x;
			force[i].y+=temp.y;

			force[j].x-=temp.x;
			force[j].y-=temp.y;
		}

		printf("%d : %f %f %f :  %.15f %.15f\n", i, body[i].x, body[i].y, mass[i], force[i].x, force[i].y);

		x+=force[i].x, y+=force[i].y;
	}

	gettimeofday(&stop, NULL);

	float t=((stop.tv_sec-start.tv_sec)*1000+float(stop.tv_usec-start.tv_usec)/1000);

	printf("naiive : %f\n", t);
	printf("%f %f\n", x, y);
}

	.file	"tmpxft_00322c9b_00000000-6_naiive.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2031:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2031:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z7gravity6vectorS_ff
	.type	_Z7gravity6vectorS_ff, @function
_Z7gravity6vectorS_ff:
.LFB2027:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	cvtss2sd	%xmm2, %xmm2
	movq	%xmm1, %rdx
	movaps	%xmm0, %xmm5
	movq	%rdx, %rsi
	movaps	%xmm0, %xmm1
	cvtss2sd	%xmm3, %xmm3
	movd	%edx, %xmm0
	mulsd	.LC0(%rip), %xmm2
	shrq	$32, %rsi
	shufps	$85, %xmm5, %xmm5
	subss	%xmm0, %xmm1
	movd	%esi, %xmm6
	movaps	%xmm1, %xmm4
	mulss	%xmm1, %xmm4
	mulsd	%xmm2, %xmm3
	movaps	%xmm5, %xmm2
	subss	%xmm6, %xmm2
	movaps	%xmm2, %xmm0
	mulss	%xmm2, %xmm0
	cvtsd2ss	%xmm3, %xmm3
	addss	%xmm4, %xmm0
	xorps	%xmm4, %xmm4
	comiss	%xmm4, %xmm0
	jbe	.L3
	divss	%xmm0, %xmm3
.L3:
	movss	%xmm3, 12(%rsp)
	movss	%xmm1, 8(%rsp)
	movss	%xmm2, 4(%rsp)
	call	sqrtf@PLT
	xorps	%xmm4, %xmm4
	movss	4(%rsp), %xmm2
	movss	8(%rsp), %xmm1
	comiss	%xmm4, %xmm0
	movss	12(%rsp), %xmm3
	jbe	.L5
	divss	%xmm0, %xmm2
	divss	%xmm0, %xmm1
.L5:
	mulss	%xmm3, %xmm1
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	mulss	%xmm2, %xmm3
	movd	%xmm1, %eax
	movq	%xmm3, %rdx
	salq	$32, %rdx
	orq	%rdx, %rax
	movq	%rax, %xmm0
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z7gravity6vectorS_ff, .-_Z7gravity6vectorS_ff
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d"
.LC3:
	.string	"%d : %f %f %f :  %.15f %.15f\n"
.LC5:
	.string	"naiive : %f\n"
.LC6:
	.string	"%f %f\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC2(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-92(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
	movslq	-92(%rbp), %rcx
	movq	%rsp, %rsi
	leaq	15(,%rcx,8), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rsi
.L12:
	cmpq	%rsi, %rsp
	je	.L13
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L12
.L13:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L14
	orq	$0, -8(%rsp,%rax)
.L14:
	leaq	15(,%rcx,4), %rdx
	movq	%rsp, %rcx
	movq	%rsp, %r12
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L15:
	cmpq	%rcx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L17
	orq	$0, -8(%rsp,%rax)
.L17:
	movq	%rsp, %r13
	xorl	%ebx, %ebx
	movl	$1000000, %r14d
.L18:
	movl	-92(%rbp), %esi
	cmpl	%ebx, %esi
	jle	.L40
	call	rand@PLT
	cltd
	idivl	%r14d
	cvtsi2ssl	%edx, %xmm0
	movss	%xmm0, (%r12,%rbx,8)
	call	rand@PLT
	cltd
	idivl	%r14d
	cvtsi2ssl	%edx, %xmm0
	movss	%xmm0, 4(%r12,%rbx,8)
	call	rand@PLT
	cltd
	idivl	%r14d
	cvtsi2ssl	%edx, %xmm0
	movss	%xmm0, 0(%r13,%rbx,4)
	incq	%rbx
	jmp	.L18
.L40:
	movslq	%esi, %rax
	movq	%rsp, %rcx
	leaq	15(,%rax,8), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L20:
	cmpq	%rcx, %rsp
	je	.L21
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L20
.L21:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L22
	orq	$0, -8(%rsp,%rax)
.L22:
	movq	%rsp, %r14
	xorl	%eax, %eax
.L23:
	cmpl	%eax, %esi
	jle	.L41
	movl	$0x00000000, 4(%r14,%rax,8)
	movl	$0x00000000, (%r14,%rax,8)
	incq	%rax
	jmp	.L23
.L41:
	leaq	-88(%rbp), %rdi
	xorl	%esi, %esi
	xorl	%ebx, %ebx
	call	gettimeofday@PLT
	movl	$0x00000000, -104(%rbp)
	movl	$0x00000000, -100(%rbp)
.L25:
	movl	-92(%rbp), %r15d
	movl	%ebx, %edx
	cmpl	%ebx, %r15d
	jle	.L42
	leaq	1(%rbx), %rax
	movslq	%edx, %r8
	movq	%rax, -112(%rbp)
.L26:
	movss	0(%r13,%rbx,4), %xmm2
	cmpl	%eax, %r15d
	jle	.L43
	movslq	%eax, %rsi
	movq	(%r12,%r8,8), %xmm0
	movl	%edx, -132(%rbp)
	movss	0(%r13,%rax,4), %xmm3
	movq	(%r12,%rsi,8), %xmm1
	movq	%r8, -128(%rbp)
	movq	%rax, -120(%rbp)
	call	_Z7gravity6vectorS_ff
	movss	(%r14,%rbx,8), %xmm1
	movq	-120(%rbp), %rax
	movaps	%xmm0, %xmm7
	movl	-132(%rbp), %edx
	movq	-128(%rbp), %r8
	addss	%xmm0, %xmm1
	shufps	$85, %xmm7, %xmm7
	movss	%xmm1, (%r14,%rbx,8)
	movss	4(%r14,%rbx,8), %xmm1
	addss	%xmm7, %xmm1
	movss	%xmm1, 4(%r14,%rbx,8)
	movss	(%r14,%rax,8), %xmm1
	subss	%xmm0, %xmm1
	movss	%xmm1, (%r14,%rax,8)
	movss	4(%r14,%rax,8), %xmm1
	subss	%xmm7, %xmm1
	movss	%xmm1, 4(%r14,%rax,8)
	incq	%rax
	jmp	.L26
.L43:
	movss	4(%r14,%rbx,8), %xmm5
	movl	$2, %edi
	movss	(%r14,%rbx,8), %xmm6
	movb	$5, %al
	leaq	.LC3(%rip), %rsi
	cvtss2sd	(%r12,%rbx,8), %xmm0
	cvtss2sd	4(%r12,%rbx,8), %xmm1
	cvtss2sd	%xmm2, %xmm2
	movss	%xmm5, -128(%rbp)
	cvtss2sd	%xmm5, %xmm4
	cvtss2sd	%xmm6, %xmm3
	movss	%xmm6, -120(%rbp)
	call	__printf_chk@PLT
	movss	-120(%rbp), %xmm6
	movss	-128(%rbp), %xmm5
	addss	-100(%rbp), %xmm6
	addss	-104(%rbp), %xmm5
	movq	-112(%rbp), %rbx
	movss	%xmm6, -100(%rbp)
	movss	%xmm5, -104(%rbp)
	jmp	.L25
.L42:
	xorl	%esi, %esi
	leaq	-72(%rbp), %rdi
	call	gettimeofday@PLT
	movq	-72(%rbp), %rax
	subq	-88(%rbp), %rax
	leaq	.LC5(%rip), %rsi
	imulq	$1000, %rax, %rax
	movl	$2, %edi
	cvtsi2ssq	%rax, %xmm0
	movq	-64(%rbp), %rax
	subq	-80(%rbp), %rax
	cvtsi2ssq	%rax, %xmm1
	divss	.LC4(%rip), %xmm1
	movb	$1, %al
	addss	%xmm1, %xmm0
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
	movl	$2, %edi
	movb	$2, %al
	leaq	.LC6(%rip), %rsi
	cvtss2sd	-100(%rbp), %xmm0
	cvtss2sd	-104(%rbp), %xmm1
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2028:
	.size	main, .-main
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2054:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2054:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	1580726787
	.long	1037195383
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC4:
	.long	1148846080
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

//This is simple naive programme(brute force)
//which runs in O(N^2)
#include <stdio.h>
#include <stdlib.h>
#include <hip/hip_runtime.h>
#include <math.h>
#include <sys/time.h>

#define G 6.67408E-11

struct vector
{
	float x, y;
};

//This function calculate the gravitational force
//between two bodies or particals
vector gravity (vector a, vector b, float m1, float m2)
{
	float res=G*m1*m2;

	float r=(a.y-b.y)*(a.y-b.y)+(a.x-b.x)*(a.x-b.x);

	if (r>0)	res/=r;

	vector vec;

	vec.y=a.y-b.y;
	vec.x=a.x-b.x;

	r=sqrt(r);

	if (r>0)
	{
		vec.y/=r;
		vec.x/=r;
	}

	vec.y*=res;
	vec.x*=res;

	return vec;
}

int main()
{
	int n;
	scanf("%d", &n);

	vector body[n];

	float mass[n];

	for (int i=0;i<n;i++)
	{
		body[i].x=rand()%1000000;
		body[i].y=rand()%1000000;
		mass[i]=rand()%1000000;

//		scanf("%lf %lf %lf", &body[i].x, &body[i].y, &mass[i]);
	}

	vector force[n];

	for (int i=0;i<n;i++)	force[i].x=force[i].y=0;

	struct timeval start, stop;

	gettimeofday(&start, NULL);

	float x=0, y=0;

	for (int i=0;i<n;i++)
	{
		for (int j=i+1;j<n;j++)
		{
			vector temp=gravity(body[i], body[j], mass[i], mass[j]);

			force[i].x+=temp.x;
			force[i].y+=temp.y;

			force[j].x-=temp.x;
			force[j].y-=temp.y;
		}

		printf("%d : %f %f %f :  %.15f %.15f\n", i, body[i].x, body[i].y, mass[i], force[i].x, force[i].y);

		x+=force[i].x, y+=force[i].y;
	}

	gettimeofday(&stop, NULL);

	float t=((stop.tv_sec-start.tv_sec)*1000+float(stop.tv_usec-start.tv_usec)/1000);

	printf("naiive : %f\n", t);
	printf("%f %f\n", x, y);
}

	.text
	.file	"naiive.hip"
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z7gravity6vectorS_ff
.LCPI0_0:
	.quad	0x3dd258775e37fa03              # double 6.6740800000000003E-11
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI0_1:
	.long	0x3f800000                      # float 1
	.text
	.globl	_Z7gravity6vectorS_ff
	.type	_Z7gravity6vectorS_ff,@function
_Z7gravity6vectorS_ff:                  # @_Z7gravity6vectorS_ff
	.cfi_startproc
# %bb.0:
	cvtss2sd	%xmm2, %xmm2
	mulsd	.LCPI0_0(%rip), %xmm2
	cvtss2sd	%xmm3, %xmm3
	mulsd	%xmm2, %xmm3
	xorps	%xmm2, %xmm2
	cvtsd2ss	%xmm3, %xmm2
	subps	%xmm1, %xmm0
	movaps	%xmm0, %xmm1
	shufps	$85, %xmm0, %xmm1               # xmm1 = xmm1[1,1],xmm0[1,1]
	movaps	%xmm1, %xmm3
	mulss	%xmm1, %xmm3
	movaps	%xmm0, %xmm4
	mulss	%xmm0, %xmm4
	addss	%xmm3, %xmm4
	xorps	%xmm5, %xmm5
	xorps	%xmm3, %xmm3
	cmpltss	%xmm4, %xmm3
	movaps	%xmm3, %xmm6
	andps	%xmm4, %xmm6
	movss	.LCPI0_1(%rip), %xmm7           # xmm7 = mem[0],zero,zero,zero
	andnps	%xmm7, %xmm3
	orps	%xmm6, %xmm3
	divss	%xmm3, %xmm2
	xorps	%xmm3, %xmm3
	sqrtss	%xmm4, %xmm3
	ucomiss	%xmm5, %xmm3
	jbe	.LBB0_2
# %bb.1:
	divss	%xmm3, %xmm1
	divss	%xmm3, %xmm0
	unpcklps	%xmm1, %xmm0                    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
.LBB0_2:
	movaps	%xmm0, %xmm1
	shufps	$85, %xmm0, %xmm1               # xmm1 = xmm1[1,1],xmm0[1,1]
	mulss	%xmm2, %xmm1
	mulss	%xmm0, %xmm2
	unpcklps	%xmm1, %xmm2                    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
	movaps	%xmm2, %xmm0
	retq
.Lfunc_end0:
	.size	_Z7gravity6vectorS_ff, .Lfunc_end0-_Z7gravity6vectorS_ff
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI1_0:
	.quad	0x3dd258775e37fa03              # double 6.6740800000000003E-11
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI1_1:
	.long	0x3f800000                      # float 1
.LCPI1_2:
	.long	0x447a0000                      # float 1000
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	leaq	-44(%rbp), %rbx
	movl	$.L.str, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movq	%rsp, %r14
	movl	(%rbx), %eax
	movq	%rsp, %r15
	leaq	15(,%rax,8), %rax
	andq	$-16, %rax
	subq	%rax, %r15
	movq	%r15, %rsp
	movl	(%rbx), %eax
	movq	%rsp, %r12
	leaq	15(,%rax,4), %rcx
	andq	$-16, %rcx
	subq	%rcx, %r12
	movq	%r12, %rsp
	testl	%eax, %eax
	jle	.LBB1_5
# %bb.1:                                # %.lr.ph.preheader
	xorl	%ebx, %ebx
.LBB1_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	imulq	$1125899907, %rax, %rcx         # imm = 0x431BDE83
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$50, %rcx
	addl	%edx, %ecx
	imull	$1000000, %ecx, %ecx            # imm = 0xF4240
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, (%r15,%rbx,8)
	callq	rand
	cltq
	imulq	$1125899907, %rax, %rcx         # imm = 0x431BDE83
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$50, %rcx
	addl	%edx, %ecx
	imull	$1000000, %ecx, %ecx            # imm = 0xF4240
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, 4(%r15,%rbx,8)
	callq	rand
	cltq
	imulq	$1125899907, %rax, %rcx         # imm = 0x431BDE83
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$50, %rcx
	addl	%edx, %ecx
	imull	$1000000, %ecx, %ecx            # imm = 0xF4240
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, (%r12,%rbx,4)
	incq	%rbx
	movslq	-44(%rbp), %rax
	cmpq	%rax, %rbx
	jl	.LBB1_2
# %bb.3:                                # %._crit_edge
	movl	%eax, %edx
	movq	%rsp, %rbx
	leaq	15(,%rdx,8), %rax
	andq	$-16, %rax
	subq	%rax, %rbx
	movq	%rbx, %rsp
	testl	%edx, %edx
	jle	.LBB1_6
# %bb.4:                                # %.lr.ph51.preheader
	shlq	$3, %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	jmp	.LBB1_6
.LBB1_5:                                # %._crit_edge.thread
	movq	%rsp, %rbx
	leaq	15(,%rax,8), %rax
	andq	$-16, %rax
	subq	%rax, %rbx
	movq	%rbx, %rsp
.LBB1_6:                                # %._crit_edge52
	leaq	-120(%rbp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jle	.LBB1_7
# %bb.10:                               # %.lr.ph61.preheader
	movq	%r14, -96(%rbp)                 # 8-byte Spill
	leaq	12(%rbx), %r13
	movq	%r12, -80(%rbp)                 # 8-byte Spill
	leaq	4(%r12), %r14
	movq	%r15, -88(%rbp)                 # 8-byte Spill
	leaq	8(%r15), %r12
	xorps	%xmm8, %xmm8
	movq	$-1, %r15
	xorl	%esi, %esi
	movss	.LCPI1_1(%rip), %xmm9           # xmm9 = mem[0],zero,zero,zero
	xorps	%xmm0, %xmm0
	xorps	%xmm1, %xmm1
.LBB1_11:                               # %.lr.ph61
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_15 Depth 2
	movss	%xmm1, -56(%rbp)                # 4-byte Spill
	movss	%xmm0, -64(%rbp)                # 4-byte Spill
	leaq	1(%rsi), %rdx
	movslq	%eax, %rcx
	movq	%rdx, -104(%rbp)                # 8-byte Spill
	cmpq	%rcx, %rdx
	jge	.LBB1_12
# %bb.14:                               # %.lr.ph55
                                        #   in Loop: Header=BB1_11 Depth=1
	movq	-88(%rbp), %rcx                 # 8-byte Reload
	movsd	(%rcx,%rsi,8), %xmm0            # xmm0 = mem[0],zero
	movaps	%xmm0, %xmm1
	shufps	$85, %xmm0, %xmm1               # xmm1 = xmm1[1,1],xmm0[1,1]
	movq	-80(%rbp), %rcx                 # 8-byte Reload
	xorps	%xmm2, %xmm2
	cvtss2sd	(%rcx,%rsi,4), %xmm2
	movaps	%xmm2, %xmm3
	mulsd	.LCPI1_0(%rip), %xmm3
	movl	%eax, %eax
	addq	%r15, %rax
	xorl	%ecx, %ecx
.LBB1_15:                               #   Parent Loop BB1_11 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%r12,%rcx,8), %xmm5            # xmm5 = mem[0],zero
	movaps	%xmm0, %xmm4
	subps	%xmm5, %xmm4
	movaps	%xmm4, %xmm6
	shufps	$85, %xmm4, %xmm6               # xmm6 = xmm6[1,1],xmm4[1,1]
	movaps	%xmm6, %xmm7
	mulss	%xmm6, %xmm7
	movaps	%xmm4, %xmm5
	mulss	%xmm4, %xmm5
	addss	%xmm7, %xmm5
	xorps	%xmm7, %xmm7
	sqrtss	%xmm5, %xmm7
	ucomiss	%xmm8, %xmm7
	jbe	.LBB1_17
# %bb.16:                               #   in Loop: Header=BB1_15 Depth=2
	divss	%xmm7, %xmm6
	divss	%xmm7, %xmm4
	unpcklps	%xmm6, %xmm4                    # xmm4 = xmm4[0],xmm6[0],xmm4[1],xmm6[1]
.LBB1_17:                               #   in Loop: Header=BB1_15 Depth=2
	xorps	%xmm6, %xmm6
	cvtss2sd	(%r14,%rcx,4), %xmm6
	mulsd	%xmm3, %xmm6
	cvtsd2ss	%xmm6, %xmm6
	xorps	%xmm7, %xmm7
	cmpltss	%xmm5, %xmm7
	andps	%xmm7, %xmm5
	andnps	%xmm9, %xmm7
	orps	%xmm5, %xmm7
	divss	%xmm7, %xmm6
	movaps	%xmm4, %xmm5
	shufps	$85, %xmm4, %xmm5               # xmm5 = xmm5[1,1],xmm4[1,1]
	mulss	%xmm6, %xmm5
	mulss	%xmm4, %xmm6
	movss	(%rbx,%rsi,8), %xmm4            # xmm4 = mem[0],zero,zero,zero
	addss	%xmm6, %xmm4
	movss	%xmm4, (%rbx,%rsi,8)
	movss	4(%rbx,%rsi,8), %xmm4           # xmm4 = mem[0],zero,zero,zero
	addss	%xmm5, %xmm4
	movss	%xmm4, 4(%rbx,%rsi,8)
	movss	-4(%r13,%rcx,8), %xmm4          # xmm4 = mem[0],zero,zero,zero
	movss	(%r13,%rcx,8), %xmm7            # xmm7 = mem[0],zero,zero,zero
	subss	%xmm6, %xmm4
	movss	%xmm4, -4(%r13,%rcx,8)
	subss	%xmm5, %xmm7
	movss	%xmm7, (%r13,%rcx,8)
	incq	%rcx
	cmpq	%rcx, %rax
	jne	.LBB1_15
	jmp	.LBB1_13
.LBB1_12:                               # %.lr.ph61.._crit_edge56_crit_edge
                                        #   in Loop: Header=BB1_11 Depth=1
	movq	-88(%rbp), %rax                 # 8-byte Reload
	movss	(%rax,%rsi,8), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	4(%rax,%rsi,8), %xmm1           # xmm1 = mem[0],zero,zero,zero
	movq	-80(%rbp), %rax                 # 8-byte Reload
	xorps	%xmm2, %xmm2
	cvtss2sd	(%rax,%rsi,4), %xmm2
.LBB1_13:                               # %._crit_edge56
                                        #   in Loop: Header=BB1_11 Depth=1
	cvtss2sd	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm1
	movss	(%rbx,%rsi,8), %xmm3            # xmm3 = mem[0],zero,zero,zero
	movss	%xmm3, -68(%rbp)                # 4-byte Spill
	movss	4(%rbx,%rsi,8), %xmm5           # xmm5 = mem[0],zero,zero,zero
	movss	%xmm5, -72(%rbp)                # 4-byte Spill
	cvtss2sd	%xmm3, %xmm3
	xorps	%xmm4, %xmm4
	cvtss2sd	%xmm5, %xmm4
	movl	$.L.str.1, %edi
                                        # kill: def $esi killed $esi killed $rsi
	movb	$5, %al
	callq	printf
	movss	-64(%rbp), %xmm0                # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	addss	-68(%rbp), %xmm0                # 4-byte Folded Reload
	movss	-56(%rbp), %xmm1                # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	addss	-72(%rbp), %xmm1                # 4-byte Folded Reload
	movslq	-44(%rbp), %rax
	addq	$8, %r13
	addq	$4, %r14
	addq	$8, %r12
	decq	%r15
	movq	-104(%rbp), %rcx                # 8-byte Reload
	movq	%rcx, %rsi
	cmpq	%rax, %rcx
	xorps	%xmm8, %xmm8
	movss	.LCPI1_1(%rip), %xmm9           # xmm9 = mem[0],zero,zero,zero
	jl	.LBB1_11
# %bb.8:                                # %._crit_edge62.loopexit
	cvtss2sd	%xmm0, %xmm0
	movsd	%xmm0, -56(%rbp)                # 8-byte Spill
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm0
	movsd	%xmm0, -64(%rbp)                # 8-byte Spill
	movq	-96(%rbp), %r14                 # 8-byte Reload
	jmp	.LBB1_9
.LBB1_7:
	xorps	%xmm0, %xmm0
	movsd	%xmm0, -64(%rbp)                # 8-byte Spill
	movsd	%xmm0, -56(%rbp)                # 8-byte Spill
.LBB1_9:                                # %._crit_edge62
	leaq	-136(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbx), %rax
	subq	-120(%rbp), %rax
	imulq	$1000, %rax, %rax               # imm = 0x3E8
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rax, %xmm0
	movq	8(%rbx), %rax
	subq	-112(%rbp), %rax
	xorps	%xmm1, %xmm1
	cvtsi2ss	%rax, %xmm1
	divss	.LCPI1_2(%rip), %xmm1
	addss	%xmm0, %xmm1
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm0
	movl	$.L.str.2, %edi
	movb	$1, %al
	callq	printf
	movl	$.L.str.3, %edi
	movsd	-56(%rbp), %xmm0                # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movsd	-64(%rbp), %xmm1                # 8-byte Reload
                                        # xmm1 = mem[0],zero
	movb	$2, %al
	callq	printf
	movq	%r14, %rsp
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.Lfunc_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"%d"
	.size	.L.str, 3

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"%d : %f %f %f :  %.15f %.15f\n"
	.size	.L.str.1, 30

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"naiive : %f\n"
	.size	.L.str.2, 13

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"%f %f\n"
	.size	.L.str.3, 7

	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
