// File: /workspace/github_cpp_makefile_star2_O3/suhasjains[P]AMR-Solver/src/octreegrid.cpp
// Function: myOctree::set_root_neighbours()
void set_root_neighbours() {

	create_list_of_root_nodes();

	for (std::list<Octree*>::iterator i = root_nodes.begin(), end = root_nodes.end(); i != end; ++i) {

		double xmax = (*i)->x_max;			
		double ymax = (*i)->y_max;			
		double zmax = (*i)->z_max;			
		double xmin = (*i)->x_min;			
		double ymin = (*i)->y_min;			
		double zmin = (*i)->z_min;

		for (std::list<Octree*>::iterator j = root_nodes.begin(), end = root_nodes.end(); j != end; ++j) {
			/*change it to xmax_nbr*/
			double x_max = (*j)->x_max;			
			double y_max = (*j)->y_max;			
			double z_max = (*j)->z_max;			
			double x_min = (*j)->x_min;			
			double y_min = (*j)->y_min;			
			double z_min = (*j)->z_min;
	
		//	if(xmax==x_min&&ymax==y_max&&zmax==z_max)
		//		(*i)->east = (*j);	

		//	if(xmin==x_max&&ymax==y_max&&zmax==z_max)
		//		(*i)->west = (*j);	
		//	
		//	if(xmax==x_max&&ymax==y_min&&zmax==z_max)
		//		(*i)->north = (*j);	
		//		
		//	if(xmax==x_max&&ymin==y_max&&zmax==z_max)
		//		(*i)->south = (*j);	
		//	
		//	if(xmax==x_max&&ymax==y_max&&zmax==z_min)
		//		(*i)->top = (*j);	
		//	
		//	if(xmax==x_max&&ymax==y_max&&zmin==z_max)
		//		(*i)->bottom = (*j);	
			if(xmax==x_min&&ymax==y_max&&zmax==z_max)
				(*i)->neighbour[XDIR][RIGHT] = (*j);	

			if(xmin==x_max&&ymax==y_max&&zmax==z_max)
				(*i)->neighbour[XDIR][LEFT] = (*j);	
			
			if(xmax==x_max&&ymax==y_min&&zmax==z_max)
				(*i)->neighbour[YDIR][RIGHT] = (*j);	
				
			if(xmax==x_max&&ymin==y_max&&zmax==z_max)
				(*i)->neighbour[YDIR][LEFT] = (*j);	
			
			if(xmax==x_max&&ymax==y_max&&zmax==z_min)
				(*i)->neighbour[ZDIR][RIGHT] = (*j);	
			
			if(xmax==x_max&&ymax==y_max&&zmin==z_max)
				(*i)->neighbour[ZDIR][LEFT] = (*j);	
				
				
		}			
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x2fa4
movq 0x11d6b(%rip), %rax     # 0x15248
leaq 0x11d64(%rip), %rcx     # 0x15248
cmpq %rcx, %rax
je 0x3647
movq %rax, %rdx
movq 0x10(%rdx), %rsi
movsd 0x68(%rsi), %xmm0
movsd 0x70(%rsi), %xmm1
movsd 0x80(%rsi), %xmm2
movsd 0x90(%rsi), %xmm3
movsd 0x78(%rsi), %xmm4
movsd 0x88(%rsi), %xmm5
movq %rax, %rsi
movq 0x10(%rsi), %rdi
movsd 0x70(%rdi), %xmm8
movsd 0x78(%rdi), %xmm10
movsd 0x80(%rdi), %xmm9
movsd 0x90(%rdi), %xmm6
movsd 0x88(%rdi), %xmm7
ucomisd 0x68(%rdi), %xmm1
jne 0x3569
jp 0x3569
ucomisd %xmm9, %xmm2
jne 0x3569
jp 0x3569
ucomisd %xmm6, %xmm3
jne 0x3569
jp 0x3569
movq 0x10(%rdx), %r8
movq %rdi, 0x8(%r8)
ucomisd %xmm8, %xmm0
jne 0x358f
jp 0x358f
ucomisd %xmm9, %xmm2
jne 0x358f
jp 0x358f
ucomisd %xmm6, %xmm3
jne 0x358f
jp 0x358f
movq 0x10(%rsi), %rdi
movq 0x10(%rdx), %r8
movq %rdi, 0x10(%r8)
ucomisd %xmm8, %xmm1
jne 0x35b5
jp 0x35b5
ucomisd %xmm10, %xmm2
jne 0x35b5
jp 0x35b5
ucomisd %xmm6, %xmm3
jne 0x35b5
jp 0x35b5
movq 0x10(%rsi), %rdi
movq 0x10(%rdx), %r8
movq %rdi, 0x18(%r8)
ucomisd %xmm8, %xmm1
jne 0x35db
jp 0x35db
ucomisd %xmm9, %xmm4
jne 0x35db
jp 0x35db
ucomisd %xmm6, %xmm3
jne 0x35db
jp 0x35db
movq 0x10(%rsi), %rdi
movq 0x10(%rdx), %r8
movq %rdi, 0x20(%r8)
cmpeqpd %xmm2, %xmm9
cmpeqpd %xmm1, %xmm8
andpd %xmm9, %xmm8
movd %xmm8, %edi
testb $0x1, %dil
je 0x360b
ucomisd %xmm7, %xmm3
jne 0x360b
jp 0x360b
movq 0x10(%rsi), %r8
movq 0x10(%rdx), %r9
movq %r8, 0x28(%r9)
ucomisd %xmm6, %xmm5
setnp %r8b
sete %r9b
andb %r8b, %r9b
andb %r9b, %dil
cmpb $0x1, %dil
jne 0x362f
movq 0x10(%rsi), %rdi
movq 0x10(%rdx), %r8
movq %rdi, 0x30(%r8)
movq (%rsi), %rsi
cmpq %rcx, %rsi
jne 0x351e
movq (%rdx), %rdx
cmpq %rcx, %rdx
jne 0x34f0
popq %rbp
retq