// File: /workspace/github_cpp_makefile_star2_O2/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 0x2e3d
movq 0xffa2(%rip), %rax      # 0x13228
leaq 0xff9b(%rip), %rcx      # 0x13228
movq %rax, %rdx
cmpq %rcx, %rdx
je 0x33f1
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
cmpq %rcx, %rsi
je 0x33e9
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 0x331b
jp 0x331b
ucomisd %xmm9, %xmm2
jne 0x331b
jp 0x331b
ucomisd %xmm6, %xmm3
jne 0x331b
jp 0x331b
movq 0x10(%rdx), %r8
movq %rdi, 0x8(%r8)
ucomisd %xmm8, %xmm0
jne 0x3341
jp 0x3341
ucomisd %xmm9, %xmm2
jne 0x3341
jp 0x3341
ucomisd %xmm6, %xmm3
jne 0x3341
jp 0x3341
movq 0x10(%rsi), %rdi
movq 0x10(%rdx), %r8
movq %rdi, 0x10(%r8)
ucomisd %xmm8, %xmm1
jne 0x3367
jp 0x3367
ucomisd %xmm10, %xmm2
jne 0x3367
jp 0x3367
ucomisd %xmm6, %xmm3
jne 0x3367
jp 0x3367
movq 0x10(%rsi), %rdi
movq 0x10(%rdx), %r8
movq %rdi, 0x18(%r8)
ucomisd %xmm8, %xmm1
jne 0x338d
jp 0x338d
ucomisd %xmm9, %xmm4
jne 0x338d
jp 0x338d
ucomisd %xmm6, %xmm3
jne 0x338d
jp 0x338d
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 0x33bd
ucomisd %xmm7, %xmm3
jne 0x33bd
jp 0x33bd
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 0x33e1
movq 0x10(%rsi), %rdi
movq 0x10(%rdx), %r8
movq %rdi, 0x30(%r8)
movq (%rsi), %rsi
jmp 0x32c7
movq (%rdx), %rdx
jmp 0x3290
popq %rbp
retq