#include <stdio.h>
#include <stdlib.h>
#include <cuda.h>
#include <math.h>
#include <limits.h>
#include <float.h>
#include <iostream>
#include <sys/time.h>
#include <stack>

#define G 6.67408E-11	//Gravitational constant 
#define lvl 9		//depth of quad tree till which we'll divide plane

using namespace std;

struct vect		//Structure for 2D coordinate
{
	float x; // X coordinate
	float y; // Y coordinate
};

struct node		//Structure for each node of the quad tree
{
	vect body; //centre of mass of bodies in current node

	float mass; //total mass of bodies in current node
	int child[4]; //children indices in nodes array
	int l,r; //index limit in body array of bodies in current node

	vect min, max; //min and max X and Y coordinates of bodies belonging to current node
};

//Function calculate Gravitational force between two body
vect gravity (vect a, vect 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;

	vect 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;
}

//This function will construct particular level of the tree.
//Each node will be divided further into four new nodes and bodies in the array will be swapped so that bodies belonging to same node remain together in the array

void construct(vect *body, float *mass, node *nodes, int level, int tot)
{
	int index;
	int total = 1<<(2*level);    //total nodes in current level
	int offset=((1<<(2*level))-1)/3;   //total nodes in tree upto previous level
	int off=offset+total;    //total nodes upto current level in tree

	for (int m=0; m<total; m++)
	{
		int tid=m*4;

		index=m+offset; //actual index in nodes array

		node nd=nodes[index];

		if (nodes[index].l<=nodes[index].r)
		{
			float xl=nd.min.x, xr=nd.max.x;
			float yl=nd.min.y, yr=nd.max.y;

			float xmid=xl+(xr-xl)/2;
			float ymid=yl+(yr-yl)/2;

			float l=nd.l, r=nd.r;

			node child[4];

			for (int i=0;i<4;i++)
			{
				for (int j=0;j<4;j++)	child[i].child[j]=-1;
				child[i].min.x=child[i].min.y=FLT_MAX, child[i].max.x=child[i].max.y=FLT_MIN;
			}

			int i=l-1;

			float m=0, x=0, y=0, mm=0, xx=0, yy=0;
			
			for (int j=l;j<=r;j++) //swapping of bodies belonging to current node based on x-coordinates creating two children
			{
				if (body[j].x<=xmid)
				{
					i++;
					
					vect temp=body[i];
					body[i]=body[j];
					body[j]=temp;

					float t=mass[i];
					mass[i]=mass[j];
					mass[j]=t;
				}

			}

			child[2].l=l, child[2].r=i;
			child[3].l=i+1, child[3].r=r;

			for (int k=2;k<=3;k++)
			{
				m=mm=x=xx=y=yy=0;

				l=child[k].l, r=child[k].r;

				i=l-1;

				int cnt=0;

				for (int j=l;j<=r;j++) //swapping of bodies in two children created previously based on y-coordinates, each creating two new children
				{
					x+=body[j].x;
					y+=body[j].y;
					m+=mass[j];

					if (body[j].y<=ymid)
					{
						xx+=body[j].x, yy+=body[j].y, mm+=mass[j];
						cnt++;
						i++;
						
						vect temp=body[i];
						body[i]=body[j];
						body[j]=temp;

						float t=mass[i];
						mass[i]=mass[j];
						mass[j]=t;
					}
				}
				
				if(cnt>0)	child[k].mass=mm, child[k].body.x=xx/cnt, child[k].body.y=yy/cnt;

				child[k].l=l, child[k].r=i;

				mm=m-mm, xx=x-xx, yy=y-yy, cnt=r-l+1-cnt;
				
				if(cnt>0)	child[k-2].mass=mm, child[k-2].body.x=xx/cnt, child[k-2].body.y=yy/cnt;

				child[k-2].l=i+1, child[k-2].r=r;
			}			

			for (int i=0;i<4;i++)	
			{
				if (i%2)	child[i].min.x=xmid, child[i].max.x=xr;
				else	child[i].min.x=xl, child[i].max.x=xmid;
				
				if (i<2)	child[i].min.y=ymid, child[i].max.y=yr;
				else	child[i].min.y=yl, child[i].max.y=ymid;

				if (off+tid+i<tot)	nodes[off+tid+i]=child[i];
				nd.child[i]=off+tid+i;
			}
		}
		else
		{
			for (int i=0;i<4;i++)
			{
				if (off+tid+i<tot)
				{
					nodes[off+tid+i].l=0;
					nodes[off+tid+i].r=-1;
				}
				nd.child[i]=off+tid+i;
			}
		}

		nodes[index]=nd;
	}
}

//This function calculates force on bodies
void calculate(vect *body, float *mass, node *nodes, vect *force, int n, float theta)
{
	int l=((1<<(2*(lvl-1)))-1)/3; //total nodes in tree upto max depth

	for (int index=0;index<n;index++)
	{
		stack <int> st;

		st.push(0);

		vect bd=body[index];

		while (!st.empty()) //for each body do DFS until reached leaf
		{
			int t=st.top();
			st.pop();

			node nd=nodes[t];

			float s=fmax(nd.max.x-nd.min.x, nd.max.y-nd.min.y);

			float x=bd.x-nd.body.x, y=bd.y-nd.body.y;

			float dist=sqrt(x*x+y*y);

			float val=FLT_MAX;

			if (dist>0)	val=s/dist;

			if (val<theta)	//Barnes-Hutt approximation
			{			
				vect frc=gravity(nd.body, bd, nd.mass, mass[index]);

				force[index].x+=frc.x;
				force[index].y+=frc.y;
			}
			else
			{
				if (t>=l) //if reached leaf
				{
					vect frc=gravity(nd.body, bd, nd.mass, mass[index]);

					force[index].x+=frc.x;
					force[index].y+=frc.y;

					continue;
				}

				for (int i=0;i<4;i++)
				{
					int temp=nd.child[i];

					if (temp==-1 || nodes[temp].l>nodes[temp].r)	continue;
				
					st.push(temp);
				}
			}
		}
	}
}

float maxx(float a, float b)
{
	return (a<b?b:a);
}

float minn(float a, float b)
{
	return (a<b?a:b);
}

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

	vect body[n];

	float mass[n];

	float m=0, x=0, y=0;

	for (int i=0;i<n;i++)	
	{	//Here we're going to take random inputs
		body[i].x=rand()%1000000;
		body[i].y=rand()%1000000;
		mass[i]=rand()%1000000;

		m+=mass[i], x+=body[i].x, y+=body[i].y;
	}	

	x/=n, y/=n; //centre of mass of the system

	vect force[n];

	vect mn, mx;

	mn.x=mn.y=FLT_MAX, mx.x=mx.y=FLT_MIN;

	struct timeval start, stop;

	gettimeofday(&start, NULL);

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

		mn.x=min(mn.x, body[i].x);
		mx.x=max(mx.x, body[i].x);

		mn.y=min(mn.y, body[i].y);
		mx.y=max(mx.y, body[i].y);
	}

	gettimeofday(&stop, NULL);

	long seconds=(stop.tv_sec-start.tv_sec);

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

	vect gmin=mn, gmax=mx;

	printf("%f %f\n %f %f\n", gmin.x, gmin.y, gmax.x, gmax.y);

	int tot=1<<(2*lvl);
	tot=(tot-1)/3;

	node h_nodes[tot];

	for (int i=0;i<tot;i++)
	{
		for (int j=0;j<4;j++)	h_nodes[i].child[j]=-1;
	}

	vect temp;
	temp.x=x, temp.y=y;

	h_nodes[0].body=temp, h_nodes[0].mass=m, h_nodes[0].l=0, h_nodes[0].r=n-1, h_nodes[0].min=gmin, h_nodes[0].max=gmax;

	for (int i=0;i<lvl-1;i++) //creation of tree level by level
	{
		gettimeofday(&start, NULL);
		construct(body, mass, h_nodes, i, tot);
		gettimeofday(&stop, NULL);

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

	printf("theta : ");
	scanf("%f", &theta);

	gettimeofday(&start, NULL);
	calculate(body, mass, h_nodes, force, n, theta);
	gettimeofday(&stop, NULL);

	t+=((stop.tv_sec-start.tv_sec)*1000+float(stop.tv_usec-start.tv_usec)/1000);
//t shows total number of time this serial code take
	x=0, y=0;

	for(int i=0;i<n;i++)
	{
		printf("%d : x %f y %f m %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;
	}

//	printf("%f %f\n", x, y);

	printf("cpu time : %f\n", t);
}


	.file	"tmpxft_003a7158_00000000-6_serial.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3918:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3918:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z7gravity4vectS_ff
	.type	_Z7gravity4vectS_ff, @function
_Z7gravity4vectS_ff:
.LFB3906:
	.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
.LFE3906:
	.size	_Z7gravity4vectS_ff, .-_Z7gravity4vectS_ff
	.globl	_Z9constructP4vectPfP4nodeii
	.type	_Z9constructP4vectPfP4nodeii, @function
_Z9constructP4vectPfP4nodeii:
.LFB3907:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	addl	%ecx, %ecx
	movq	%rdi, %r9
	movq	%rsi, %r10
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$344, %rsp
	.cfi_def_cfa_offset 400
	movl	%r8d, 36(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 328(%rsp)
	xorl	%eax, %eax
	movl	$1, %eax
	sall	%cl, %eax
	movl	$3, %ecx
	movl	%eax, %r14d
	decl	%eax
	cltd
	idivl	%ecx
	leal	(%r14,%rax), %r15d
	movslq	%eax, %rdx
	movslq	%r15d, %rax
	imulq	$52, %rdx, %rdx
	movq	%rax, 24(%rsp)
	imulq	$52, %rax, %rax
	addq	%r13, %rdx
	movq	%rax, 16(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, 48(%rsp)
	leaq	328(%rsp), %rax
	movq	%rax, 56(%rsp)
.L12:
	cmpl	%r14d, %ebp
	jge	.L44
	leaq	68(%rsp), %rdi
	movl	$13, %ecx
	movq	%rdx, %rsi
	movl	32(%rdx), %eax
	rep movsl
	movl	28(%rdx), %ecx
	movss	36(%rdx), %xmm7
	movss	40(%rdx), %xmm8
	movss	44(%rdx), %xmm6
	movss	48(%rdx), %xmm12
	cmpl	%eax, %ecx
	jg	.L34
	movaps	%xmm6, %xmm0
	cvtsi2ssl	%ecx, %xmm2
	leaq	120(%rsp), %r8
	cvtsi2ssl	%eax, %xmm1
	subss	%xmm7, %xmm0
	mulss	.LC2(%rip), %xmm0
	movq	%r8, %rax
	addss	%xmm7, %xmm0
	movaps	%xmm0, %xmm11
	movaps	%xmm12, %xmm0
	subss	%xmm8, %xmm0
	mulss	.LC2(%rip), %xmm0
	addss	%xmm8, %xmm0
.L14:
	movq	56(%rsp), %rdi
	movl	$-1, 12(%rax)
	addq	$52, %rax
	movl	$-1, -36(%rax)
	movl	$-1, -32(%rax)
	movl	$-1, -28(%rax)
	movl	$0x7f7fffff, -12(%rax)
	movl	$0x7f7fffff, -16(%rax)
	movl	$0x00800000, -4(%rax)
	movl	$0x00800000, -8(%rax)
	cmpq	%rdi, %rax
	jne	.L14
	movaps	%xmm2, %xmm3
	cvttss2sil	%xmm2, %edi
	subss	.LC5(%rip), %xmm3
	cvttss2sil	%xmm3, %esi
	movslq	%edi, %rax
.L15:
	cvtsi2ssl	%eax, %xmm2
	leal	1(%rsi), %ecx
	comiss	%xmm2, %xmm1
	jb	.L45
	comiss	(%r9,%rax,8), %xmm11
	jb	.L16
	movslq	%ecx, %r11
	movq	(%r9,%rax,8), %rbx
	leaq	(%r9,%r11,8), %rsi
	movss	(%rsi), %xmm3
	movss	4(%rsi), %xmm2
	movq	%rbx, (%rsi)
	leaq	(%r10,%r11,4), %rsi
	movss	%xmm3, (%r9,%rax,8)
	movss	%xmm2, 4(%r9,%rax,8)
	movss	(%rsi), %xmm2
	movss	(%r10,%rax,4), %xmm3
	movss	%xmm3, (%rsi)
	movl	%ecx, %esi
	movss	%xmm2, (%r10,%rax,4)
.L16:
	incq	%rax
	jmp	.L15
.L45:
	cvttss2sil	%xmm1, %eax
	movl	%edi, 252(%rsp)
	movl	%esi, 256(%rsp)
	movl	%ecx, 304(%rsp)
	movl	%eax, 308(%rsp)
	leaq	104(%r8), %rax
	movq	%rax, 40(%rsp)
	movq	%r8, %rax
.L25:
	cvtsi2ssl	132(%rax), %xmm9
	xorps	%xmm3, %xmm3
	xorl	%edi, %edi
	cvtsi2ssl	136(%rax), %xmm13
	movaps	%xmm3, %xmm4
	movaps	%xmm3, %xmm5
	movaps	%xmm3, %xmm2
	movaps	%xmm3, %xmm15
	cvttss2sil	%xmm9, %esi
	movaps	%xmm9, %xmm1
	subss	.LC5(%rip), %xmm1
	cvttss2sil	%xmm1, %ebx
	movaps	%xmm3, %xmm1
	movl	%esi, 32(%rsp)
	movslq	%esi, %rcx
.L19:
	cvtsi2ssl	%ecx, %xmm10
	leal	1(%rbx), %r11d
	comiss	%xmm10, %xmm13
	jb	.L46
	movss	(%r9,%rcx,8), %xmm10
	movss	(%r10,%rcx,4), %xmm14
	addss	%xmm10, %xmm2
	movss	%xmm10, 12(%rsp)
	addss	%xmm14, %xmm15
	movss	4(%r9,%rcx,8), %xmm10
	comiss	%xmm10, %xmm0
	addss	%xmm10, %xmm1
	jb	.L20
	movslq	%r11d, %r12
	movq	(%r9,%rcx,8), %rsi
	addss	%xmm10, %xmm3
	incl	%edi
	leaq	(%r9,%r12,8), %rbx
	addss	%xmm14, %xmm5
	movss	4(%rbx), %xmm10
	movss	(%rbx), %xmm14
	movq	%rsi, (%rbx)
	leaq	(%r10,%r12,4), %rbx
	addss	12(%rsp), %xmm4
	movss	%xmm14, (%r9,%rcx,8)
	movss	%xmm10, 4(%r9,%rcx,8)
	movss	(%rbx), %xmm14
	movss	(%r10,%rcx,4), %xmm10
	movss	%xmm10, (%rbx)
	movl	%r11d, %ebx
	movss	%xmm14, (%r10,%rcx,4)
.L20:
	incq	%rcx
	jmp	.L19
.L46:
	cvtsi2ssl	%edi, %xmm10
	testl	%edi, %edi
	jle	.L23
	movaps	%xmm4, %xmm14
	movss	%xmm5, 112(%rax)
	divss	%xmm10, %xmm14
	movss	%xmm14, 104(%rax)
	movaps	%xmm3, %xmm14
	divss	%xmm10, %xmm14
	movss	%xmm14, 108(%rax)
.L23:
	movaps	%xmm13, %xmm14
	movl	32(%rsp), %edi
	movl	%ebx, 136(%rax)
	subss	%xmm9, %xmm14
	addss	.LC5(%rip), %xmm14
	movl	%edi, 132(%rax)
	subss	%xmm10, %xmm14
	cvttss2sil	%xmm14, %ecx
	testl	%ecx, %ecx
	jle	.L24
	subss	%xmm5, %xmm15
	subss	%xmm4, %xmm2
	cvtsi2ssl	%ecx, %xmm5
	subss	%xmm3, %xmm1
	movss	%xmm15, 8(%rax)
	divss	%xmm5, %xmm2
	divss	%xmm5, %xmm1
	movss	%xmm2, (%rax)
	movss	%xmm1, 4(%rax)
.L24:
	cvttss2sil	%xmm13, %ecx
	movq	40(%rsp), %rbx
	movl	%r11d, 28(%rax)
	addq	$52, %rax
	movl	%ecx, -20(%rax)
	cmpq	%rbx, %rax
	jne	.L25
	movq	24(%rsp), %rdi
	leal	0(,%rbp,4), %eax
	movl	%r15d, %ebx
	xorl	%r11d, %r11d
	cltq
	addq	%rdi, %rax
	imulq	$52, %rax, %rax
	addq	%r13, %rax
.L29:
	testl	$1, %r11d
	jne	.L35
	movaps	%xmm7, %xmm2
	movaps	%xmm11, %xmm1
	jmp	.L26
.L35:
	movaps	%xmm11, %xmm2
	movaps	%xmm6, %xmm1
.L26:
	movss	%xmm2, 36(%r8)
	movss	%xmm1, 44(%r8)
	cmpq	$1, %r11
	jbe	.L36
	movaps	%xmm8, %xmm2
	movaps	%xmm0, %xmm1
	jmp	.L27
.L36:
	movaps	%xmm0, %xmm2
	movaps	%xmm12, %xmm1
.L27:
	movl	36(%rsp), %edi
	movss	%xmm2, 40(%r8)
	movss	%xmm1, 48(%r8)
	cmpl	%edi, %ebx
	jge	.L28
	movl	$13, %ecx
	movq	%rax, %rdi
	movq	%r8, %rsi
	rep movsl
.L28:
	movl	%ebx, 80(%rsp,%r11,4)
	incq	%r11
	incl	%ebx
	addq	$52, %r8
	addq	$52, %rax
	cmpq	$4, %r11
	jne	.L29
	jmp	.L30
.L34:
	movq	16(%rsp), %rcx
	movl	%r15d, %esi
	xorl	%eax, %eax
.L13:
	movl	36(%rsp), %ebx
	cmpl	%ebx, %esi
	jge	.L31
	movl	$-1, 32(%r13,%rcx)
	xorl	%edi, %edi
	movl	%edi, 28(%r13,%rcx)
.L31:
	movq	48(%rsp), %rbx
	addq	$52, %rcx
	movl	%esi, (%rbx,%rax)
	addq	$4, %rax
	incl	%esi
	cmpq	$16, %rax
	jne	.L13
.L30:
	movq	%rdx, %rdi
	leaq	68(%rsp), %rsi
	movl	$13, %ecx
	incl	%ebp
	rep movsl
	addq	$52, %rdx
	addl	$4, %r15d
	addq	$208, 16(%rsp)
	jmp	.L12
.L44:
	movq	328(%rsp), %rax
	subq	%fs:40, %rax
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	addq	$344, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3907:
	.size	_Z9constructP4vectPfP4nodeii, .-_Z9constructP4vectPfP4nodeii
	.globl	_Z4maxxff
	.type	_Z4maxxff, @function
_Z4maxxff:
.LFB3913:
	.cfi_startproc
	endbr64
	maxss	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	ret
	.cfi_endproc
.LFE3913:
	.size	_Z4maxxff, .-_Z4maxxff
	.globl	_Z4minnff
	.type	_Z4minnff, @function
_Z4minnff:
.LFB3914:
	.cfi_startproc
	endbr64
	minss	%xmm1, %xmm0
	ret
	.cfi_endproc
.LFE3914:
	.size	_Z4minnff, .-_Z4minnff
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3941:
	.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
.LFE3941:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt11_Deque_baseIiSaIiEED2Ev,"axG",@progbits,_ZNSt11_Deque_baseIiSaIiEED5Ev,comdat
	.align 2
	.weak	_ZNSt11_Deque_baseIiSaIiEED2Ev
	.type	_ZNSt11_Deque_baseIiSaIiEED2Ev, @function
_ZNSt11_Deque_baseIiSaIiEED2Ev:
.LFB4402:
	.cfi_startproc
	endbr64
	cmpq	$0, (%rdi)
	je	.L57
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	72(%rdi), %rax
	movq	%rdi, %rbx
	movq	40(%rdi), %rbp
	leaq	8(%rax), %r12
.L59:
	cmpq	%r12, %rbp
	jnb	.L64
	movq	0(%rbp), %rdi
	movl	$512, %esi
	addq	$8, %rbp
	call	_ZdlPvm@PLT
	jmp	.L59
.L64:
	movq	8(%rbx), %rax
	movq	(%rbx), %rdi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 16
	leaq	0(,%rax,8), %rsi
	popq	%r12
	.cfi_restore 12
	.cfi_def_cfa_offset 8
	jmp	_ZdlPvm@PLT
.L57:
	ret
	.cfi_endproc
.LFE4402:
	.size	_ZNSt11_Deque_baseIiSaIiEED2Ev, .-_ZNSt11_Deque_baseIiSaIiEED2Ev
	.weak	_ZNSt11_Deque_baseIiSaIiEED1Ev
	.set	_ZNSt11_Deque_baseIiSaIiEED1Ev,_ZNSt11_Deque_baseIiSaIiEED2Ev
	.section	.text._ZNSt5dequeIiSaIiEE4backEv,"axG",@progbits,_ZNSt5dequeIiSaIiEE4backEv,comdat
	.align 2
	.weak	_ZNSt5dequeIiSaIiEE4backEv
	.type	_ZNSt5dequeIiSaIiEE4backEv, @function
_ZNSt5dequeIiSaIiEE4backEv:
.LFB4411:
	.cfi_startproc
	endbr64
	movq	48(%rdi), %rax
	movq	72(%rdi), %rdx
	cmpq	56(%rdi), %rax
	jne	.L66
	movq	-8(%rdx), %rax
	addq	$512, %rax
.L66:
	subq	$4, %rax
	ret
	.cfi_endproc
.LFE4411:
	.size	_ZNSt5dequeIiSaIiEE4backEv, .-_ZNSt5dequeIiSaIiEE4backEv
	.section	.text._ZStmiRKSt15_Deque_iteratorIiRiPiES4_,"axG",@progbits,_ZStmiRKSt15_Deque_iteratorIiRiPiES4_,comdat
	.weak	_ZStmiRKSt15_Deque_iteratorIiRiPiES4_
	.type	_ZStmiRKSt15_Deque_iteratorIiRiPiES4_, @function
_ZStmiRKSt15_Deque_iteratorIiRiPiES4_:
.LFB4652:
	.cfi_startproc
	endbr64
	movq	24(%rdi), %rdx
	movq	%rdx, %rax
	subq	24(%rsi), %rax
	sarq	$3, %rax
	cmpq	$1, %rdx
	movq	(%rdi), %rdx
	adcq	$-1, %rax
	subq	8(%rdi), %rdx
	sarq	$2, %rdx
	salq	$7, %rax
	addq	%rdx, %rax
	movq	16(%rsi), %rdx
	subq	(%rsi), %rdx
	sarq	$2, %rdx
	addq	%rdx, %rax
	ret
	.cfi_endproc
.LFE4652:
	.size	_ZStmiRKSt15_Deque_iteratorIiRiPiES4_, .-_ZStmiRKSt15_Deque_iteratorIiRiPiES4_
	.section	.text._ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb,"axG",@progbits,_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb,comdat
	.align 2
	.weak	_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb
	.type	_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb, @function
_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb:
.LFB4655:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edx, %ecx
	movq	%rsi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	72(%rdi), %rdx
	movq	40(%rdi), %rsi
	movq	%rdx, %r12
	subq	%rsi, %r12
	movq	%r12, %rax
	sarq	$3, %rax
	leaq	1(%r15,%rax), %r8
	movq	8(%rdi), %rax
	leaq	(%r8,%r8), %rdi
	cmpq	%rax, %rdi
	jnb	.L69
	subq	%r8, %rax
	movq	0(%rbp), %rbx
	xorl	%edi, %edi
	shrq	%rax
	salq	$3, %rax
	testb	%cl, %cl
	je	.L70
	leaq	0(,%r15,8), %rdi
.L70:
	addq	%rdi, %rax
	addq	$8, %rdx
	addq	%rax, %rbx
	subq	%rsi, %rdx
	cmpq	%rsi, %rbx
	jnb	.L71
	movq	%rbx, %rdi
	cmpq	$8, %rdx
	jg	.L85
	jne	.L75
	movq	(%rsi), %rax
	movq	%rax, (%rbx)
	jmp	.L75
.L71:
	leaq	8(%rbx,%r12), %rdi
	cmpq	$8, %rdx
	jle	.L76
	subq	%rdx, %rdi
.L85:
	call	memmove@PLT
	jmp	.L75
.L76:
	jne	.L75
	movq	(%rsi), %rax
	movq	%rax, -8(%rdi)
	jmp	.L75
.L69:
	cmpq	%r15, %rax
	movq	%r15, %rdx
	cmovnb	%rax, %rdx
	leaq	2(%rax,%rdx), %r13
	movabsq	$1152921504606846975, %rax
	cmpq	%r13, %rax
	jnb	.L77
	movabsq	$2305843009213693951, %rax
	cmpq	%r13, %rax
	jnb	.L78
	call	_ZSt28__throw_bad_array_new_lengthv@PLT
.L78:
	call	_ZSt17__throw_bad_allocv@PLT
.L77:
	leaq	0(,%r13,8), %rdi
	movl	%ecx, 12(%rsp)
	movq	%r13, %rbx
	movq	%r8, (%rsp)
	call	_Znwm@PLT
	movq	(%rsp), %r8
	movl	12(%rsp), %ecx
	movq	%rax, %r14
	xorl	%eax, %eax
	subq	%r8, %rbx
	shrq	%rbx
	salq	$3, %rbx
	testb	%cl, %cl
	je	.L79
	leaq	0(,%r15,8), %rax
.L79:
	addq	%rax, %rbx
	movq	72(%rbp), %rax
	movq	40(%rbp), %rsi
	addq	%r14, %rbx
	leaq	8(%rax), %rdx
	subq	%rsi, %rdx
	cmpq	$8, %rdx
	jle	.L80
	movq	%rbx, %rdi
	call	memmove@PLT
	jmp	.L81
.L80:
	jne	.L81
	movq	(%rsi), %rax
	movq	%rax, (%rbx)
.L81:
	movq	8(%rbp), %rax
	movq	0(%rbp), %rdi
	leaq	0(,%rax,8), %rsi
	call	_ZdlPvm@PLT
	movq	%r14, 0(%rbp)
	movq	%r13, 8(%rbp)
.L75:
	movq	(%rbx), %rax
	movq	%rbx, 40(%rbp)
	addq	%r12, %rbx
	movq	%rbx, 72(%rbp)
	movq	%rax, 24(%rbp)
	addq	$512, %rax
	movq	%rax, 32(%rbp)
	movq	(%rbx), %rax
	movq	%rax, 56(%rbp)
	addq	$512, %rax
	movq	%rax, 64(%rbp)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4655:
	.size	_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb, .-_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb
	.section	.text._ZNSt5dequeIiSaIiEE22_M_reserve_map_at_backEm,"axG",@progbits,_ZNSt5dequeIiSaIiEE22_M_reserve_map_at_backEm,comdat
	.align 2
	.weak	_ZNSt5dequeIiSaIiEE22_M_reserve_map_at_backEm
	.type	_ZNSt5dequeIiSaIiEE22_M_reserve_map_at_backEm, @function
_ZNSt5dequeIiSaIiEE22_M_reserve_map_at_backEm:
.LFB4611:
	.cfi_startproc
	endbr64
	movq	72(%rdi), %rax
	movq	8(%rdi), %rdx
	leaq	1(%rsi), %rcx
	subq	(%rdi), %rax
	sarq	$3, %rax
	subq	%rax, %rdx
	cmpq	%rcx, %rdx
	jnb	.L86
	xorl	%edx, %edx
	jmp	_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb
.L86:
	ret
	.cfi_endproc
.LFE4611:
	.size	_ZNSt5dequeIiSaIiEE22_M_reserve_map_at_backEm, .-_ZNSt5dequeIiSaIiEE22_M_reserve_map_at_backEm
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC6:
	.string	"cannot create std::deque larger than max_size()"
	.text
	.globl	_Z9calculateP4vectPfP4nodeS0_if
	.type	_Z9calculateP4vectPfP4nodeS0_if, @function
_Z9calculateP4vectPfP4nodeS0_if:
.LFB3908:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3908
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	movq	%rsi, 24(%rsp)
	movl	%r8d, 40(%rsp)
	movss	%xmm0, 44(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
.L89:
	cmpl	%ebx, 40(%rsp)
	jle	.L137
	movq	$8, 72(%rsp)
	xorl	%ecx, %ecx
	movl	$64, %edi
	movq	%rcx, 80(%rsp)
	movq	%rcx, 88(%rsp)
	movq	%rcx, 96(%rsp)
	movq	%rcx, 104(%rsp)
	movq	%rcx, 112(%rsp)
	movq	%rcx, 120(%rsp)
	movq	%rcx, 128(%rsp)
	movq	%rcx, 136(%rsp)
.LEHB0:
	call	_Znwm@PLT
.LEHE0:
	movl	$512, %edi
	movq	%rax, 64(%rsp)
	movq	%rax, %r12
	leaq	24(%rax), %r15
.LEHB1:
	call	_Znwm@PLT
.LEHE1:
	leaq	512(%rax), %rdx
	movss	0(%r13,%rbx,8), %xmm4
	movq	%rax, 24(%r12)
	movq	%rdx, 96(%rsp)
	movss	4(%r13,%rbx,8), %xmm5
	movq	%rdx, 128(%rsp)
	xorl	%edx, %edx
	movl	%edx, (%rax)
	movq	%rax, 88(%rsp)
	movq	%rax, 120(%rsp)
	movq	%rax, 80(%rsp)
	addq	$4, %rax
	movq	%r15, 104(%rsp)
	movq	%r15, 136(%rsp)
	movq	%rax, 112(%rsp)
	movss	%xmm4, 8(%rsp)
	movss	%xmm5, 12(%rsp)
	jmp	.L90
.L119:
	endbr64
	movq	%rax, %rdi
.L91:
	call	__cxa_begin_catch@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L135
.LEHB2:
	call	__cxa_rethrow@PLT
.LEHE2:
.L120:
	endbr64
	movq	%rax, %rbx
.L93:
	call	__cxa_end_catch@PLT
	movq	%rbx, %rdi
	call	__cxa_begin_catch@PLT
	movl	$64, %esi
	movq	%r12, %rdi
	call	_ZdlPvm@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L135
.LEHB3:
	call	__cxa_rethrow@PLT
.LEHE3:
.L118:
	endbr64
	movq	%rax, %rbx
.L95:
	call	__cxa_end_catch@PLT
	jmp	.L136
.L110:
	call	_ZNSt5dequeIiSaIiEE4backEv
	movl	(%rax), %r15d
	cmpq	120(%rsp), %r12
	je	.L97
	subq	$4, %r12
	movq	%r12, 112(%rsp)
.L98:
	movslq	%r15d, %rax
	movss	8(%rsp), %xmm0
	movss	12(%rsp), %xmm3
	leaq	148(%rsp), %rdi
	imulq	$52, %rax, %rax
	movl	$13, %ecx
	addq	%r14, %rax
	subss	(%rax), %xmm0
	subss	4(%rax), %xmm3
	movq	%rax, %rsi
	movss	8(%rax), %xmm2
	movss	36(%rax), %xmm6
	rep movsl
	movss	40(%rax), %xmm7
	movss	44(%rax), %xmm1
	mulss	%xmm3, %xmm3
	movss	%xmm2, 48(%rsp)
	movl	48(%rax), %r12d
	mulss	%xmm0, %xmm0
	movss	%xmm6, 32(%rsp)
	movss	%xmm7, 16(%rsp)
	movss	%xmm1, 60(%rsp)
	addss	%xmm3, %xmm0
	call	sqrtf@PLT
	movss	48(%rsp), %xmm2
	movaps	%xmm0, %xmm3
	xorps	%xmm0, %xmm0
	comiss	%xmm0, %xmm3
	movss	%xmm3, 56(%rsp)
	jbe	.L128
	movss	60(%rsp), %xmm1
	movd	%r12d, %xmm0
	subss	32(%rsp), %xmm1
	subss	16(%rsp), %xmm0
	call	fmaxf@PLT
	movss	56(%rsp), %xmm3
	movss	48(%rsp), %xmm2
	divss	%xmm3, %xmm0
.L99:
	movss	44(%rsp), %xmm6
	comiss	%xmm0, %xmm6
	jbe	.L129
.L133:
	movss	8(%rsp), %xmm0
	movl	12(%rsp), %edx
	movq	24(%rsp), %rcx
	salq	$32, %rdx
	movd	%xmm0, %eax
	movq	148(%rsp), %xmm0
	orq	%rdx, %rax
	movss	(%rcx,%rbx,4), %xmm3
	movq	%rax, %xmm1
	call	_Z7gravity4vectS_ff
	movq	%xmm0, %rax
	addss	0(%rbp,%rbx,8), %xmm0
	shrq	$32, %rax
	movss	%xmm0, 0(%rbp,%rbx,8)
	movd	%eax, %xmm0
	addss	4(%rbp,%rbx,8), %xmm0
	movss	%xmm0, 4(%rbp,%rbx,8)
.L90:
	movq	112(%rsp), %r12
	cmpq	80(%rsp), %r12
	leaq	64(%rsp), %rdi
	jne	.L110
	jmp	.L138
.L97:
	movl	$512, %esi
	movq	%r12, %rdi
	call	_ZdlPvm@PLT
	movq	136(%rsp), %rax
	leaq	-8(%rax), %rdx
	movq	-8(%rax), %rax
	movq	%rdx, 136(%rsp)
	movq	%rax, 120(%rsp)
	leaq	512(%rax), %rdx
	addq	$508, %rax
	movq	%rdx, 128(%rsp)
	movq	%rax, 112(%rsp)
	jmp	.L98
.L128:
	movss	.LC3(%rip), %xmm0
	jmp	.L99
.L129:
	leaq	160(%rsp), %rax
	xorl	%r12d, %r12d
	movq	%rax, 48(%rsp)
	cmpl	$21844, %r15d
	jle	.L104
	jmp	.L133
.L140:
	movslq	%r15d, %rdx
	imulq	$52, %rdx, %rdx
	movl	32(%r14,%rdx), %ecx
	cmpl	%ecx, 28(%r14,%rdx)
	jle	.L139
.L106:
	addq	$4, %r12
	cmpq	$16, %r12
	je	.L90
.L104:
	movq	48(%rsp), %rax
	movl	(%rax,%r12), %r15d
	movq	112(%rsp), %rax
	cmpl	$-1, %r15d
	jne	.L140
	jmp	.L106
.L139:
	movq	128(%rsp), %rcx
	leaq	-4(%rcx), %rdx
	cmpq	%rdx, %rax
	je	.L107
	movl	%r15d, (%rax)
	addq	$4, %rax
	jmp	.L132
.L107:
	leaq	64(%rsp), %rax
	leaq	80(%rsp), %rsi
	leaq	112(%rsp), %rdi
	movq	%rax, 32(%rsp)
	call	_ZStmiRKSt15_Deque_iteratorIiRiPiES4_
	movq	%rax, %rdx
	movabsq	$2305843009213693951, %rax
	cmpq	%rax, %rdx
	jne	.L108
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L135
	leaq	.LC6(%rip), %rdi
.LEHB4:
	call	_ZSt20__throw_length_errorPKc@PLT
.L108:
	movq	32(%rsp), %rdi
	movl	$1, %esi
	call	_ZNSt5dequeIiSaIiEE22_M_reserve_map_at_backEm
	movq	136(%rsp), %rax
	movl	$512, %edi
	movq	%rax, 16(%rsp)
	call	_Znwm@PLT
.LEHE4:
	movq	16(%rsp), %rsi
	movq	112(%rsp), %rdx
	movq	%rax, 120(%rsp)
	movq	%rax, 8(%rsi)
	movl	%r15d, (%rdx)
	leaq	8(%rsi), %rdx
	movq	%rdx, 136(%rsp)
	leaq	512(%rax), %rdx
	movq	%rdx, 128(%rsp)
.L132:
	movq	%rax, 112(%rsp)
	jmp	.L106
.L138:
	call	_ZNSt11_Deque_baseIiSaIiEED2Ev
	incq	%rbx
	jmp	.L89
.L117:
	endbr64
	movq	%rax, %rbx
.L112:
	movq	32(%rsp), %rdi
	call	_ZNSt11_Deque_baseIiSaIiEED2Ev
.L136:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L135
	movq	%rbx, %rdi
.LEHB5:
	call	_Unwind_Resume@PLT
.LEHE5:
.L137:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L114
.L135:
	call	__stack_chk_fail@PLT
.L114:
	addq	$216, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3908:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
	.align 4
.LLSDA3908:
	.byte	0xff
	.byte	0x9b
	.uleb128 .LLSDATT3908-.LLSDATTD3908
.LLSDATTD3908:
	.byte	0x1
	.uleb128 .LLSDACSE3908-.LLSDACSB3908
.LLSDACSB3908:
	.uleb128 .LEHB0-.LFB3908
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3908
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L119-.LFB3908
	.uleb128 0x1
	.uleb128 .LEHB2-.LFB3908
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L120-.LFB3908
	.uleb128 0x3
	.uleb128 .LEHB3-.LFB3908
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L118-.LFB3908
	.uleb128 0
	.uleb128 .LEHB4-.LFB3908
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L117-.LFB3908
	.uleb128 0
	.uleb128 .LEHB5-.LFB3908
	.uleb128 .LEHE5-.LEHB5
	.uleb128 0
	.uleb128 0
.LLSDACSE3908:
	.byte	0x1
	.byte	0
	.byte	0
	.byte	0x7d
	.align 4
	.long	0

.LLSDATT3908:
	.text
	.size	_Z9calculateP4vectPfP4nodeS0_if, .-_Z9calculateP4vectPfP4nodeS0_if
	.section	.rodata.str1.1
.LC7:
	.string	"n : "
.LC8:
	.string	"%d"
.LC10:
	.string	"%f %f\n %f %f\n"
.LC11:
	.string	"theta : "
.LC12:
	.string	"%f"
.LC13:
	.string	"%d : x %f y %f m %f : %.15f %.15f\n"
.LC14:
	.string	"cpu time : %f\n"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3915:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC7(%rip), %rsi
	movl	$2, %edi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	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	__printf_chk@PLT
	leaq	-96(%rbp), %rsi
	leaq	.LC8(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
	movslq	-96(%rbp), %rcx
	movq	%rsp, %rsi
	leaq	15(,%rcx,8), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rsi
.L142:
	cmpq	%rsi, %rsp
	je	.L143
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L142
.L143:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L144
	orq	$0, -8(%rsp,%rax)
.L144:
	leaq	15(,%rcx,4), %rdx
	movq	%rsp, %rcx
	movq	%rsp, %rbx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L145:
	cmpq	%rcx, %rsp
	je	.L146
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L145
.L146:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L147
	orq	$0, -8(%rsp,%rax)
.L147:
	xorps	%xmm0, %xmm0
	movq	%rsp, %r14
	xorl	%r12d, %r12d
	movl	$1000000, %r13d
	movaps	%xmm0, %xmm1
	movss	%xmm0, -120(%rbp)
.L148:
	movslq	-96(%rbp), %rax
	cmpl	%r12d, %eax
	jle	.L175
	movss	%xmm0, -112(%rbp)
	movss	%xmm1, -108(%rbp)
	call	rand@PLT
	cltd
	idivl	%r13d
	cvtsi2ssl	%edx, %xmm3
	movss	%xmm3, (%rbx,%r12,8)
	movss	%xmm3, -104(%rbp)
	call	rand@PLT
	cltd
	idivl	%r13d
	cvtsi2ssl	%edx, %xmm2
	movss	%xmm2, 4(%rbx,%r12,8)
	movss	%xmm2, -100(%rbp)
	call	rand@PLT
	movss	-104(%rbp), %xmm3
	movss	-108(%rbp), %xmm1
	cltd
	movss	-100(%rbp), %xmm2
	movss	-112(%rbp), %xmm0
	idivl	%r13d
	addss	%xmm3, %xmm1
	addss	%xmm2, %xmm0
	cvtsi2ssl	%edx, %xmm4
	movss	%xmm4, (%r14,%r12,4)
	addss	-120(%rbp), %xmm4
	incq	%r12
	movss	%xmm4, -120(%rbp)
	jmp	.L148
.L175:
	cvtsi2ssl	%eax, %xmm2
	leaq	15(,%rax,8), %rdx
	movq	%rsp, %rcx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
	divss	%xmm2, %xmm1
	divss	%xmm2, %xmm0
	movss	%xmm1, -140(%rbp)
	movss	%xmm0, -144(%rbp)
.L150:
	cmpq	%rcx, %rsp
	je	.L151
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L150
.L151:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L152
	orq	$0, -8(%rsp,%rax)
.L152:
	leaq	-88(%rbp), %rax
	xorl	%esi, %esi
	movq	%rsp, %r12
	xorl	%r15d, %r15d
	movq	%rax, %rdi
	movq	%rax, -128(%rbp)
	call	gettimeofday@PLT
	movss	.LC4(%rip), %xmm7
	movl	-96(%rbp), %r13d
	movss	%xmm7, -104(%rbp)
	movss	%xmm7, -112(%rbp)
	movss	.LC3(%rip), %xmm7
	movss	%xmm7, -100(%rbp)
	movss	%xmm7, -108(%rbp)
.L153:
	cmpl	%r15d, %r13d
	jle	.L176
	movss	(%rbx,%r15,8), %xmm7
	movl	$0x00000000, (%r12,%r15,8)
	movl	$0x00000000, 4(%r12,%r15,8)
	movss	-108(%rbp), %xmm1
	movaps	%xmm7, %xmm0
	movss	%xmm7, -116(%rbp)
	call	fminf@PLT
	movss	-112(%rbp), %xmm1
	movss	%xmm0, -108(%rbp)
	movss	-116(%rbp), %xmm0
	call	fmaxf@PLT
	movss	4(%rbx,%r15,8), %xmm6
	movss	-100(%rbp), %xmm1
	incq	%r15
	movss	%xmm0, -112(%rbp)
	movaps	%xmm6, %xmm0
	movss	%xmm6, -116(%rbp)
	call	fminf@PLT
	movss	-104(%rbp), %xmm1
	movss	%xmm0, -100(%rbp)
	movss	-116(%rbp), %xmm0
	call	fmaxf@PLT
	movss	%xmm0, -104(%rbp)
	jmp	.L153
.L176:
	leaq	-72(%rbp), %rax
	xorl	%esi, %esi
	movq	%rax, %rdi
	movq	%rax, -136(%rbp)
	call	gettimeofday@PLT
	movq	-72(%rbp), %rax
	subq	-88(%rbp), %rax
	leaq	.LC10(%rip), %rsi
	movl	$2, %edi
	cvtss2sd	-104(%rbp), %xmm3
	cvtss2sd	-112(%rbp), %xmm2
	imulq	$1000, %rax, %rax
	cvtsi2ssq	%rax, %xmm1
	movq	-64(%rbp), %rax
	subq	-80(%rbp), %rax
	cvtsi2ssq	%rax, %xmm0
	divss	.LC9(%rip), %xmm0
	movb	$4, %al
	addss	%xmm0, %xmm1
	cvtss2sd	-108(%rbp), %xmm0
	movss	%xmm1, -116(%rbp)
	cvtss2sd	-100(%rbp), %xmm1
	call	__printf_chk@PLT
	leaq	-4542464(%rsp), %rax
.L155:
	cmpq	%rax, %rsp
	je	.L156
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L155
.L156:
	subq	$1360, %rsp
	orq	$0, 1352(%rsp)
	leaq	3(%rsp), %rdx
	movq	%rdx, %rax
	andq	$-4, %rdx
	movq	%rdx, %r13
	shrq	$2, %rax
	leaq	12(%rdx), %rdx
	leaq	4543824(%r13), %rcx
.L158:
	movl	$-1, (%rdx)
	addq	$52, %rdx
	movl	$-1, -48(%rdx)
	movl	$-1, -44(%rdx)
	movl	$-1, -40(%rdx)
	cmpq	%rcx, %rdx
	jne	.L158
	movl	-96(%rbp), %ecx
	movss	-140(%rbp), %xmm7
	xorl	%edx, %edx
	xorl	%r15d, %r15d
	movss	-144(%rbp), %xmm3
	movl	%edx, 28(,%rax,4)
	leal	-1(%rcx), %edx
	movss	-120(%rbp), %xmm4
	movss	-108(%rbp), %xmm5
	movss	%xmm7, 0(,%rax,4)
	movss	-100(%rbp), %xmm6
	movss	-112(%rbp), %xmm7
	movss	%xmm3, 4(,%rax,4)
	movl	%edx, 32(,%rax,4)
	movss	-104(%rbp), %xmm3
	movss	%xmm4, 8(,%rax,4)
	movss	%xmm5, 36(,%rax,4)
	movss	%xmm6, 40(,%rax,4)
	movss	%xmm7, 44(,%rax,4)
	movss	%xmm3, 48(,%rax,4)
.L159:
	movq	-128(%rbp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	movl	%r15d, %ecx
	movq	%r13, %rdx
	movq	%r14, %rsi
	movl	$87381, %r8d
	movq	%rbx, %rdi
	incl	%r15d
	call	_Z9constructP4vectPfP4nodeii
	movq	-136(%rbp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	movq	-72(%rbp), %rax
	subq	-88(%rbp), %rax
	imulq	$1000, %rax, %rax
	cvtsi2ssq	%rax, %xmm0
	movq	-64(%rbp), %rax
	subq	-80(%rbp), %rax
	cvtsi2ssq	%rax, %xmm1
	divss	.LC9(%rip), %xmm1
	addss	%xmm1, %xmm0
	addss	-116(%rbp), %xmm0
	movss	%xmm0, -116(%rbp)
	cmpl	$8, %r15d
	jne	.L159
	leaq	.LC11(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	-92(%rbp), %rsi
	xorl	%eax, %eax
	leaq	.LC12(%rip), %rdi
	call	__isoc23_scanf@PLT
	movq	-128(%rbp), %rdi
	xorl	%esi, %esi
	leaq	.LC13(%rip), %r15
	call	gettimeofday@PLT
	movss	-92(%rbp), %xmm0
	movq	%r13, %rdx
	movq	%r12, %rcx
	movl	-96(%rbp), %r8d
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%r13d, %r13d
	call	_Z9calculateP4vectPfP4nodeS0_if
	movq	-136(%rbp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	movq	-72(%rbp), %rax
	subq	-88(%rbp), %rax
	imulq	$1000, %rax, %rax
	cvtsi2ssq	%rax, %xmm5
	movq	-64(%rbp), %rax
	subq	-80(%rbp), %rax
	cvtsi2ssq	%rax, %xmm0
	divss	.LC9(%rip), %xmm0
	addss	%xmm0, %xmm5
	addss	-116(%rbp), %xmm5
.L160:
	movl	%r13d, %edx
	cmpl	%r13d, -96(%rbp)
	jle	.L177
	movq	%r15, %rsi
	movl	$2, %edi
	movb	$5, %al
	movss	%xmm5, -100(%rbp)
	cvtss2sd	(%rbx,%r13,8), %xmm0
	cvtss2sd	4(%r12,%r13,8), %xmm4
	cvtss2sd	(%r12,%r13,8), %xmm3
	cvtss2sd	(%r14,%r13,4), %xmm2
	cvtss2sd	4(%rbx,%r13,8), %xmm1
	call	__printf_chk@PLT
	incq	%r13
	movss	-100(%rbp), %xmm5
	jmp	.L160
.L177:
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	%xmm5, %xmm0
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L162
	call	__stack_chk_fail@PLT
.L162:
	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
.LFE3915:
	.size	main, .-main
	.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
.LC2:
	.long	1056964608
	.align 4
.LC3:
	.long	2139095039
	.align 4
.LC4:
	.long	8388608
	.align 4
.LC5:
	.long	1065353216
	.align 4
.LC9:
	.long	1148846080
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.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:

#include <stdio.h>
#include <stdlib.h>
#include <hip/hip_runtime.h>
#include <math.h>
#include <limits.h>
#include <float.h>
#include <iostream>
#include <sys/time.h>
#include <stack>

#define G 6.67408E-11	//Gravitational constant 
#define lvl 9		//depth of quad tree till which we'll divide plane

using namespace std;

struct vect		//Structure for 2D coordinate
{
	float x; // X coordinate
	float y; // Y coordinate
};

struct node		//Structure for each node of the quad tree
{
	vect body; //centre of mass of bodies in current node

	float mass; //total mass of bodies in current node
	int child[4]; //children indices in nodes array
	int l,r; //index limit in body array of bodies in current node

	vect min, max; //min and max X and Y coordinates of bodies belonging to current node
};

//Function calculate Gravitational force between two body
vect gravity (vect a, vect 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;

	vect 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;
}

//This function will construct particular level of the tree.
//Each node will be divided further into four new nodes and bodies in the array will be swapped so that bodies belonging to same node remain together in the array

void construct(vect *body, float *mass, node *nodes, int level, int tot)
{
	int index;
	int total = 1<<(2*level);    //total nodes in current level
	int offset=((1<<(2*level))-1)/3;   //total nodes in tree upto previous level
	int off=offset+total;    //total nodes upto current level in tree

	for (int m=0; m<total; m++)
	{
		int tid=m*4;

		index=m+offset; //actual index in nodes array

		node nd=nodes[index];

		if (nodes[index].l<=nodes[index].r)
		{
			float xl=nd.min.x, xr=nd.max.x;
			float yl=nd.min.y, yr=nd.max.y;

			float xmid=xl+(xr-xl)/2;
			float ymid=yl+(yr-yl)/2;

			float l=nd.l, r=nd.r;

			node child[4];

			for (int i=0;i<4;i++)
			{
				for (int j=0;j<4;j++)	child[i].child[j]=-1;
				child[i].min.x=child[i].min.y=FLT_MAX, child[i].max.x=child[i].max.y=FLT_MIN;
			}

			int i=l-1;

			float m=0, x=0, y=0, mm=0, xx=0, yy=0;
			
			for (int j=l;j<=r;j++) //swapping of bodies belonging to current node based on x-coordinates creating two children
			{
				if (body[j].x<=xmid)
				{
					i++;
					
					vect temp=body[i];
					body[i]=body[j];
					body[j]=temp;

					float t=mass[i];
					mass[i]=mass[j];
					mass[j]=t;
				}

			}

			child[2].l=l, child[2].r=i;
			child[3].l=i+1, child[3].r=r;

			for (int k=2;k<=3;k++)
			{
				m=mm=x=xx=y=yy=0;

				l=child[k].l, r=child[k].r;

				i=l-1;

				int cnt=0;

				for (int j=l;j<=r;j++) //swapping of bodies in two children created previously based on y-coordinates, each creating two new children
				{
					x+=body[j].x;
					y+=body[j].y;
					m+=mass[j];

					if (body[j].y<=ymid)
					{
						xx+=body[j].x, yy+=body[j].y, mm+=mass[j];
						cnt++;
						i++;
						
						vect temp=body[i];
						body[i]=body[j];
						body[j]=temp;

						float t=mass[i];
						mass[i]=mass[j];
						mass[j]=t;
					}
				}
				
				if(cnt>0)	child[k].mass=mm, child[k].body.x=xx/cnt, child[k].body.y=yy/cnt;

				child[k].l=l, child[k].r=i;

				mm=m-mm, xx=x-xx, yy=y-yy, cnt=r-l+1-cnt;
				
				if(cnt>0)	child[k-2].mass=mm, child[k-2].body.x=xx/cnt, child[k-2].body.y=yy/cnt;

				child[k-2].l=i+1, child[k-2].r=r;
			}			

			for (int i=0;i<4;i++)	
			{
				if (i%2)	child[i].min.x=xmid, child[i].max.x=xr;
				else	child[i].min.x=xl, child[i].max.x=xmid;
				
				if (i<2)	child[i].min.y=ymid, child[i].max.y=yr;
				else	child[i].min.y=yl, child[i].max.y=ymid;

				if (off+tid+i<tot)	nodes[off+tid+i]=child[i];
				nd.child[i]=off+tid+i;
			}
		}
		else
		{
			for (int i=0;i<4;i++)
			{
				if (off+tid+i<tot)
				{
					nodes[off+tid+i].l=0;
					nodes[off+tid+i].r=-1;
				}
				nd.child[i]=off+tid+i;
			}
		}

		nodes[index]=nd;
	}
}

//This function calculates force on bodies
void calculate(vect *body, float *mass, node *nodes, vect *force, int n, float theta)
{
	int l=((1<<(2*(lvl-1)))-1)/3; //total nodes in tree upto max depth

	for (int index=0;index<n;index++)
	{
		stack <int> st;

		st.push(0);

		vect bd=body[index];

		while (!st.empty()) //for each body do DFS until reached leaf
		{
			int t=st.top();
			st.pop();

			node nd=nodes[t];

			float s=fmax(nd.max.x-nd.min.x, nd.max.y-nd.min.y);

			float x=bd.x-nd.body.x, y=bd.y-nd.body.y;

			float dist=sqrt(x*x+y*y);

			float val=FLT_MAX;

			if (dist>0)	val=s/dist;

			if (val<theta)	//Barnes-Hutt approximation
			{			
				vect frc=gravity(nd.body, bd, nd.mass, mass[index]);

				force[index].x+=frc.x;
				force[index].y+=frc.y;
			}
			else
			{
				if (t>=l) //if reached leaf
				{
					vect frc=gravity(nd.body, bd, nd.mass, mass[index]);

					force[index].x+=frc.x;
					force[index].y+=frc.y;

					continue;
				}

				for (int i=0;i<4;i++)
				{
					int temp=nd.child[i];

					if (temp==-1 || nodes[temp].l>nodes[temp].r)	continue;
				
					st.push(temp);
				}
			}
		}
	}
}

float maxx(float a, float b)
{
	return (a<b?b:a);
}

float minn(float a, float b)
{
	return (a<b?a:b);
}

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

	vect body[n];

	float mass[n];

	float m=0, x=0, y=0;

	for (int i=0;i<n;i++)	
	{	//Here we're going to take random inputs
		body[i].x=rand()%1000000;
		body[i].y=rand()%1000000;
		mass[i]=rand()%1000000;

		m+=mass[i], x+=body[i].x, y+=body[i].y;
	}	

	x/=n, y/=n; //centre of mass of the system

	vect force[n];

	vect mn, mx;

	mn.x=mn.y=FLT_MAX, mx.x=mx.y=FLT_MIN;

	struct timeval start, stop;

	gettimeofday(&start, NULL);

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

		mn.x=min(mn.x, body[i].x);
		mx.x=max(mx.x, body[i].x);

		mn.y=min(mn.y, body[i].y);
		mx.y=max(mx.y, body[i].y);
	}

	gettimeofday(&stop, NULL);

	long seconds=(stop.tv_sec-start.tv_sec);

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

	vect gmin=mn, gmax=mx;

	printf("%f %f\n %f %f\n", gmin.x, gmin.y, gmax.x, gmax.y);

	int tot=1<<(2*lvl);
	tot=(tot-1)/3;

	node h_nodes[tot];

	for (int i=0;i<tot;i++)
	{
		for (int j=0;j<4;j++)	h_nodes[i].child[j]=-1;
	}

	vect temp;
	temp.x=x, temp.y=y;

	h_nodes[0].body=temp, h_nodes[0].mass=m, h_nodes[0].l=0, h_nodes[0].r=n-1, h_nodes[0].min=gmin, h_nodes[0].max=gmax;

	for (int i=0;i<lvl-1;i++) //creation of tree level by level
	{
		gettimeofday(&start, NULL);
		construct(body, mass, h_nodes, i, tot);
		gettimeofday(&stop, NULL);

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

	printf("theta : ");
	scanf("%f", &theta);

	gettimeofday(&start, NULL);
	calculate(body, mass, h_nodes, force, n, theta);
	gettimeofday(&stop, NULL);

	t+=((stop.tv_sec-start.tv_sec)*1000+float(stop.tv_usec-start.tv_usec)/1000);
//t shows total number of time this serial code take
	x=0, y=0;

	for(int i=0;i<n;i++)
	{
		printf("%d : x %f y %f m %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;
	}

//	printf("%f %f\n", x, y);

	printf("cpu time : %f\n", t);
}


	.text
	.file	"serial.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z7gravity4vectS_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	_Z7gravity4vectS_ff
	.type	_Z7gravity4vectS_ff,@function
_Z7gravity4vectS_ff:                    # @_Z7gravity4vectS_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	_Z7gravity4vectS_ff, .Lfunc_end0-_Z7gravity4vectS_ff
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z9constructP4vectPfP4nodeii
.LCPI1_0:
	.long	0x3f000000                      # float 0.5
.LCPI1_1:
	.long	0xbf800000                      # float -1
.LCPI1_2:
	.long	0x3f800000                      # float 1
	.text
	.globl	_Z9constructP4vectPfP4nodeii
	.type	_Z9constructP4vectPfP4nodeii,@function
_Z9constructP4vectPfP4nodeii:           # @_Z9constructP4vectPfP4nodeii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	addl	%ecx, %ecx
	movl	$1, %r9d
                                        # kill: def $cl killed $cl killed $ecx
	shll	%cl, %r9d
	leal	-1(%r9), %eax
	cltq
	imulq	$1431655766, %rax, %r10         # imm = 0x55555556
	movq	%r10, %rax
	shrq	$63, %rax
	shrq	$32, %r10
	addl	%eax, %r10d
	movslq	%r8d, %r11
	movslq	%r10d, %rbx
	addl	%r9d, %r10d
	leaq	32(%rdx), %rax
	movq	%rax, -40(%rsp)                 # 8-byte Spill
	xorl	%eax, %eax
	pcmpeqd	%xmm3, %xmm3
	movabsq	$9187343237679939583, %rcx      # imm = 0x7F7FFFFF7F7FFFFF
	movabsq	$36028797027352576, %r12        # imm = 0x80000000800000
	movss	.LCPI1_1(%rip), %xmm5           # xmm5 = mem[0],zero,zero,zero
	movss	.LCPI1_2(%rip), %xmm4           # xmm4 = mem[0],zero,zero,zero
	movq	%rdx, -8(%rsp)                  # 8-byte Spill
	movq	%r9, -16(%rsp)                  # 8-byte Spill
	movq	%r11, -24(%rsp)                 # 8-byte Spill
	movq	%rbx, -32(%rsp)                 # 8-byte Spill
.LBB1_1:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_7 Depth 2
                                        #     Child Loop BB1_10 Depth 2
                                        #     Child Loop BB1_14 Depth 2
                                        #       Child Loop BB1_20 Depth 3
                                        #     Child Loop BB1_29 Depth 2
                                        #     Child Loop BB1_3 Depth 2
	movslq	%r10d, %r8
	movq	%r8, -120(%rsp)                 # 8-byte Spill
	imulq	$52, %r8, %rbp
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	addq	%rbx, %rax
	imulq	$52, %rax, %r8
	movl	48(%rdx,%r8), %eax
	movl	%eax, -48(%rsp)
	movups	(%rdx,%r8), %xmm0
	movups	16(%rdx,%r8), %xmm1
	movups	32(%rdx,%r8), %xmm2
	movaps	%xmm2, -64(%rsp)
	movaps	%xmm1, -80(%rsp)
	movaps	%xmm0, -96(%rsp)
	movl	28(%rdx,%r8), %eax
	movq	%r8, 8(%rsp)                    # 8-byte Spill
	cmpl	32(%rdx,%r8), %eax
	jle	.LBB1_6
# %bb.2:                                # %.preheader224
                                        #   in Loop: Header=BB1_1 Depth=1
	addq	-40(%rsp), %rbp                 # 8-byte Folded Reload
	xorl	%eax, %eax
	movq	-120(%rsp), %r8                 # 8-byte Reload
.LBB1_3:                                #   Parent Loop BB1_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	leaq	(%r8,%rax), %rcx
	cmpq	%r11, %rcx
	jge	.LBB1_5
# %bb.4:                                #   in Loop: Header=BB1_3 Depth=2
	movabsq	$-4294967296, %rcx              # imm = 0xFFFFFFFF00000000
	movq	%rcx, -4(%rbp)
.LBB1_5:                                #   in Loop: Header=BB1_3 Depth=2
	leal	(%r10,%rax), %ecx
	movl	%ecx, -84(%rsp,%rax,4)
	incq	%rax
	addq	$52, %rbp
	cmpq	$4, %rax
	jne	.LBB1_3
	jmp	.LBB1_37
.LBB1_6:                                #   in Loop: Header=BB1_1 Depth=1
	addq	%rdx, %rbp
	movss	-60(%rsp), %xmm6                # xmm6 = mem[0],zero,zero,zero
	movss	-52(%rsp), %xmm7                # xmm7 = mem[0],zero,zero,zero
	movss	-56(%rsp), %xmm8                # xmm8 = mem[0],zero,zero,zero
	movss	-48(%rsp), %xmm10               # xmm10 = mem[0],zero,zero,zero
	movaps	%xmm7, %xmm11
	subss	%xmm6, %xmm11
	movss	.LCPI1_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm11
	movaps	%xmm10, %xmm9
	subss	%xmm8, %xmm9
	mulss	%xmm0, %xmm9
	movl	-68(%rsp), %eax
	movl	-64(%rsp), %edx
	movl	$48, %r8d
.LBB1_7:                                # %.preheader
                                        #   Parent Loop BB1_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movdqu	%xmm3, -4(%rsp,%r8)
	movq	%rcx, 20(%rsp,%r8)
	movq	%r12, 28(%rsp,%r8)
	addq	$52, %r8
	cmpq	$256, %r8                       # imm = 0x100
	jne	.LBB1_7
# %bb.8:                                #   in Loop: Header=BB1_1 Depth=1
	movq	%r10, (%rsp)                    # 8-byte Spill
	xorps	%xmm1, %xmm1
	cvtsi2ss	%eax, %xmm1
	xorps	%xmm0, %xmm0
	cvtsi2ss	%edx, %xmm0
	cvttss2si	%xmm1, %eax
	cvttps2dq	%xmm1, %xmm2
	addss	%xmm5, %xmm1
	cvttss2si	%xmm1, %edx
	addss	%xmm6, %xmm11
	cvtdq2ps	%xmm2, %xmm1
	ucomiss	%xmm1, %xmm0
	jb	.LBB1_13
# %bb.9:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB1_1 Depth=1
	movslq	%eax, %r8
	leaq	(%rdi,%r8,8), %r9
	leaq	(%rsi,%r8,4), %r10
	incl	%r8d
	xorl	%r11d, %r11d
.LBB1_10:                               # %.lr.ph
                                        #   Parent Loop BB1_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	ucomiss	(%r9,%r11,8), %xmm11
	jb	.LBB1_12
# %bb.11:                               #   in Loop: Header=BB1_10 Depth=2
	movslq	%edx, %rbx
	incl	%edx
	movq	8(%rdi,%rbx,8), %r14
	movq	(%r9,%r11,8), %r15
	movq	%r15, 8(%rdi,%rbx,8)
	movq	%r14, (%r9,%r11,8)
	movss	4(%rsi,%rbx,4), %xmm1           # xmm1 = mem[0],zero,zero,zero
	movss	(%r10,%r11,4), %xmm2            # xmm2 = mem[0],zero,zero,zero
	movss	%xmm2, 4(%rsi,%rbx,4)
	movss	%xmm1, (%r10,%r11,4)
.LBB1_12:                               #   in Loop: Header=BB1_10 Depth=2
	leal	(%r8,%r11), %ebx
	xorps	%xmm1, %xmm1
	cvtsi2ss	%ebx, %xmm1
	incq	%r11
	ucomiss	%xmm1, %xmm0
	jae	.LBB1_10
.LBB1_13:                               # %._crit_edge
                                        #   in Loop: Header=BB1_1 Depth=1
	movss	%xmm10, -112(%rsp)              # 4-byte Spill
	movss	%xmm7, -104(%rsp)               # 4-byte Spill
	movss	%xmm6, -100(%rsp)               # 4-byte Spill
	movss	%xmm8, -108(%rsp)               # 4-byte Spill
	addss	%xmm8, %xmm9
	movl	%eax, 164(%rsp)
	movl	%edx, 168(%rsp)
	incl	%edx
	movl	%edx, 216(%rsp)
	cvttss2si	%xmm0, %eax
	movl	%eax, 220(%rsp)
	movl	$2, %r10d
	movq	-120(%rsp), %r8                 # 8-byte Reload
.LBB1_14:                               #   Parent Loop BB1_1 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB1_20 Depth 3
	movaps	%xmm11, %xmm8
	imulq	$52, %r10, %rax
	xorps	%xmm11, %xmm11
	cvtsi2ssl	60(%rsp,%rax), %xmm11
	xorps	%xmm10, %xmm10
	cvtsi2ssl	64(%rsp,%rax), %xmm10
	movaps	%xmm11, %xmm0
	addss	%xmm5, %xmm0
	cvttss2si	%xmm0, %r9d
	cvttss2si	%xmm11, %ebx
	cvttps2dq	%xmm11, %xmm0
	cvtdq2ps	%xmm0, %xmm0
	ucomiss	%xmm0, %xmm10
	jae	.LBB1_19
# %bb.15:                               #   in Loop: Header=BB1_14 Depth=2
	xorps	%xmm12, %xmm12
	xorl	%r11d, %r11d
	xorps	%xmm15, %xmm15
	xorps	%xmm0, %xmm0
	xorps	%xmm13, %xmm13
	xorps	%xmm14, %xmm14
	xorps	%xmm1, %xmm1
	jmp	.LBB1_18
.LBB1_19:                               # %.lr.ph240.preheader
                                        #   in Loop: Header=BB1_14 Depth=2
	movaps	%xmm5, %xmm4
	leaq	(%rsp,%rax), %rcx
	addq	$32, %rcx
	movq	%rcx, 24(%rsp)                  # 8-byte Spill
	movslq	%ebx, %r14
	leaq	(%rdi,%r14,8), %r15
	leaq	(%rsi,%r14,4), %r12
	incl	%r14d
	xorps	%xmm12, %xmm12
	xorl	%r8d, %r8d
	xorl	%r11d, %r11d
	xorps	%xmm15, %xmm15
	xorps	%xmm0, %xmm0
	xorps	%xmm13, %xmm13
	xorps	%xmm14, %xmm14
	xorps	%xmm1, %xmm1
.LBB1_20:                               # %.lr.ph240
                                        #   Parent Loop BB1_1 Depth=1
                                        #     Parent Loop BB1_14 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%r15,%r8,8), %xmm5             # xmm5 = mem[0],zero,zero,zero
	movss	4(%r15,%r8,8), %xmm2            # xmm2 = mem[0],zero,zero,zero
	movss	(%r12,%r8,4), %xmm3             # xmm3 = mem[0],zero,zero,zero
	ucomiss	%xmm2, %xmm9
	jb	.LBB1_22
# %bb.21:                               #   in Loop: Header=BB1_20 Depth=3
	addss	%xmm5, %xmm15
	addss	%xmm2, %xmm12
	addss	%xmm3, %xmm0
	incl	%r11d
	movslq	%r9d, %r13
	incl	%r9d
	movq	8(%rdi,%r13,8), %rcx
	movq	(%r15,%r8,8), %rdx
	movq	%rdx, 8(%rdi,%r13,8)
	movq	%rcx, (%r15,%r8,8)
	movss	4(%rsi,%r13,4), %xmm6           # xmm6 = mem[0],zero,zero,zero
	movss	(%r12,%r8,4), %xmm7             # xmm7 = mem[0],zero,zero,zero
	movss	%xmm7, 4(%rsi,%r13,4)
	movss	%xmm6, (%r12,%r8,4)
.LBB1_22:                               #   in Loop: Header=BB1_20 Depth=3
	addss	%xmm5, %xmm14
	addss	%xmm2, %xmm13
	leal	(%r14,%r8), %ecx
	xorps	%xmm2, %xmm2
	cvtsi2ss	%ecx, %xmm2
	addss	%xmm3, %xmm1
	incq	%r8
	ucomiss	%xmm2, %xmm10
	jae	.LBB1_20
# %bb.16:                               # %._crit_edge241
                                        #   in Loop: Header=BB1_14 Depth=2
	testl	%r11d, %r11d
	jle	.LBB1_17
# %bb.23:                               #   in Loop: Header=BB1_14 Depth=2
	xorps	%xmm2, %xmm2
	cvtsi2ss	%r11d, %xmm2
	movss	%xmm0, 40(%rsp,%rax)
	movaps	%xmm15, %xmm3
	divss	%xmm2, %xmm3
	movq	24(%rsp), %rcx                  # 8-byte Reload
	movss	%xmm3, (%rcx)
	movaps	%xmm12, %xmm3
	divss	%xmm2, %xmm3
	movss	%xmm3, 4(%rcx)
	movabsq	$36028797027352576, %r12        # imm = 0x80000000800000
	movaps	%xmm4, %xmm5
	movss	.LCPI1_2(%rip), %xmm4           # xmm4 = mem[0],zero,zero,zero
	movq	-120(%rsp), %r8                 # 8-byte Reload
	jmp	.LBB1_24
.LBB1_17:                               #   in Loop: Header=BB1_14 Depth=2
	movabsq	$36028797027352576, %r12        # imm = 0x80000000800000
	movaps	%xmm4, %xmm5
	movss	.LCPI1_2(%rip), %xmm4           # xmm4 = mem[0],zero,zero,zero
	movq	-120(%rsp), %r8                 # 8-byte Reload
.LBB1_18:                               # %._crit_edge241._crit_edge
                                        #   in Loop: Header=BB1_14 Depth=2
	xorps	%xmm2, %xmm2
	cvtsi2ss	%r11d, %xmm2
.LBB1_24:                               #   in Loop: Header=BB1_14 Depth=2
	addq	%rsp, %rax
	addq	$60, %rax
	movl	%ebx, (%rax)
	movl	%r9d, 4(%rax)
	movaps	%xmm10, %xmm3
	subss	%xmm11, %xmm3
	addss	%xmm4, %xmm3
	subss	%xmm2, %xmm3
	cvttss2si	%xmm3, %edx
	testl	%edx, %edx
	jle	.LBB1_25
# %bb.26:                               #   in Loop: Header=BB1_14 Depth=2
	subss	%xmm12, %xmm13
	subss	%xmm15, %xmm14
	subss	%xmm0, %xmm1
	leaq	-2(%r10), %rax
	imulq	$52, %rax, %rcx
	movss	%xmm1, 40(%rsp,%rcx)
	xorps	%xmm0, %xmm0
	cvtsi2ss	%edx, %xmm0
	divss	%xmm0, %xmm14
	movss	%xmm14, 32(%rsp,%rcx)
	divss	%xmm0, %xmm13
	movss	%xmm13, 36(%rsp,%rcx)
	jmp	.LBB1_27
.LBB1_25:                               # %._crit_edge281
                                        #   in Loop: Header=BB1_14 Depth=2
	leaq	-2(%r10), %rax
.LBB1_27:                               #   in Loop: Header=BB1_14 Depth=2
	movaps	%xmm8, %xmm11
	incl	%r9d
	imulq	$52, %rax, %rax
	cvttss2si	%xmm10, %ecx
	movl	%r9d, 60(%rsp,%rax)
	movl	%ecx, 64(%rsp,%rax)
	incq	%r10
	cmpq	$4, %r10
	jne	.LBB1_14
# %bb.28:                               # %.preheader225
                                        #   in Loop: Header=BB1_1 Depth=1
	movl	$48, %eax
	xorl	%edx, %edx
	movq	-16(%rsp), %r9                  # 8-byte Reload
	movq	(%rsp), %r10                    # 8-byte Reload
	movq	-24(%rsp), %r11                 # 8-byte Reload
	movq	-32(%rsp), %rbx                 # 8-byte Reload
	pcmpeqd	%xmm3, %xmm3
	movss	-100(%rsp), %xmm6               # 4-byte Reload
                                        # xmm6 = mem[0],zero,zero,zero
	movss	-104(%rsp), %xmm7               # 4-byte Reload
                                        # xmm7 = mem[0],zero,zero,zero
	movss	-108(%rsp), %xmm8               # 4-byte Reload
                                        # xmm8 = mem[0],zero,zero,zero
	movss	-112(%rsp), %xmm10              # 4-byte Reload
                                        # xmm10 = mem[0],zero,zero,zero
.LBB1_29:                               #   Parent Loop BB1_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movaps	%xmm6, %xmm0
	movaps	%xmm11, %xmm1
	testb	$1, %dl
	je	.LBB1_31
# %bb.30:                               #   in Loop: Header=BB1_29 Depth=2
	movaps	%xmm11, %xmm0
	movaps	%xmm7, %xmm1
.LBB1_31:                               #   in Loop: Header=BB1_29 Depth=2
	movss	%xmm0, 20(%rsp,%rax)
	movss	%xmm1, 28(%rsp,%rax)
	movaps	%xmm9, %xmm0
	movaps	%xmm10, %xmm1
	cmpq	$2, %rdx
	jb	.LBB1_33
# %bb.32:                               #   in Loop: Header=BB1_29 Depth=2
	movaps	%xmm8, %xmm0
	movaps	%xmm9, %xmm1
.LBB1_33:                               #   in Loop: Header=BB1_29 Depth=2
	movss	%xmm0, 24(%rsp,%rax)
	movss	%xmm1, 32(%rsp,%rax)
	leaq	(%r8,%rdx), %rcx
	cmpq	%r11, %rcx
	jge	.LBB1_35
# %bb.34:                               #   in Loop: Header=BB1_29 Depth=2
	movl	32(%rsp,%rax), %ecx
	movl	%ecx, (%rbp,%rax)
	movups	-16(%rsp,%rax), %xmm0
	movups	(%rsp,%rax), %xmm1
	movups	16(%rsp,%rax), %xmm2
	movups	%xmm2, -16(%rbp,%rax)
	movups	%xmm1, -32(%rbp,%rax)
	movups	%xmm0, -48(%rbp,%rax)
.LBB1_35:                               #   in Loop: Header=BB1_29 Depth=2
	leal	(%r10,%rdx), %ecx
	movl	%ecx, -84(%rsp,%rdx,4)
	incq	%rdx
	addq	$52, %rax
	cmpq	$4, %rdx
	jne	.LBB1_29
# %bb.36:                               #   in Loop: Header=BB1_1 Depth=1
	movq	-8(%rsp), %rdx                  # 8-byte Reload
.LBB1_37:                               # %.loopexit
                                        #   in Loop: Header=BB1_1 Depth=1
	movq	8(%rsp), %rcx                   # 8-byte Reload
	addq	%rdx, %rcx
	movl	-48(%rsp), %eax
	movl	%eax, 48(%rcx)
	movaps	-96(%rsp), %xmm0
	movaps	-80(%rsp), %xmm1
	movaps	-64(%rsp), %xmm2
	movups	%xmm2, 32(%rcx)
	movups	%xmm1, 16(%rcx)
	movups	%xmm0, (%rcx)
	movq	16(%rsp), %rax                  # 8-byte Reload
	incq	%rax
	addq	$4, %r10
	cmpq	%r9, %rax
	movabsq	$9187343237679939583, %rcx      # imm = 0x7F7FFFFF7F7FFFFF
	jne	.LBB1_1
# %bb.38:
	addq	$248, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z9constructP4vectPfP4nodeii, .Lfunc_end1-_Z9constructP4vectPfP4nodeii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z9calculateP4vectPfP4nodeS0_if
.LCPI2_0:
	.long	0x7f7fffff                      # float 3.40282347E+38
.LCPI2_2:
	.long	0x3f800000                      # float 1
.LCPI2_3:
	.long	0x00000000                      # float 0
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI2_1:
	.quad	0x3dd258775e37fa03              # double 6.6740800000000003E-11
	.text
	.globl	_Z9calculateP4vectPfP4nodeS0_if
	.type	_Z9calculateP4vectPfP4nodeS0_if,@function
_Z9calculateP4vectPfP4nodeS0_if:        # @_Z9calculateP4vectPfP4nodeS0_if
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movss	%xmm0, 8(%rsp)                  # 4-byte Spill
	movq	%rdi, 160(%rsp)                 # 8-byte Spill
	testl	%r8d, %r8d
	jle	.LBB2_25
# %bb.1:                                # %.lr.ph68
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rsi, %r15
	movl	%r8d, %eax
	movq	%rax, 168(%rsp)                 # 8-byte Spill
	xorl	%r12d, %r12d
	leaq	80(%rsp), %r13
.LBB2_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_5 Depth 2
                                        #       Child Loop BB2_15 Depth 3
	xorps	%xmm0, %xmm0
	movaps	%xmm0, 144(%rsp)
	movaps	%xmm0, 128(%rsp)
	movaps	%xmm0, 112(%rsp)
	movaps	%xmm0, 96(%rsp)
	movaps	%xmm0, 80(%rsp)
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm
	movl	$0, 16(%rsp)
.Ltmp0:
	movq	%r13, %rdi
	leaq	16(%rsp), %rsi
	callq	_ZNSt5dequeIiSaIiEE12emplace_backIJiEEERiDpOT_
.Ltmp1:
# %bb.3:                                # %_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi.exit
                                        #   in Loop: Header=BB2_2 Depth=1
	movq	128(%rsp), %rdi
	cmpq	96(%rsp), %rdi
	je	.LBB2_24
# %bb.4:                                # %.lr.ph
                                        #   in Loop: Header=BB2_2 Depth=1
	movq	160(%rsp), %rax                 # 8-byte Reload
	movsd	(%rax,%r12,8), %xmm0            # xmm0 = mem[0],zero
	movaps	%xmm0, 176(%rsp)                # 16-byte Spill
	shufps	$85, %xmm0, %xmm0               # xmm0 = xmm0[1,1,1,1]
	movaps	%xmm0, 192(%rsp)                # 16-byte Spill
.LBB2_5:                                #   Parent Loop BB2_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_15 Depth 3
	cmpq	136(%rsp), %rdi
	je	.LBB2_7
# %bb.6:                                #   in Loop: Header=BB2_5 Depth=2
	movl	-4(%rdi), %ebp
	addq	$-4, %rdi
	jmp	.LBB2_8
.LBB2_7:                                #   in Loop: Header=BB2_5 Depth=2
	movq	152(%rsp), %rax
	movq	-8(%rax), %rax
	movl	508(%rax), %ebp
	callq	_ZdlPv
	movq	152(%rsp), %rax
	leaq	-8(%rax), %rcx
	movq	%rcx, 152(%rsp)
	movq	-8(%rax), %rdi
	movq	%rdi, 136(%rsp)
	leaq	512(%rdi), %rax
	movq	%rax, 144(%rsp)
	movl	$508, %eax                      # imm = 0x1FC
	addq	%rax, %rdi
.LBB2_8:                                # %_ZNSt5dequeIiSaIiEE8pop_backEv.exit
                                        #   in Loop: Header=BB2_5 Depth=2
	movq	%rdi, 128(%rsp)
	movslq	%ebp, %rax
	imulq	$52, %rax, %rax
	movups	(%r14,%rax), %xmm0
	movups	16(%r14,%rax), %xmm1
	movups	32(%r14,%rax), %xmm2
	movaps	%xmm2, 48(%rsp)
	movl	48(%r14,%rax), %eax
	movl	%eax, 64(%rsp)
	movaps	%xmm0, 16(%rsp)
	movaps	%xmm1, 32(%rsp)
	movss	60(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	subss	52(%rsp), %xmm0
	movss	64(%rsp), %xmm1                 # xmm1 = mem[0],zero,zero,zero
	subss	56(%rsp), %xmm1
	movaps	%xmm0, %xmm2
	cmpunordss	%xmm0, %xmm2
	movaps	%xmm2, %xmm3
	andps	%xmm1, %xmm3
	maxss	%xmm0, %xmm1
	andnps	%xmm1, %xmm2
	movaps	176(%rsp), %xmm4                # 16-byte Reload
	movaps	%xmm4, %xmm0
	subss	16(%rsp), %xmm0
	orps	%xmm3, %xmm2
	movaps	192(%rsp), %xmm1                # 16-byte Reload
	subss	20(%rsp), %xmm1
	mulss	%xmm0, %xmm0
	mulss	%xmm1, %xmm1
	addss	%xmm0, %xmm1
	xorps	%xmm0, %xmm0
	sqrtss	%xmm1, %xmm0
	divss	%xmm0, %xmm2
	xorps	%xmm1, %xmm1
	cmpltss	%xmm0, %xmm1
	andps	%xmm1, %xmm2
	movss	.LCPI2_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	andnps	%xmm0, %xmm1
	orps	%xmm2, %xmm1
	movss	8(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm0
	jbe	.LBB2_13
# %bb.9:                                #   in Loop: Header=BB2_5 Depth=2
	movsd	16(%rsp), %xmm0                 # xmm0 = mem[0],zero
	xorps	%xmm1, %xmm1
	cvtss2sd	24(%rsp), %xmm1
	mulsd	.LCPI2_1(%rip), %xmm1
	subps	%xmm4, %xmm0
	jmp	.LBB2_10
.LBB2_13:                               #   in Loop: Header=BB2_5 Depth=2
	cmpl	$21844, %ebp                    # imm = 0x5554
	jle	.LBB2_14
# %bb.19:                               #   in Loop: Header=BB2_5 Depth=2
	movsd	16(%rsp), %xmm0                 # xmm0 = mem[0],zero
	xorps	%xmm1, %xmm1
	cvtss2sd	24(%rsp), %xmm1
	mulsd	.LCPI2_1(%rip), %xmm1
	subps	176(%rsp), %xmm0                # 16-byte Folded Reload
.LBB2_10:                               #   in Loop: Header=BB2_5 Depth=2
	movaps	%xmm0, %xmm3
	shufps	$85, %xmm0, %xmm3               # xmm3 = xmm3[1,1],xmm0[1,1]
	movaps	%xmm3, %xmm4
	mulss	%xmm3, %xmm4
	movaps	%xmm0, %xmm2
	mulss	%xmm0, %xmm2
	addss	%xmm4, %xmm2
	xorps	%xmm4, %xmm4
	sqrtss	%xmm2, %xmm4
	ucomiss	.LCPI2_3(%rip), %xmm4
	jbe	.LBB2_12
# %bb.11:                               #   in Loop: Header=BB2_5 Depth=2
	divss	%xmm4, %xmm3
	divss	%xmm4, %xmm0
	unpcklps	%xmm3, %xmm0                    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
.LBB2_12:                               #   in Loop: Header=BB2_5 Depth=2
	xorps	%xmm3, %xmm3
	cvtss2sd	(%r15,%r12,4), %xmm3
	mulsd	%xmm3, %xmm1
	cvtsd2ss	%xmm1, %xmm1
	xorps	%xmm3, %xmm3
	cmpltss	%xmm2, %xmm3
	andps	%xmm3, %xmm2
	movss	.LCPI2_2(%rip), %xmm4           # xmm4 = mem[0],zero,zero,zero
	andnps	%xmm4, %xmm3
	orps	%xmm2, %xmm3
	divss	%xmm3, %xmm1
	movaps	%xmm0, %xmm2
	shufps	$85, %xmm0, %xmm2               # xmm2 = xmm2[1,1],xmm0[1,1]
	mulss	%xmm1, %xmm2
	mulss	%xmm0, %xmm1
	addss	(%rbx,%r12,8), %xmm1
	movss	%xmm1, (%rbx,%r12,8)
	addss	4(%rbx,%r12,8), %xmm2
	movss	%xmm2, 4(%rbx,%r12,8)
	jmp	.LBB2_23
.LBB2_14:                               # %.preheader.preheader
                                        #   in Loop: Header=BB2_5 Depth=2
	movl	$3, %ebp
.LBB2_15:                               # %.preheader
                                        #   Parent Loop BB2_2 Depth=1
                                        #     Parent Loop BB2_5 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movslq	16(%rsp,%rbp,4), %rax
	movl	%eax, 12(%rsp)
	cmpq	$-1, %rax
	je	.LBB2_21
# %bb.16:                               #   in Loop: Header=BB2_15 Depth=3
	imulq	$52, %rax, %rcx
	movl	28(%r14,%rcx), %edx
	cmpl	32(%r14,%rcx), %edx
	jg	.LBB2_21
# %bb.17:                               #   in Loop: Header=BB2_15 Depth=3
	movq	128(%rsp), %rcx
	movq	144(%rsp), %rdx
	addq	$-4, %rdx
	cmpq	%rdx, %rcx
	je	.LBB2_20
# %bb.18:                               #   in Loop: Header=BB2_15 Depth=3
	movl	%eax, (%rcx)
	addq	$4, %rcx
	movq	%rcx, 128(%rsp)
	jmp	.LBB2_21
.LBB2_20:                               #   in Loop: Header=BB2_15 Depth=3
.Ltmp3:
	movq	%r13, %rdi
	leaq	12(%rsp), %rsi
	callq	_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_
.Ltmp4:
.LBB2_21:                               # %_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi.exit
                                        #   in Loop: Header=BB2_15 Depth=3
	incq	%rbp
	cmpq	$7, %rbp
	jne	.LBB2_15
# %bb.22:                               # %.loopexit.loopexit
                                        #   in Loop: Header=BB2_5 Depth=2
	movq	128(%rsp), %rdi
.LBB2_23:                               # %.loopexit
                                        #   in Loop: Header=BB2_5 Depth=2
	cmpq	96(%rsp), %rdi
	jne	.LBB2_5
.LBB2_24:                               # %._crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	movq	%r13, %rdi
	callq	_ZNSt11_Deque_baseIiSaIiEED2Ev
	incq	%r12
	cmpq	168(%rsp), %r12                 # 8-byte Folded Reload
	jne	.LBB2_2
.LBB2_25:                               # %._crit_edge69
	addq	$216, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB2_26:
	.cfi_def_cfa_offset 272
.Ltmp2:
	jmp	.LBB2_27
.LBB2_28:
.Ltmp5:
.LBB2_27:
	movq	%rax, %rbx
	leaq	80(%rsp), %rdi
	callq	_ZNSt11_Deque_baseIiSaIiEED2Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	_Z9calculateP4vectPfP4nodeS0_if, .Lfunc_end2-_Z9calculateP4vectPfP4nodeS0_if
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp4-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Lfunc_end2-.Ltmp4             #   Call between .Ltmp4 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z4maxxff                       # -- Begin function _Z4maxxff
	.type	_Z4maxxff,@function
_Z4maxxff:                              # @_Z4maxxff
	.cfi_startproc
# %bb.0:
	maxss	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	retq
.Lfunc_end3:
	.size	_Z4maxxff, .Lfunc_end3-_Z4maxxff
	.cfi_endproc
                                        # -- End function
	.globl	_Z4minnff                       # -- Begin function _Z4minnff
	.type	_Z4minnff,@function
_Z4minnff:                              # @_Z4minnff
	.cfi_startproc
# %bb.0:
	minss	%xmm1, %xmm0
	retq
.Lfunc_end4:
	.size	_Z4minnff, .Lfunc_end4-_Z4minnff
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI5_0:
	.long	0x00800000                      # float 1.17549435E-38
.LCPI5_1:
	.long	0x7f7fffff                      # float 3.40282347E+38
.LCPI5_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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$.L.str, %edi
	xorl	%eax, %eax
	callq	printf
	leaq	-48(%rbp), %r14
	movl	$.L.str.1, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movq	%rsp, -152(%rbp)                # 8-byte Spill
	movl	(%r14), %eax
	movq	%rsp, %rbx
	leaq	15(,%rax,8), %rax
	andq	$-16, %rax
	subq	%rax, %rbx
	movq	%rbx, %rsp
	movl	(%r14), %eax
	movq	%rsp, %r15
	leaq	15(,%rax,4), %rcx
	andq	$-16, %rcx
	subq	%rcx, %r15
	movq	%r15, %rsp
	xorps	%xmm0, %xmm0
	testl	%eax, %eax
	jle	.LBB5_1
# %bb.5:                                # %.lr.ph.preheader
	xorl	%r14d, %r14d
	xorps	%xmm2, %xmm2
	xorps	%xmm1, %xmm1
.LBB5_6:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movss	%xmm2, -64(%rbp)                # 4-byte Spill
	movss	%xmm1, -72(%rbp)                # 4-byte Spill
	movss	%xmm0, -80(%rbp)                # 4-byte Spill
	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, -44(%rbp)                # 4-byte Spill
	movss	%xmm0, (%rbx,%r14,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, -52(%rbp)                # 4-byte Spill
	movss	%xmm0, 4(%rbx,%r14,8)
	callq	rand
	movss	-64(%rbp), %xmm2                # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	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,%r14,4)
	movss	-80(%rbp), %xmm1                # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm1
	movss	%xmm1, -80(%rbp)                # 4-byte Spill
	movss	-72(%rbp), %xmm1                # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	movss	-80(%rbp), %xmm0                # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	addss	-44(%rbp), %xmm2                # 4-byte Folded Reload
	addss	-52(%rbp), %xmm1                # 4-byte Folded Reload
	incq	%r14
	movslq	-48(%rbp), %rcx
	cmpq	%rcx, %r14
	jl	.LBB5_6
# %bb.2:                                # %._crit_edge.loopexit
	movss	%xmm2, -64(%rbp)                # 4-byte Spill
	movss	%xmm1, -72(%rbp)                # 4-byte Spill
	movl	%ecx, %eax
	jmp	.LBB5_3
.LBB5_1:
	movss	%xmm0, -72(%rbp)                # 4-byte Spill
	movss	%xmm0, -64(%rbp)                # 4-byte Spill
	movss	%xmm0, -80(%rbp)                # 4-byte Spill
	movl	%eax, %ecx
.LBB5_3:                                # %._crit_edge
	movq	%r15, -144(%rbp)                # 8-byte Spill
	xorps	%xmm0, %xmm0
	cvtsi2ss	%ecx, %xmm0
	movss	%xmm0, -44(%rbp)                # 4-byte Spill
	movq	%rsp, %r12
	leaq	15(,%rax,8), %rax
	andq	$-16, %rax
	subq	%rax, %r12
	movq	%r12, %rsp
	leaq	-112(%rbp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movl	-48(%rbp), %r14d
	testl	%r14d, %r14d
	movq	%r12, -136(%rbp)                # 8-byte Spill
	jle	.LBB5_4
# %bb.7:                                # %.lr.ph97.preheader
	leaq	(,%r14,8), %rdx
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	movss	.LCPI5_1(%rip), %xmm2           # xmm2 = mem[0],zero,zero,zero
	movss	.LCPI5_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movaps	%xmm0, %xmm1
	movaps	%xmm2, %xmm3
.LBB5_8:                                # %.lr.ph97
                                        # =>This Inner Loop Header: Depth=1
	movss	(%rbx,%r15,8), %xmm4            # xmm4 = mem[0],zero,zero,zero
	movss	4(%rbx,%r15,8), %xmm5           # xmm5 = mem[0],zero,zero,zero
	minss	%xmm4, %xmm3
	maxss	%xmm1, %xmm4
	minss	%xmm5, %xmm2
	maxss	%xmm0, %xmm5
	incq	%r15
	movaps	%xmm5, %xmm0
	movaps	%xmm4, %xmm1
	cmpq	%r15, %r14
	jne	.LBB5_8
	jmp	.LBB5_9
.LBB5_4:
	movss	.LCPI5_0(%rip), %xmm4           # xmm4 = mem[0],zero,zero,zero
	movss	.LCPI5_1(%rip), %xmm3           # xmm3 = mem[0],zero,zero,zero
	movaps	%xmm3, %xmm2
	movaps	%xmm4, %xmm5
.LBB5_9:                                # %._crit_edge98
	movss	%xmm3, -92(%rbp)                # 4-byte Spill
	movss	%xmm2, -52(%rbp)                # 4-byte Spill
	movss	%xmm4, -88(%rbp)                # 4-byte Spill
	movss	%xmm5, -84(%rbp)                # 4-byte Spill
	movss	-64(%rbp), %xmm0                # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	-44(%rbp), %xmm1                # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	divss	%xmm1, %xmm0
	movss	%xmm0, -64(%rbp)                # 4-byte Spill
	movss	-72(%rbp), %xmm0                # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	divss	%xmm1, %xmm0
	movss	%xmm0, -72(%rbp)                # 4-byte Spill
	leaq	-128(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r14), %rax
	movq	8(%r14), %rcx
	subq	-112(%rbp), %rax
	subq	-104(%rbp), %rcx
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rcx, %xmm0
	imulq	$1000, %rax, %r14               # imm = 0x3E8
	divss	.LCPI5_2(%rip), %xmm0
	movss	%xmm0, -44(%rbp)                # 4-byte Spill
	xorps	%xmm0, %xmm0
	cvtss2sd	-92(%rbp), %xmm0                # 4-byte Folded Reload
	xorps	%xmm1, %xmm1
	cvtss2sd	-52(%rbp), %xmm1                # 4-byte Folded Reload
	xorps	%xmm2, %xmm2
	cvtss2sd	-88(%rbp), %xmm2                # 4-byte Folded Reload
	xorps	%xmm3, %xmm3
	cvtss2sd	-84(%rbp), %xmm3                # 4-byte Folded Reload
	movl	$.L.str.2, %edi
	movb	$4, %al
	callq	printf
	movq	%rsp, %r12
	addq	$-4543824, %r12                 # imm = 0xFFBAAAB0
	movq	%r12, %rsp
	movl	$12, %eax
	pcmpeqd	%xmm0, %xmm0
.LBB5_10:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%r12,%rax)
	addq	$52, %rax
	cmpq	$4543824, %rax                  # imm = 0x455550
	jne	.LBB5_10
# %bb.11:
	xorps	%xmm0, %xmm0
	cvtsi2ss	%r14, %xmm0
	movss	-44(%rbp), %xmm1                # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm1
	movss	-64(%rbp), %xmm0                # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%r12)
	movss	-72(%rbp), %xmm0                # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 4(%r12)
	movss	-80(%rbp), %xmm0                # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 8(%r12)
	movl	$0, 28(%r12)
	movl	-48(%rbp), %eax
	decl	%eax
	movl	%eax, 32(%r12)
	movss	-92(%rbp), %xmm0                # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 36(%r12)
	movss	-52(%rbp), %xmm0                # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 40(%r12)
	movss	-88(%rbp), %xmm0                # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 44(%r12)
	movss	-84(%rbp), %xmm0                # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 48(%r12)
	xorl	%r13d, %r13d
	leaq	-128(%rbp), %r14
	movq	-144(%rbp), %r15                # 8-byte Reload
.LBB5_12:                               # =>This Inner Loop Header: Depth=1
	movss	%xmm1, -44(%rbp)                # 4-byte Spill
	leaq	-112(%rbp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movl	%r13d, %ecx
	movl	$87381, %r8d                    # imm = 0x15555
	callq	_Z9constructP4vectPfP4nodeii
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	-128(%rbp), %rax
	subq	-112(%rbp), %rax
	imulq	$1000, %rax, %rax               # imm = 0x3E8
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rax, %xmm0
	movq	-120(%rbp), %rax
	subq	-104(%rbp), %rax
	xorps	%xmm1, %xmm1
	cvtsi2ss	%rax, %xmm1
	divss	.LCPI5_2(%rip), %xmm1
	addss	%xmm0, %xmm1
	movss	-44(%rbp), %xmm0                # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	addss	%xmm1, %xmm0
	movss	%xmm0, -44(%rbp)                # 4-byte Spill
	movss	-44(%rbp), %xmm1                # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	incl	%r13d
	cmpl	$8, %r13d
	jne	.LBB5_12
# %bb.13:
	movl	$.L.str.3, %edi
	xorl	%eax, %eax
	callq	printf
	leaq	-156(%rbp), %r14
	movl	$.L.str.4, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	leaq	-112(%rbp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movl	-48(%rbp), %r8d
	movss	(%r14), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	-136(%rbp), %r12                # 8-byte Reload
	movq	%r12, %rcx
	callq	_Z9calculateP4vectPfP4nodeS0_if
	leaq	-128(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r14), %rax
	movq	%rax, -80(%rbp)                 # 8-byte Spill
	movq	8(%r14), %r13
	leaq	-112(%rbp), %rcx
	movq	(%rcx), %rax
	movq	%rax, -72(%rbp)                 # 8-byte Spill
	movq	8(%rcx), %rax
	movq	%rax, -64(%rbp)                 # 8-byte Spill
	cmpl	$0, -48(%rbp)
	jle	.LBB5_16
# %bb.14:                               # %.lr.ph109.preheader
	xorl	%r14d, %r14d
.LBB5_15:                               # %.lr.ph109
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rbx,%r14,8), %xmm0
	xorps	%xmm1, %xmm1
	cvtss2sd	4(%rbx,%r14,8), %xmm1
	xorps	%xmm2, %xmm2
	cvtss2sd	(%r15,%r14,4), %xmm2
	xorps	%xmm3, %xmm3
	cvtss2sd	(%r12,%r14,8), %xmm3
	xorps	%xmm4, %xmm4
	cvtss2sd	4(%r12,%r14,8), %xmm4
	movl	$.L.str.5, %edi
	movl	%r14d, %esi
	movb	$5, %al
	callq	printf
	incq	%r14
	movslq	-48(%rbp), %rax
	cmpq	%rax, %r14
	jl	.LBB5_15
.LBB5_16:                               # %._crit_edge110
	subq	-64(%rbp), %r13                 # 8-byte Folded Reload
	xorps	%xmm0, %xmm0
	cvtsi2ss	%r13, %xmm0
	divss	.LCPI5_2(%rip), %xmm0
	movq	-80(%rbp), %rax                 # 8-byte Reload
	subq	-72(%rbp), %rax                 # 8-byte Folded Reload
	imulq	$1000, %rax, %rax               # imm = 0x3E8
	xorps	%xmm1, %xmm1
	cvtsi2ss	%rax, %xmm1
	addss	%xmm0, %xmm1
	movss	-44(%rbp), %xmm0                # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	addss	%xmm1, %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.6, %edi
	movb	$1, %al
	callq	printf
	movq	-152(%rbp), %rsp                # 8-byte Reload
	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_end5:
	.size	main, .Lfunc_end5-main
	.cfi_endproc
                                        # -- End function
	.section	.text.__clang_call_terminate,"axG",@progbits,__clang_call_terminate,comdat
	.hidden	__clang_call_terminate          # -- Begin function __clang_call_terminate
	.weak	__clang_call_terminate
	.type	__clang_call_terminate,@function
__clang_call_terminate:                 # @__clang_call_terminate
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__cxa_begin_catch
	callq	_ZSt9terminatev
.Lfunc_end6:
	.size	__clang_call_terminate, .Lfunc_end6-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt11_Deque_baseIiSaIiEED2Ev,"axG",@progbits,_ZNSt11_Deque_baseIiSaIiEED2Ev,comdat
	.weak	_ZNSt11_Deque_baseIiSaIiEED2Ev  # -- Begin function _ZNSt11_Deque_baseIiSaIiEED2Ev
	.p2align	1, 0x90
	.type	_ZNSt11_Deque_baseIiSaIiEED2Ev,@function
_ZNSt11_Deque_baseIiSaIiEED2Ev:         # @_ZNSt11_Deque_baseIiSaIiEED2Ev
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	.LBB7_6
# %bb.1:
	movq	40(%rbx), %r14
	movq	72(%rbx), %r15
	leaq	8(%r15), %rax
	cmpq	%rax, %r14
	jae	.LBB7_5
# %bb.2:                                # %.lr.ph.i.preheader
	addq	$-8, %r14
.LBB7_3:                                # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rdi
	addq	$8, %r14
	callq	_ZdlPv
	cmpq	%r15, %r14
	jb	.LBB7_3
# %bb.4:                                # %_ZNSt11_Deque_baseIiSaIiEE16_M_destroy_nodesEPPiS3_.exit.loopexit
	movq	(%rbx), %rdi
.LBB7_5:                                # %_ZNSt11_Deque_baseIiSaIiEE16_M_destroy_nodesEPPiS3_.exit
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	_ZdlPv                          # TAILCALL
.LBB7_6:
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_ZNSt11_Deque_baseIiSaIiEED2Ev, .Lfunc_end7-_ZNSt11_Deque_baseIiSaIiEED2Ev
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm,"axG",@progbits,_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm,comdat
	.weak	_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm # -- Begin function _ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm
	.p2align	1, 0x90
	.type	_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm,@function
_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm: # @_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	%rsi, %r12
	shrq	$7, %r12
	leaq	1(%r12), %r15
	cmpq	$6, %r12
	movl	$5, %esi
	cmovaeq	%r12, %rsi
	addq	$3, %rsi
	movq	%rsi, 8(%rdi)
	leaq	7(%rsp), %rdi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIPiE8allocateEmPKv
	movq	%rax, (%rbx)
	movq	8(%rbx), %rcx
	subq	%r15, %rcx
	andq	$-2, %rcx
	leaq	(%rax,%rcx,4), %r15
	leaq	(%r15,%r12,8), %rdx
	addq	$8, %rdx
.Ltmp6:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_
.Ltmp7:
# %bb.1:
	movq	%r15, 40(%rbx)
	movq	(%r15), %rax
	movq	%rax, 24(%rbx)
	movl	$512, %ecx                      # imm = 0x200
	leaq	(%rax,%rcx), %rdx
	movq	%rdx, 32(%rbx)
	leaq	(%r15,%r12,8), %rdx
	movq	%rdx, 72(%rbx)
	movq	(%rdx), %rdx
	movq	%rdx, 56(%rbx)
	addq	%rdx, %rcx
	movq	%rcx, 64(%rbx)
	movq	%rax, 16(%rbx)
	andl	$127, %r14d
	leaq	(%rdx,%r14,4), %rax
	movq	%rax, 48(%rbx)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB8_5:
	.cfi_def_cfa_offset 48
.Ltmp8:
	movq	%rax, %rdi
	callq	__cxa_begin_catch
	movq	(%rbx), %rdi
	callq	_ZdlPv
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
.Ltmp9:
	callq	__cxa_rethrow
.Ltmp10:
# %bb.6:
.LBB8_2:
.Ltmp11:
	movq	%rax, %rbx
.Ltmp12:
	callq	__cxa_end_catch
.Ltmp13:
# %bb.3:
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.LBB8_4:
.Ltmp14:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end8:
	.size	_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm, .Lfunc_end8-_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm
	.cfi_endproc
	.section	.gcc_except_table._ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm,"aG",@progbits,_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm,comdat
	.p2align	2, 0x0
GCC_except_table8:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp6-.Lfunc_begin1           #   Call between .Lfunc_begin1 and .Ltmp6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin1           # >> Call Site 2 <<
	.uleb128 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin1           #     jumps to .Ltmp8
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp7-.Lfunc_begin1           # >> Call Site 3 <<
	.uleb128 .Ltmp9-.Ltmp7                  #   Call between .Ltmp7 and .Ltmp9
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin1           # >> Call Site 4 <<
	.uleb128 .Ltmp10-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp10
	.uleb128 .Ltmp11-.Lfunc_begin1          #     jumps to .Ltmp11
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Ltmp13-.Ltmp12                #   Call between .Ltmp12 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin1          #     jumps to .Ltmp14
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp13-.Lfunc_begin1          # >> Call Site 6 <<
	.uleb128 .Lfunc_end8-.Ltmp13            #   Call between .Ltmp13 and .Lfunc_end8
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_,"axG",@progbits,_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_,comdat
	.weak	_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_ # -- Begin function _ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_
	.p2align	1, 0x90
	.type	_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_,@function
_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_: # @_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_
.Lfunc_begin2:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception2
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	cmpq	%rdx, %rsi
	jae	.LBB9_4
# %bb.1:                                # %.lr.ph.preheader
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rsi, %r15
.LBB9_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
.Ltmp15:
	movl	$512, %edi                      # imm = 0x200
	callq	_Znwm
.Ltmp16:
# %bb.3:                                # %_ZNSt11_Deque_baseIiSaIiEE16_M_allocate_nodeEv.exit
                                        #   in Loop: Header=BB9_2 Depth=1
	movq	%rax, (%r15)
	addq	$8, %r15
	cmpq	%r14, %r15
	jb	.LBB9_2
.LBB9_4:                                # %._crit_edge
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB9_5:
	.cfi_def_cfa_offset 32
.Ltmp17:
	movq	%rax, %rdi
	callq	__cxa_begin_catch
	cmpq	%rbx, %r15
	jbe	.LBB9_7
.LBB9_6:                                # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdi
	callq	_ZdlPv
	addq	$8, %rbx
	cmpq	%r15, %rbx
	jb	.LBB9_6
.LBB9_7:                                # %_ZNSt11_Deque_baseIiSaIiEE16_M_destroy_nodesEPPiS3_.exit
.Ltmp18:
	callq	__cxa_rethrow
.Ltmp19:
# %bb.11:
.LBB9_8:
.Ltmp20:
	movq	%rax, %rbx
.Ltmp21:
	callq	__cxa_end_catch
.Ltmp22:
# %bb.9:
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.LBB9_10:
.Ltmp23:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end9:
	.size	_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_, .Lfunc_end9-_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_
	.cfi_endproc
	.section	.gcc_except_table._ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_,"aG",@progbits,_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_,comdat
	.p2align	2, 0x0
GCC_except_table9:
.Lexception2:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase1-.Lttbaseref1
.Lttbaseref1:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end2-.Lcst_begin2
.Lcst_begin2:
	.uleb128 .Ltmp15-.Lfunc_begin2          # >> Call Site 1 <<
	.uleb128 .Ltmp16-.Ltmp15                #   Call between .Ltmp15 and .Ltmp16
	.uleb128 .Ltmp17-.Lfunc_begin2          #     jumps to .Ltmp17
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp16-.Lfunc_begin2          # >> Call Site 2 <<
	.uleb128 .Ltmp18-.Ltmp16                #   Call between .Ltmp16 and .Ltmp18
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp18-.Lfunc_begin2          # >> Call Site 3 <<
	.uleb128 .Ltmp19-.Ltmp18                #   Call between .Ltmp18 and .Ltmp19
	.uleb128 .Ltmp20-.Lfunc_begin2          #     jumps to .Ltmp20
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp21-.Lfunc_begin2          # >> Call Site 4 <<
	.uleb128 .Ltmp22-.Ltmp21                #   Call between .Ltmp21 and .Ltmp22
	.uleb128 .Ltmp23-.Lfunc_begin2          #     jumps to .Ltmp23
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp22-.Lfunc_begin2          # >> Call Site 5 <<
	.uleb128 .Lfunc_end9-.Ltmp22            #   Call between .Ltmp22 and .Lfunc_end9
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end2:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIPiE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIPiE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIPiE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIPiE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIPiE8allocateEmPKv,@function
_ZNSt15__new_allocatorIPiE8allocateEmPKv: # @_ZNSt15__new_allocatorIPiE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB10_1
# %bb.3:
	shlq	$3, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB10_1:
	.cfi_def_cfa_offset 16
	shrq	$61, %rsi
	je	.LBB10_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB10_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end10:
	.size	_ZNSt15__new_allocatorIPiE8allocateEmPKv, .Lfunc_end10-_ZNSt15__new_allocatorIPiE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt5dequeIiSaIiEE12emplace_backIJiEEERiDpOT_,"axG",@progbits,_ZNSt5dequeIiSaIiEE12emplace_backIJiEEERiDpOT_,comdat
	.weak	_ZNSt5dequeIiSaIiEE12emplace_backIJiEEERiDpOT_ # -- Begin function _ZNSt5dequeIiSaIiEE12emplace_backIJiEEERiDpOT_
	.p2align	1, 0x90
	.type	_ZNSt5dequeIiSaIiEE12emplace_backIJiEEERiDpOT_,@function
_ZNSt5dequeIiSaIiEE12emplace_backIJiEEERiDpOT_: # @_ZNSt5dequeIiSaIiEE12emplace_backIJiEEERiDpOT_
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movq	48(%rdi), %rax
	movq	64(%rdi), %rcx
	addq	$-4, %rcx
	cmpq	%rcx, %rax
	je	.LBB11_2
# %bb.1:
	movl	(%rsi), %ecx
	movl	%ecx, (%rax)
	addq	$4, %rax
	movq	%rax, 48(%rbx)
	jmp	.LBB11_3
.LBB11_2:
	movq	%rbx, %rdi
	callq	_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJiEEEvDpOT_
	movq	48(%rbx), %rax
.LBB11_3:
	cmpq	56(%rbx), %rax
	jne	.LBB11_5
# %bb.4:
	movq	72(%rbx), %rcx
	movl	$512, %eax                      # imm = 0x200
	addq	-8(%rcx), %rax
.LBB11_5:                               # %_ZNSt5dequeIiSaIiEE4backEv.exit
	addq	$-4, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end11:
	.size	_ZNSt5dequeIiSaIiEE12emplace_backIJiEEERiDpOT_, .Lfunc_end11-_ZNSt5dequeIiSaIiEE12emplace_backIJiEEERiDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt5dequeIiSaIiEE16_M_push_back_auxIJiEEEvDpOT_,"axG",@progbits,_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJiEEEvDpOT_,comdat
	.weak	_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJiEEEvDpOT_ # -- Begin function _ZNSt5dequeIiSaIiEE16_M_push_back_auxIJiEEEvDpOT_
	.p2align	1, 0x90
	.type	_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJiEEEvDpOT_,@function
_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJiEEEvDpOT_: # @_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJiEEEvDpOT_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	72(%rdi), %r15
	movq	%r15, %rax
	subq	40(%rdi), %rax
	shrq	$3, %rax
	cmpq	$1, %r15
	adcq	$-1, %rax
	shlq	$7, %rax
	movq	32(%rdi), %rcx
	movq	48(%rdi), %rdx
	subq	56(%rdi), %rdx
	sarq	$2, %rdx
	subq	16(%rdi), %rcx
	sarq	$2, %rcx
	addq	%rdx, %rcx
	addq	%rax, %rcx
	movabsq	$2305843009213693951, %rax      # imm = 0x1FFFFFFFFFFFFFFF
	cmpq	%rax, %rcx
	je	.LBB12_4
# %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	%r15, %rax
	subq	(%rdi), %rax
	movq	8(%rdi), %rcx
	sarq	$3, %rax
	subq	%rax, %rcx
	cmpq	$1, %rcx
	ja	.LBB12_3
# %bb.2:
	movl	$1, %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb
	movq	72(%rbx), %r15
.LBB12_3:                               # %_ZNSt5dequeIiSaIiEE22_M_reserve_map_at_backEm.exit
	movl	$512, %edi                      # imm = 0x200
	callq	_Znwm
	movq	%rax, 8(%r15)
	movq	48(%rbx), %rax
	movl	(%r14), %ecx
	movl	%ecx, (%rax)
	movq	72(%rbx), %rax
	leaq	8(%rax), %rcx
	movq	%rcx, 72(%rbx)
	movq	8(%rax), %rax
	movq	%rax, 56(%rbx)
	leaq	512(%rax), %rcx
	movq	%rcx, 64(%rbx)
	movq	%rax, 48(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB12_4:
	.cfi_def_cfa_offset 32
	movl	$.L.str.7, %edi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end12:
	.size	_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJiEEEvDpOT_, .Lfunc_end12-_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJiEEEvDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb,"axG",@progbits,_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb,comdat
	.weak	_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb # -- Begin function _ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb
	.p2align	1, 0x90
	.type	_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb,@function
_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb: # @_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, %r8d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	72(%rdi), %rax
	movq	8(%rdi), %rcx
	movq	40(%rdi), %rsi
	subq	%rsi, %rax
	movq	%rax, %r13
	sarq	$3, %r13
	leaq	(%r14,%r13), %r12
	incq	%r12
	incq	%r13
	leaq	(%r12,%r12), %rdx
	cmpq	%rdx, %rcx
	jbe	.LBB13_4
# %bb.1:
	subq	%r12, %rcx
	andq	$-2, %rcx
	shlq	$2, %rcx
	addq	(%rbx), %rcx
	xorl	%edx, %edx
	testb	%r8b, %r8b
	cmovneq	%r14, %rdx
	leaq	(%rcx,%rdx,8), %r14
	leaq	8(%rax), %rdx
	cmpq	%rsi, %r14
	jae	.LBB13_7
# %bb.2:
	cmpq	$9, %rdx
	jl	.LBB13_13
# %bb.3:
	movq	%r14, %rdi
	jmp	.LBB13_9
.LBB13_4:
	cmpq	%r14, %rcx
	movq	%r14, %rax
	cmovaq	%rcx, %rax
	leaq	(%rcx,%rax), %rbp
	addq	$2, %rbp
	xorl	%r15d, %r15d
	leaq	11(%rsp), %rdi
	movq	%rbp, %rsi
	xorl	%edx, %edx
	movl	%r8d, 12(%rsp)                  # 4-byte Spill
	callq	_ZNSt15__new_allocatorIPiE8allocateEmPKv
	movq	%rbp, 16(%rsp)                  # 8-byte Spill
	subq	%r12, %rbp
	movq	%rax, %r12
	andq	$-2, %rbp
	leaq	(%rax,%rbp,4), %rax
	cmpb	$0, 12(%rsp)                    # 1-byte Folded Reload
	cmovneq	%r14, %r15
	leaq	(%rax,%r15,8), %r14
	movq	40(%rbx), %rsi
	movq	72(%rbx), %rdx
	subq	%rsi, %rdx
	addq	$8, %rdx
	cmpq	$9, %rdx
	jl	.LBB13_11
# %bb.5:
	movq	%r14, %rdi
	callq	memmove@PLT
.LBB13_6:                               # %_ZSt4copyIPPiS1_ET0_T_S3_S2_.exit24
	movq	(%rbx), %rdi
	callq	_ZdlPv
	movq	%r12, (%rbx)
	movq	16(%rsp), %rax                  # 8-byte Reload
	movq	%rax, 8(%rbx)
	jmp	.LBB13_10
.LBB13_7:
	movq	%rdx, %rcx
	sarq	$3, %rcx
	cmpq	$2, %rcx
	jl	.LBB13_15
# %bb.8:
	leaq	(%r14,%r13,8), %rdi
	shlq	$3, %rcx
	subq	%rcx, %rdi
.LBB13_9:                               # %_ZSt4copyIPPiS1_ET0_T_S3_S2_.exit
	callq	memmove@PLT
.LBB13_10:                              # %_ZSt4copyIPPiS1_ET0_T_S3_S2_.exit
	movq	%r14, 40(%rbx)
	movq	(%r14), %rax
	movq	%rax, 24(%rbx)
	movl	$512, %ecx                      # imm = 0x200
	addq	%rcx, %rax
	movq	%rax, 32(%rbx)
	leaq	(%r14,%r13,8), %rax
	addq	$-8, %rax
	movq	%rax, 72(%rbx)
	movq	(%rax), %rax
	movq	%rax, 56(%rbx)
	addq	%rcx, %rax
	movq	%rax, 64(%rbx)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB13_11:
	.cfi_def_cfa_offset 80
	cmpq	$8, %rdx
	jne	.LBB13_6
# %bb.12:
	movq	(%rsi), %rax
	movq	%rax, (%r14)
	jmp	.LBB13_6
.LBB13_13:
	cmpq	$8, %rdx
	jne	.LBB13_10
# %bb.14:
	movq	(%rsi), %rax
	movq	%rax, (%r14)
	jmp	.LBB13_10
.LBB13_15:
	cmpq	$8, %rdx
	jne	.LBB13_10
# %bb.16:
	movq	(%rsi), %rcx
	movq	%rcx, (%r14,%rax)
	jmp	.LBB13_10
.Lfunc_end13:
	.size	_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb, .Lfunc_end13-_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_,"axG",@progbits,_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_,comdat
	.weak	_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_ # -- Begin function _ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_
	.p2align	1, 0x90
	.type	_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_,@function
_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_: # @_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	72(%rdi), %r15
	movq	%r15, %rax
	subq	40(%rdi), %rax
	shrq	$3, %rax
	cmpq	$1, %r15
	adcq	$-1, %rax
	shlq	$7, %rax
	movq	32(%rdi), %rcx
	movq	48(%rdi), %rdx
	subq	56(%rdi), %rdx
	sarq	$2, %rdx
	subq	16(%rdi), %rcx
	sarq	$2, %rcx
	addq	%rdx, %rcx
	addq	%rax, %rcx
	movabsq	$2305843009213693951, %rax      # imm = 0x1FFFFFFFFFFFFFFF
	cmpq	%rax, %rcx
	je	.LBB14_4
# %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	%r15, %rax
	subq	(%rdi), %rax
	movq	8(%rdi), %rcx
	sarq	$3, %rax
	subq	%rax, %rcx
	cmpq	$1, %rcx
	ja	.LBB14_3
# %bb.2:
	movl	$1, %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb
	movq	72(%rbx), %r15
.LBB14_3:                               # %_ZNSt5dequeIiSaIiEE22_M_reserve_map_at_backEm.exit
	movl	$512, %edi                      # imm = 0x200
	callq	_Znwm
	movq	%rax, 8(%r15)
	movq	48(%rbx), %rax
	movl	(%r14), %ecx
	movl	%ecx, (%rax)
	movq	72(%rbx), %rax
	leaq	8(%rax), %rcx
	movq	%rcx, 72(%rbx)
	movq	8(%rax), %rax
	movq	%rax, 56(%rbx)
	leaq	512(%rax), %rcx
	movq	%rcx, 64(%rbx)
	movq	%rax, 48(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB14_4:
	.cfi_def_cfa_offset 32
	movl	$.L.str.7, %edi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end14:
	.size	_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_, .Lfunc_end14-_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"n : "
	.size	.L.str, 5

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"%d"
	.size	.L.str.1, 3

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

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"theta : "
	.size	.L.str.3, 9

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"%f"
	.size	.L.str.4, 3

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"%d : x %f y %f m %f : %.15f %.15f\n"
	.size	.L.str.5, 35

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"cpu time : %f\n"
	.size	.L.str.6, 15

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"cannot create std::deque larger than max_size()"
	.size	.L.str.7, 48

	.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 __gxx_personality_v0
	.addrsig_sym _Unwind_Resume
	.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
