// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/ghost.cpp
// Function: amrsolver::exchange_multilevel_ghost_val(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void exchange_multilevel_ghost_val(int level, std::string name) {

	//relative locations wrt siblings
	int *loc_x, *loc_y, *loc_z;
	loc_x = new int;
	loc_y = new int;
	loc_z = new int;

	myOctree::create_lists_of_multilevel_nodes();

	if(multilevel_nodes[level].empty()) {
		std::cerr << "Error!: No blocks to exchange ghost values in multilevel " << level << std::endl; 
		exit(1);
	}

	for (std::list<Octree*>::iterator it = multilevel_nodes[level].begin(), end = multilevel_nodes[level].end(); it != end; ++it) {	

  		//get location relative to siblings
          	(*it)->get_relative_location(loc_x,loc_y,loc_z);

		for(int l = 0; l<scalar_fields.size() ; l++) {
			
			Field *f = (*it)->get_block_data()->scalarfields[l];

                        if( f->name == name ) {

				//traverse through all cells
				for (int i=0; i<f->Nx; i++) {
					for (int j=0; j<f->Ny; j++) {
						for (int k=0; k<f->Nz; k++) {
			
							//traverse through directions
							for (int m=0; m<3; m++) {
                        					for (int n=0; n<2; n++) {

									if((*it)->bc[m][n] == NONE && (*it)->neighbour[m][n] != NULL) {
										
										//exchange with neighbours
										if((*it)->neighbour[m][n]->get_level() == level) {
								
											if(n==RIGHT && m==XDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::EAST_GHOST) {
												f->val[i][j][k] = \
							 					(*it)->neighbour[m][n]->get_block_data()->scalarfields[l]->val[i-nx_block][j][k]; 
											}
											if(n==LEFT && m==XDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::WEST_GHOST) {
												f->val[i][j][k] = \
							 					(*it)->neighbour[m][n]->get_block_data()->scalarfields[l]->val[i+nx_block][j][k]; 
											}
											if(n==RIGHT && m==YDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::NORTH_GHOST) {
												f->val[i][j][k] = \
							 					(*it)->neighbour[m][n]->get_block_data()->scalarfields[l]->val[i][j-ny_block][k]; 
											}
											if(n==LEFT && m==YDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::SOUTH_GHOST) {
												f->val[i][j][k] = \
							 					(*it)->neighbour[m][n]->get_block_data()->scalarfields[l]->val[i][j+ny_block][k]; 
											}
											if(n==RIGHT && m==ZDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::TOP_GHOST) {
												f->val[i][j][k] = \
							 					(*it)->neighbour[m][n]->get_block_data()->scalarfields[l]->val[i][j][k-nz_block]; 
											}
											if(n==LEFT && m==ZDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::BOTTOM_GHOST) {
												f->val[i][j][k] = \
							 					(*it)->neighbour[m][n]->get_block_data()->scalarfields[l]->val[i][j][k+nz_block]; 
											}
										}

										//exchange with neighbour's child
										else {

											if(n==RIGHT && m==XDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::EAST_GHOST) {
												f->val[i][j][k] = restrict_at((*it)->neighbour[m][n], l, i-nx_block, j, k);
											}
											if(n==LEFT && m==XDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::WEST_GHOST) {
												f->val[i][j][k] = restrict_at((*it)->neighbour[m][n], l, i+nx_block, j, k);
											}
											if(n==RIGHT && m==YDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::NORTH_GHOST) {
												f->val[i][j][k] = restrict_at((*it)->neighbour[m][n], l, i, j-ny_block, k);
											}
											if(n==LEFT && m==YDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::SOUTH_GHOST) {
												f->val[i][j][k] = restrict_at((*it)->neighbour[m][n], l, i, j+ny_block, k);
											}
											if(n==RIGHT && m==ZDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::TOP_GHOST) {
												f->val[i][j][k] = restrict_at((*it)->neighbour[m][n], l, i, j, k-nz_block);
											}
											if(n==LEFT && m==ZDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::BOTTOM_GHOST) {
												f->val[i][j][k] = restrict_at((*it)->neighbour[m][n], l, i, j, k+nz_block);
											}

										}
									}

									//exchange with neighbour's parent
									else if((*it)->bc[m][n] == NONE && (*it)->neighbour[m][n] == NULL) {
										
										if(n==RIGHT && m==XDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::EAST_GHOST) {
											prolongate_for_multilevel_ghost_exchange_at((*it),(*it)->get_parent()->neighbour[m][n], l, \
												       i, j, k, i-nx_block, j, k, 0, *loc_y, *loc_z);
										}
										if(n==LEFT && m==XDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::WEST_GHOST) {
											prolongate_for_multilevel_ghost_exchange_at((*it),(*it)->get_parent()->neighbour[m][n], l, \
												       i, j, k, i+nx_block, j, k, 1, *loc_y, *loc_z);
										}
										if(n==RIGHT && m==YDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::NORTH_GHOST) {
											prolongate_for_multilevel_ghost_exchange_at((*it),(*it)->get_parent()->neighbour[m][n], l, \
												       i, j, k, i, j-ny_block, k, *loc_x, 0, *loc_z);
										}
										if(n==LEFT && m==YDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::SOUTH_GHOST) {
											prolongate_for_multilevel_ghost_exchange_at((*it),(*it)->get_parent()->neighbour[m][n], l, \
												       i, j, k, i, j+ny_block, k, *loc_x, 1, *loc_z);
										}
										if(n==RIGHT && m==ZDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::TOP_GHOST) {
											prolongate_for_multilevel_ghost_exchange_at((*it),(*it)->get_parent()->neighbour[m][n], l, \
												       i, j, k, i, j, k-nz_block, *loc_x, *loc_y, 0);
										}
										if(n==LEFT && m==ZDIR && (*it)->get_block_data()->flag[i][j][k]==myOctree::BOTTOM_GHOST) {
											prolongate_for_multilevel_ghost_exchange_at((*it),(*it)->get_parent()->neighbour[m][n], l, \
												       i, j, k, i, j, k+nz_block, *loc_x, *loc_y, 1);
										}
									}
								}	
							}
						}
                                   	}
                          	}
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, -0xa0(%rbp)
movl %edi, %ebx
pushq $0x4
popq %r14
movq %r14, %rdi
callq 0x21e0
movq %rax, -0x50(%rbp)
movq %r14, %rdi
callq 0x21e0
movq %rax, -0x58(%rbp)
movq %r14, %rdi
callq 0x21e0
movq %rax, -0x60(%rbp)
callq 0x2efe
movl %ebx, -0x6c(%rbp)
movslq %ebx, %rax
imulq $0x18, %rax, %rax
leaq 0xb00e(%rip), %rcx      # 0x13420
leaq (%rcx,%rax), %rdx
movq (%rcx,%rax), %r14
movq %rdx, -0x98(%rbp)
cmpq %rdx, %r14
jne 0x8e97
movq 0xabbf(%rip), %rdi      # 0x12ff0
leaq 0x6dff(%rip), %rsi      # 0xf237
callq 0x21d0
movq %rax, %rdi
movl -0x6c(%rbp), %esi
callq 0x2310
movq %rax, %rdi
callq 0x2110
pushq $0x1
popq %rdi
callq 0x2220
movq 0x10(%r14), %rdi
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
callq 0x3e6c
xorl %edx, %edx
movq %r14, -0xb0(%rbp)
leaq 0xb19b(%rip), %rcx      # 0x13618
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x5, %rax
cmpq %rdx, %rax
jbe 0x8e94
movq 0x10(%r14), %rdi
movq %rdx, %rbx
callq 0x3db0
movq 0x10(%rax), %rax
movq %rbx, -0x40(%rbp)
movq (%rax,%rbx,8), %rax
movq %rax, -0x48(%rbp)
leaq 0x18(%rax), %rdi
movq -0xa0(%rbp), %rsi
callq 0x6c56
testb %al, %al
je 0x8e88
xorl %ebx, %ebx
movq -0x48(%rbp), %rax
movslq (%rax), %rax
cmpq %rax, %rbx
jge 0x8e88
movslq %ebx, %rax
movq %rax, -0x88(%rbp)
xorl %r13d, %r13d
movq %rbx, -0x38(%rbp)
movq -0x48(%rbp), %rax
movslq 0x4(%rax), %rax
cmpq %rax, %r13
jge 0x8e80
movslq %r13d, %rax
movq %rax, -0x80(%rbp)
xorl %r12d, %r12d
movq -0x48(%rbp), %rax
movslq 0x8(%rax), %rax
cmpq %rax, %r12
jge 0x8e78
movslq %r12d, %rax
movq %rax, -0x78(%rbp)
pushq $0x8
popq %rax
movq %rax, -0x68(%rbp)
pushq $0x38
popq %rax
movq %rax, -0x90(%rbp)
xorl %edx, %edx
cmpq $0x3, %rdx
je 0x8e70
xorl %r15d, %r15d
movq %rdx, -0x30(%rbp)
cmpq $0x2, %r15
je 0x8e5b
movq 0x10(%r14), %rdi
movq -0x90(%rbp), %rax
addq %rdi, %rax
cmpl $0x0, (%rax,%r15,4)
je 0x8563
incq %r15
jmp 0x853f
movq -0x68(%rbp), %rax
addq %rdi, %rax
movq (%rax,%r15,8), %rax
testq %rax, %rax
je 0x8697
movq %rax, %rdi
callq 0x3e06
movq -0x30(%rbp), %rdx
movq %r15, %rcx
orq %rdx, %rcx
cmpl -0x6c(%rbp), %eax
jne 0x87a0
testl %ecx, %ecx
jne 0x861a
movq 0x10(%r14), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x88(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x1, (%rax,%r12,4)
jne 0x861a
movq 0x10(%r14), %rax
addq -0x68(%rbp), %rax
movq (%rax,%r15,8), %rdi
callq 0x3db0
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
leaq 0xabef(%rip), %rcx      # 0x131d4
movslq (%rcx), %rcx
movq -0x88(%rbp), %rdx
subq %rcx, %rdx
movq (%rax,%rdx,8), %rax
movq -0x30(%rbp), %rdx
movq (%rax,%r13,8), %rax
movsd (%rax,%r12,8), %xmm0
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
movsd %xmm0, (%rax,%r12,8)
movq %r15, %rbx
xorq $0x1, %rbx
movq %rdx, %rax
orq %rbx, %rax
jne 0x8980
movq 0x10(%r14), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rbx
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x2, (%rax,%r12,4)
jne 0x855e
movq 0x10(%r14), %rax
movq 0x10(%rax), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
leaq 0xab54(%rip), %rcx      # 0x131d4
movslq (%rcx), %rcx
addq -0x88(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r13,8), %rax
jmp 0x89f8
movl %r15d, %eax
orl %edx, %eax
jne 0x8715
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x88(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x1, (%rax,%r12,4)
jne 0x8715
movq 0x10(%r14), %rbx
movq %rbx, %rdi
callq 0x3e5e
addq -0x68(%rbp), %rax
movq (%rax,%r15,8), %rsi
movq -0x38(%rbp), %rax
leaq 0xaaf8(%rip), %rcx      # 0x131d4
subl (%rcx), %eax
movq -0x58(%rbp), %rcx
movl (%rcx), %r10d
movq -0x60(%rbp), %rcx
movl (%rcx), %r11d
movq %rbx, %rdi
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rcx
movl %r13d, %r8d
movl %r12d, %r9d
pushq %r11
pushq %r10
pushq $0x0
pushq %r12
pushq %r13
pushq %rax
callq 0x8157
movq -0x30(%rbp), %rdx
addq $0x30, %rsp
movq %r15, %rbx
xorq $0x1, %rbx
movq %rdx, %rax
orq %rbx, %rax
jne 0x88f7
movq 0x10(%r14), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rbx
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x2, (%rax,%r12,4)
jne 0x855e
movq 0x10(%r14), %rbx
movq %rbx, %rdi
callq 0x3e5e
movq 0x10(%rax), %rsi
leaq 0xaa6a(%rip), %rax      # 0x131d4
movl (%rax), %eax
addl -0x38(%rbp), %eax
movq -0x58(%rbp), %rcx
movl (%rcx), %r10d
movq -0x60(%rbp), %rcx
movl (%rcx), %r11d
movq %rbx, %rdi
movq -0x38(%rbp), %rbx
movq -0x40(%rbp), %rdx
movl %ebx, %ecx
movl %r13d, %r8d
movl %r12d, %r9d
pushq %r11
pushq %r10
pushq $0x1
pushq %r12
pushq %r13
pushq %rax
jmp 0x8d01
testl %ecx, %ecx
jne 0x8807
movq 0x10(%r14), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x88(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x1, (%rax,%r12,4)
jne 0x8807
movq 0x10(%r14), %rax
addq -0x68(%rbp), %rax
movq (%rax,%r15,8), %rdi
movl %ebx, %edx
leaq 0xa9f8(%rip), %rax      # 0x131d4
subl (%rax), %edx
movq -0x40(%rbp), %rsi
movl %r13d, %ecx
movl %r12d, %r8d
callq 0xd63b
movq -0x30(%rbp), %rdx
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
movsd %xmm0, (%rax,%r12,8)
movq %r15, %rbx
xorq $0x1, %rbx
movq %rdx, %rax
orq %rbx, %rax
jne 0x8a03
movq 0x10(%r14), %rdi
callq 0x3db0
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x2, (%rax,%r12,4)
jne 0x888d
movq 0x10(%r14), %rax
movq 0x10(%rax), %rdi
leaq 0xa988(%rip), %rax      # 0x131d4
movl (%rax), %edx
movq %r12, %r14
movq %r13, %r12
movq -0x38(%rbp), %r13
addl %r13d, %edx
movq -0x40(%rbp), %rsi
movl %r12d, %ecx
movl %r14d, %r8d
callq 0xd63b
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r13,8), %rax
movq %r12, %r13
movq %r14, %r12
movq -0xb0(%rbp), %r14
movq (%rax,%r13,8), %rax
movsd %xmm0, (%rax,%r12,8)
movq -0x30(%rbp), %rdx
movq %rdx, %rax
xorq $0x2, %rax
orq %rax, %rbx
movq -0x38(%rbp), %rbx
jne 0x855e
movq 0x10(%r14), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x88(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x6, (%rax,%r12,4)
jne 0x855e
movq 0x10(%r14), %rax
movq %rdx, %rcx
shlq $0x4, %rcx
movq 0x10(%rax,%rcx), %rdi
leaq 0xa8f9(%rip), %rax      # 0x131dc
movl (%rax), %r8d
addl %r12d, %r8d
movq -0x40(%rbp), %rsi
movl %ebx, %edx
movl %r13d, %ecx
jmp 0x8bdf
movq %rdx, %rax
xorq $0x1, %rax
movq %rax, %rcx
orq %r15, %rcx
jne 0x8a5a
movq 0x10(%r14), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rbx
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x3, (%rax,%r12,4)
jne 0x855e
movq 0x10(%r14), %rbx
movq %rbx, %rdi
callq 0x3e5e
movq 0x18(%rax), %rsi
movl %r13d, %eax
leaq 0xa889(%rip), %rcx      # 0x131d8
subl (%rcx), %eax
movq -0x50(%rbp), %rcx
movl (%rcx), %r10d
movq -0x60(%rbp), %rcx
movl (%rcx), %r11d
movq %rbx, %rdi
movq -0x38(%rbp), %rbx
movq -0x40(%rbp), %rdx
movl %ebx, %ecx
movl %r13d, %r8d
movl %r12d, %r9d
pushq %r11
pushq $0x0
pushq %r10
pushq %r12
pushq %rax
jmp 0x8d00
movq %rdx, %rax
xorq $0x1, %rax
movq %rax, %rcx
orq %r15, %rcx
jne 0x8aee
movq 0x10(%r14), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rbx
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x3, (%rax,%r12,4)
jne 0x855e
movq 0x10(%r14), %rax
movq 0x18(%rax), %rdi
callq 0x3db0
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq (%rax,%rbx,8), %rax
leaq 0xa7f2(%rip), %rcx      # 0x131d8
movslq (%rcx), %rcx
movq -0x80(%rbp), %rdx
subq %rcx, %rdx
movq (%rax,%rdx,8), %rax
movq -0x30(%rbp), %rdx
movsd (%rax,%r12,8), %xmm0
jmp 0x8be8
movq %rdx, %rax
xorq $0x1, %rax
movq %rax, %rcx
orq %r15, %rcx
jne 0x8b86
movq 0x10(%r14), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rbx
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x3, (%rax,%r12,4)
jne 0x855e
movq 0x10(%r14), %rax
movq 0x18(%rax), %rdi
movl %r13d, %ecx
leaq 0xa785(%rip), %rax      # 0x131d8
subl (%rax), %ecx
jmp 0x8bd6
orq %rbx, %rax
jne 0x8c03
movq 0x10(%r14), %rdi
callq 0x3db0
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x4, (%rax,%r12,4)
jne 0x8c7b
movq 0x10(%r14), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x3e5e
movq -0x30(%rbp), %rcx
shlq $0x4, %rcx
movq 0x10(%rax,%rcx), %rsi
leaq 0xa72a(%rip), %rax      # 0x131d8
movl (%rax), %eax
addl %r13d, %eax
movq -0x50(%rbp), %rcx
movl (%rcx), %r10d
movq -0x60(%rbp), %rcx
movl (%rcx), %r11d
movq -0xa8(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rcx
movl %r13d, %r8d
movl %r12d, %r9d
pushq %r11
pushq $0x1
pushq %r10
pushq %r12
pushq %rax
pushq %rcx
callq 0x8157
addq $0x30, %rsp
jmp 0x8c7b
orq %rbx, %rax
jne 0x8d13
movq 0x10(%r14), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x4, (%rax,%r12,4)
jne 0x8d8a
movq 0x10(%r14), %rax
movq %rdx, %rcx
shlq $0x4, %rcx
movq 0x10(%rax,%rcx), %rdi
callq 0x3db0
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rdx
movq (%rax,%rdx,8), %rax
leaq 0xa682(%rip), %rcx      # 0x131d8
movslq (%rcx), %rcx
addq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax,%r12,8), %xmm0
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rdx,8), %rax
movq -0x30(%rbp), %rdx
movq (%rax,%r13,8), %rax
movsd %xmm0, (%rax,%r12,8)
jmp 0x8d8a
orq %rbx, %rax
jne 0x8e06
movq 0x10(%r14), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rbx
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x4, (%rax,%r12,4)
jne 0x855e
movq 0x10(%r14), %rax
movq %rdx, %rcx
shlq $0x4, %rcx
movq 0x10(%rax,%rcx), %rdi
leaq 0xa607(%rip), %rax      # 0x131d8
movl (%rax), %ecx
addl %r13d, %ecx
movq -0x40(%rbp), %rsi
movl %ebx, %edx
movl %r12d, %r8d
callq 0xd63b
movq -0x30(%rbp), %rdx
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
movsd %xmm0, (%rax,%r12,8)
jmp 0x855e
movq %rdx, %rax
xorq $0x2, %rax
orq %r15, %rax
jne 0x8c7b
movq 0x10(%r14), %rdi
callq 0x3db0
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rbx
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x5, (%rax,%r12,4)
movq -0x30(%rbp), %rdx
jne 0x855e
movq 0x10(%r14), %rbx
movq %rbx, %rdi
callq 0x3e5e
movq 0x28(%rax), %rsi
movl %r12d, %eax
leaq 0xa588(%rip), %rcx      # 0x131dc
subl (%rcx), %eax
movq -0x50(%rbp), %rcx
movl (%rcx), %r10d
movq -0x58(%rbp), %rcx
movl (%rcx), %r11d
movq %rbx, %rdi
movq -0x38(%rbp), %rbx
movq -0x40(%rbp), %rdx
movl %ebx, %ecx
movl %r13d, %r8d
movl %r12d, %r9d
pushq $0x0
jmp 0x8cf9
movq -0x30(%rbp), %rdx
movq %rdx, %rax
xorq $0x2, %rax
orq %rax, %rbx
movq -0x38(%rbp), %rbx
jne 0x855e
movq 0x10(%r14), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x88(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x6, (%rax,%r12,4)
jne 0x855e
movq 0x10(%r14), %rbx
movq %rbx, %rdi
callq 0x3e5e
movq 0x30(%rax), %rsi
leaq 0xa50b(%rip), %rax      # 0x131dc
movl (%rax), %eax
addl %r12d, %eax
movq -0x50(%rbp), %rcx
movl (%rcx), %r10d
movq -0x58(%rbp), %rcx
movl (%rcx), %r11d
movq %rbx, %rdi
movq -0x38(%rbp), %rbx
movq -0x40(%rbp), %rdx
movl %ebx, %ecx
movl %r13d, %r8d
movl %r12d, %r9d
pushq $0x1
pushq %r11
pushq %r10
pushq %rax
pushq %r13
pushq %rbx
callq 0x8157
movq -0x30(%rbp), %rdx
addq $0x30, %rsp
jmp 0x855e
movq %rdx, %rax
xorq $0x2, %rax
orq %r15, %rax
jne 0x8d8a
movq 0x10(%r14), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rbx
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x5, (%rax,%r12,4)
jne 0x855e
movq 0x10(%r14), %rax
movq 0x28(%rax), %rdi
callq 0x3db0
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
leaq 0xa466(%rip), %rcx      # 0x131dc
movslq (%rcx), %rcx
movq -0x78(%rbp), %rdx
subq %rcx, %rdx
movsd (%rax,%rdx,8), %xmm0
jmp 0x8be4
movq %rdx, %rax
xorq $0x2, %rax
orq %rax, %rbx
movq -0x38(%rbp), %rbx
jne 0x855e
movq 0x10(%r14), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x88(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x6, (%rax,%r12,4)
jne 0x855e
movq 0x10(%r14), %rax
movq 0x30(%rax), %rdi
callq 0x3db0
movq -0x30(%rbp), %rdx
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
leaq 0xa3e7(%rip), %rcx      # 0x131dc
movslq (%rcx), %rcx
addq -0x78(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
jmp 0x8be8
movq %rdx, %rax
xorq $0x2, %rax
orq %r15, %rax
jne 0x888d
movq 0x10(%r14), %rdi
callq 0x3db0
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rbx
movq (%rax,%rbx,8), %rax
movq (%rax,%r13,8), %rax
cmpl $0x5, (%rax,%r12,4)
movq -0x30(%rbp), %rdx
jne 0x855e
movq 0x10(%r14), %rax
movq 0x28(%rax), %rdi
movl %r12d, %r8d
leaq 0xa389(%rip), %rax      # 0x131dc
subl (%rax), %r8d
jmp 0x88e9
incq %rdx
addq $0x8, -0x90(%rbp)
addq $0x10, -0x68(%rbp)
jmp 0x852e
incq %r12
jmp 0x8503
incq %r13
jmp 0x84e8
incq %rbx
jmp 0x84c7
movq -0x40(%rbp), %rdx
incq %rdx
jmp 0x8476
movq (%r14), %r14
cmpq -0x98(%rbp), %r14
jne 0x8458
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop