// File: /workspace/github_cpp_makefile_star2_O1/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 $0xa8, %rsp
movq %rsi, -0xa8(%rbp)
movl %edi, %ebx
movl $0x4, %edi
callq 0x21f0
movq %rax, -0x78(%rbp)
movl $0x4, %edi
callq 0x21f0
movq %rax, -0x70(%rbp)
movl $0x4, %edi
callq 0x21f0
movq %rax, -0x68(%rbp)
callq 0x3096
movl %ebx, -0x7c(%rbp)
movslq %ebx, %rax
leaq (%rax,%rax,2), %rax
leaq 0xc4d7(%rip), %rcx      # 0x15430
leaq (%rcx,%rax,8), %rax
movq (%rax), %r14
movq %rax, -0xc8(%rbp)
cmpq %rax, %r14
je 0x9af1
movq 0x10(%r14), %rdi
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq -0x68(%rbp), %rcx
callq 0x4124
leaq 0xc69c(%rip), %rcx      # 0x15628
movq 0x8(%rcx), %rax
cmpq (%rcx), %rax
je 0x9acf
xorl %ebx, %ebx
movq %r14, -0x98(%rbp)
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x10(%rax), %rax
movq %rbx, -0x40(%rbp)
movq (%rax,%rbx,8), %rbx
movq 0x20(%rbx), %rdx
movq -0xa8(%rbp), %rax
cmpq 0x8(%rax), %rdx
jne 0x9aad
testq %rdx, %rdx
je 0x8fec
movq -0xa8(%rbp), %rax
movq (%rax), %rsi
movq 0x18(%rbx), %rdi
callq 0x2210
testl %eax, %eax
jne 0x9aad
cmpl $0x0, (%rbx)
jle 0x9aad
movq $0x0, -0x30(%rbp)
movq %rbx, -0x50(%rbp)
cmpl $0x0, 0x4(%rbx)
jle 0x9a96
movslq -0x30(%rbp), %rax
movq %rax, -0xb0(%rbp)
xorl %r15d, %r15d
cmpl $0x0, 0x8(%rbx)
jle 0x9a86
movslq %r15d, %rax
movq %rax, -0xb8(%rbp)
xorl %r13d, %r13d
movq %r15, -0x60(%rbp)
movl $0x38, %r12d
movl $0x8, %eax
movq %rax, -0x38(%rbp)
movslq %r13d, %rax
movq %rax, -0xc0(%rbp)
movq $0x0, -0x58(%rbp)
movq %r13, -0x48(%rbp)
xorl %ebx, %ebx
movq %r12, -0xa0(%rbp)
movq 0x10(%r14), %rdi
leaq (%rdi,%r12), %rax
movl (%rax,%rbx,4), %ecx
testl %ecx, %ecx
je 0x907f
incq %rbx
cmpq $0x1, %rbx
je 0x9062
jmp 0x9a54
movq -0x38(%rbp), %rax
leaq (%rdi,%rax), %rdx
movq (%rdx,%rbx,8), %rax
testq %rax, %rax
je 0x940d
movq %rax, %rdi
callq 0x40ba
movq %rbx, %rcx
orq -0x58(%rbp), %rcx
cmpl -0x7c(%rbp), %eax
jne 0x975e
testl %ecx, %ecx
jne 0x9134
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
cmpl $0x1, (%rax,%r13,4)
jne 0x9134
movq 0x10(%r14), %rax
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x4064
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
leaq 0xc0e5(%rip), %rcx      # 0x151e4
movslq (%rcx), %rcx
movq -0xb0(%rbp), %rdx
subq %rcx, %rdx
movq (%rax,%rdx,8), %rax
movq (%rax,%r15,8), %rax
movsd (%rax,%r13,8), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
movsd %xmm0, (%rax,%r13,8)
movq %rbx, %r12
xorq $0x1, %r12
movq -0x58(%rbp), %rax
orq %r12, %rax
jne 0x91c1
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
cmpl $0x2, (%rax,%r13,4)
jne 0x91c1
movq 0x10(%r14), %rax
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x4064
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
leaq 0xc055(%rip), %rcx      # 0x151e4
movslq (%rcx), %rcx
addq -0xb0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
movsd (%rax,%r13,8), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
movsd %xmm0, (%rax,%r13,8)
movq -0x58(%rbp), %r13
xorq $0x1, %r13
movq %r13, %rax
orq %rbx, %rax
jne 0x925a
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x3, (%rax,%rcx,4)
jne 0x925a
movq 0x10(%r14), %rax
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x4064
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rsi
movq (%rax,%rsi,8), %rax
leaq 0xbfbd(%rip), %rcx      # 0x151e8
movslq (%rcx), %rcx
movq -0xb8(%rbp), %rdx
subq %rcx, %rdx
movq (%rax,%rdx,8), %rax
movq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rsi,8), %rax
movq (%rax,%r15,8), %rax
movsd %xmm0, (%rax,%rcx,8)
orq %r12, %r13
jne 0x92e5
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x4, (%rax,%rcx,4)
jne 0x92e5
movq 0x10(%r14), %rax
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x4064
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdx
movq (%rax,%rdx,8), %rax
leaq 0xbf2f(%rip), %rcx      # 0x151e8
movslq (%rcx), %rcx
addq -0xb8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r15,8), %rax
movsd %xmm0, (%rax,%rcx,8)
movq -0x58(%rbp), %r13
xorq $0x2, %r13
movq %r13, %rax
orq %rbx, %rax
jne 0x937e
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x5, (%rax,%rcx,4)
jne 0x937e
movq 0x10(%r14), %rax
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x4064
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rsi
movq (%rax,%rsi,8), %rax
movq (%rax,%r15,8), %rax
leaq 0xbe99(%rip), %rcx      # 0x151ec
movslq (%rcx), %rcx
movq -0xc0(%rbp), %rdx
subq %rcx, %rdx
movsd (%rax,%rdx,8), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rsi,8), %rax
movq (%rax,%r15,8), %rax
movq -0x48(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
orq %r12, %r13
movq -0x48(%rbp), %r13
movq -0xa0(%rbp), %r12
jne 0x9071
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
cmpl $0x6, (%rax,%r13,4)
jne 0x9071
movq 0x10(%r14), %rax
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x4064
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq (%rax,%r15,8), %rax
leaq 0xbdff(%rip), %rcx      # 0x151ec
movslq (%rcx), %rcx
addq -0xc0(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rdx,8), %rax
jmp 0x9a45
testl %ecx, %ecx
jne 0x9071
cmpq $0x0, (%rdx,%rbx,8)
jne 0x9071
movl %ebx, %eax
orl -0x58(%rbp), %eax
jne 0x949c
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
cmpl $0x1, (%rax,%r13,4)
jne 0x949c
movq 0x10(%r14), %r12
movq %r12, %rdi
callq 0x4116
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rsi
movq -0x30(%rbp), %r8
movl %r8d, %eax
leaq 0xbd7c(%rip), %rcx      # 0x151e4
subl (%rcx), %eax
movq -0x70(%rbp), %rcx
movl (%rcx), %r10d
movq -0x68(%rbp), %rcx
movl (%rcx), %r11d
movq %r12, %rdi
movq -0x40(%rbp), %rdx
movl %r8d, %ecx
movl %r15d, %r8d
movl %r13d, %r9d
pushq %r11
pushq %r10
pushq $0x0
pushq %r13
pushq %r15
pushq %rax
callq 0x8c30
addq $0x30, %rsp
movq %rbx, %rcx
xorq $0x1, %rcx
movq -0x58(%rbp), %rax
movq %rcx, -0x88(%rbp)
orq %rcx, %rax
jne 0x952c
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
cmpl $0x2, (%rax,%r13,4)
jne 0x952c
movq 0x10(%r14), %r12
movq %r12, %rdi
callq 0x4116
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rsi
leaq 0xbcf3(%rip), %rax      # 0x151e4
movl (%rax), %eax
movq -0x30(%rbp), %r8
addl %r8d, %eax
movq -0x70(%rbp), %rcx
movl (%rcx), %r10d
movq -0x68(%rbp), %rcx
movl (%rcx), %r11d
movq %r12, %rdi
movq -0x40(%rbp), %rdx
movl %r8d, %ecx
movl %r15d, %r8d
movl %r13d, %r9d
pushq %r11
pushq %r10
pushq $0x1
pushq %r13
pushq %r15
pushq %rax
callq 0x8c30
addq $0x30, %rsp
movq -0x58(%rbp), %r12
xorq $0x1, %r12
movq %r12, %rax
orq %rbx, %rax
jne 0x95b9
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
cmpl $0x3, (%rax,%r13,4)
jne 0x95b9
movq 0x10(%r14), %rdi
movq %rdi, -0x90(%rbp)
callq 0x4116
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rsi
movl %r15d, %eax
leaq 0xbc67(%rip), %rcx      # 0x151e8
subl (%rcx), %eax
movq -0x78(%rbp), %rcx
movl (%rcx), %r10d
movq -0x68(%rbp), %rcx
movl (%rcx), %r11d
movq -0x90(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl %r15d, %r8d
movl %r13d, %r9d
pushq %r11
pushq $0x0
pushq %r10
pushq %r13
pushq %rax
pushq %rcx
callq 0x8c30
addq $0x30, %rsp
orq -0x88(%rbp), %r12
jne 0x9637
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
cmpl $0x4, (%rax,%r13,4)
jne 0x9637
movq 0x10(%r14), %r12
movq %r12, %rdi
callq 0x4116
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rsi
leaq 0xbbe8(%rip), %rax      # 0x151e8
movl (%rax), %eax
addl %r15d, %eax
movq -0x78(%rbp), %rcx
movl (%rcx), %r10d
movq -0x68(%rbp), %rcx
movl (%rcx), %r11d
movq %r12, %rdi
movq -0x40(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl %r15d, %r8d
movl %r13d, %r9d
pushq %r11
pushq $0x1
pushq %r10
pushq %r13
pushq %rax
pushq %rcx
callq 0x8c30
addq $0x30, %rsp
movq -0x58(%rbp), %r12
xorq $0x2, %r12
movq %r12, %rax
orq %rbx, %rax
jne 0x96c4
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
cmpl $0x5, (%rax,%r13,4)
jne 0x96c4
movq 0x10(%r14), %rdi
movq %rdi, -0x90(%rbp)
callq 0x4116
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rsi
movl %r13d, %eax
leaq 0xbb60(%rip), %rcx      # 0x151ec
subl (%rcx), %eax
movq -0x78(%rbp), %rcx
movl (%rcx), %r10d
movq -0x70(%rbp), %rcx
movl (%rcx), %r11d
movq -0x90(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl %r15d, %r8d
movl %r13d, %r9d
pushq $0x0
pushq %r11
pushq %r10
pushq %rax
pushq %r15
pushq %rcx
callq 0x8c30
addq $0x30, %rsp
orq -0x88(%rbp), %r12
movq -0xa0(%rbp), %r12
jne 0x9071
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
cmpl $0x6, (%rax,%r13,4)
jne 0x9071
movq 0x10(%r14), %rdi
movq %rdi, -0x88(%rbp)
callq 0x4116
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rsi
leaq 0xbace(%rip), %rax      # 0x151ec
movl (%rax), %eax
addl %r13d, %eax
movq -0x78(%rbp), %rcx
movl (%rcx), %r10d
movq -0x70(%rbp), %rcx
movl (%rcx), %r11d
movq -0x88(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl %r15d, %r8d
movl %r13d, %r9d
pushq $0x1
pushq %r11
pushq %r10
pushq %rax
pushq %r15
pushq %rcx
callq 0x8c30
addq $0x30, %rsp
jmp 0x9071
testl %ecx, %ecx
jne 0x97cb
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
cmpl $0x1, (%rax,%r13,4)
jne 0x97cb
movq 0x10(%r14), %rax
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rdi
movq -0x30(%rbp), %r15
movl %r15d, %edx
leaq 0xba45(%rip), %rax      # 0x151e4
subl (%rax), %edx
movq -0x40(%rbp), %rsi
movq -0x60(%rbp), %rcx
movl %r13d, %r8d
callq 0xfa58
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r15,8), %rax
movq -0x60(%rbp), %r15
movq (%rax,%r15,8), %rax
movsd %xmm0, (%rax,%r13,8)
movq %rbx, %r12
xorq $0x1, %r12
movq -0x58(%rbp), %rax
orq %r12, %rax
jne 0x9844
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
cmpl $0x2, (%rax,%r13,4)
jne 0x9844
movq 0x10(%r14), %rax
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rdi
leaq 0xb9d3(%rip), %rax      # 0x151e4
movl (%rax), %edx
movq -0x30(%rbp), %r15
addl %r15d, %edx
movq -0x40(%rbp), %rsi
movq -0x60(%rbp), %rcx
movl %r13d, %r8d
callq 0xfa58
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r15,8), %rax
movq -0x60(%rbp), %r15
movq (%rax,%r15,8), %rax
movsd %xmm0, (%rax,%r13,8)
movq -0x58(%rbp), %r13
xorq $0x1, %r13
movq %r13, %rax
orq %rbx, %rax
jne 0x98ca
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x3, (%rax,%rcx,4)
jne 0x98ca
movq 0x10(%r14), %rax
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rdi
movl %r15d, %ecx
leaq 0xb958(%rip), %rax      # 0x151e8
subl (%rax), %ecx
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %r15
movl %r15d, %edx
movq -0x48(%rbp), %r14
movl %r14d, %r8d
callq 0xfa58
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r15,8), %rax
movq -0x60(%rbp), %r15
movq (%rax,%r15,8), %rax
movsd %xmm0, (%rax,%r14,8)
movq -0x98(%rbp), %r14
orq %r12, %r13
jne 0x9945
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x4, (%rax,%rcx,4)
jne 0x9945
movq 0x10(%r14), %rax
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rdi
leaq 0xb8e0(%rip), %rax      # 0x151e8
movl (%rax), %ecx
addl %r15d, %ecx
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %r15
movl %r15d, %edx
movq -0x48(%rbp), %r14
movl %r14d, %r8d
callq 0xfa58
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r15,8), %rax
movq -0x60(%rbp), %r15
movq (%rax,%r15,8), %rax
movsd %xmm0, (%rax,%r14,8)
movq -0x98(%rbp), %r14
movq -0x58(%rbp), %r13
xorq $0x2, %r13
movq %r13, %rax
orq %rbx, %rax
jne 0x99cd
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x5, (%rax,%rcx,4)
jne 0x99cd
movq 0x10(%r14), %rax
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rdi
movq -0x48(%rbp), %r14
movl %r14d, %r8d
leaq 0xb857(%rip), %rax      # 0x151ec
subl (%rax), %r8d
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %r15
movl %r15d, %edx
movq -0x60(%rbp), %rcx
callq 0xfa58
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r15,8), %rax
movq -0x60(%rbp), %r15
movq (%rax,%r15,8), %rax
movsd %xmm0, (%rax,%r14,8)
movq -0x98(%rbp), %r14
orq %r12, %r13
movq -0x48(%rbp), %r13
movq -0xa0(%rbp), %r12
jne 0x9071
movq 0x10(%r14), %rdi
callq 0x4064
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r15,8), %rax
cmpl $0x6, (%rax,%r13,4)
jne 0x9071
movq 0x10(%r14), %rax
addq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rdi
leaq 0xb7d1(%rip), %rax      # 0x151ec
movl (%rax), %r8d
addl %r13d, %r8d
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %r15
movl %r15d, %edx
movq -0x60(%rbp), %rcx
callq 0xfa58
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r15,8), %rax
movq -0x60(%rbp), %r15
movq (%rax,%r15,8), %rax
movsd %xmm0, (%rax,%r13,8)
jmp 0x9071
movq -0x58(%rbp), %rcx
incq %rcx
addq $0x8, %r12
addq $0x10, -0x38(%rbp)
movq %rcx, -0x58(%rbp)
cmpq $0x3, %rcx
jne 0x9059
incq %r13
movq -0x50(%rbp), %rbx
movslq 0x8(%rbx), %rax
cmpq %rax, %r13
jl 0x9034
incq %r15
movslq 0x4(%rbx), %rax
cmpq %rax, %r15
jl 0x9019
movq -0x30(%rbp), %rdx
incq %rdx
movslq (%rbx), %rax
movq %rdx, -0x30(%rbp)
cmpq %rax, %rdx
jl 0x9001
movq -0x40(%rbp), %rbx
incq %rbx
leaq 0xbb6d(%rip), %rcx      # 0x15628
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x5, %rax
cmpq %rbx, %rax
ja 0x8fa2
movq (%r14), %r14
cmpq -0xc8(%rbp), %r14
jne 0x8f70
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xb4f8(%rip), %rdi      # 0x14ff0
leaq 0x7738(%rip), %rsi      # 0x11237
callq 0x21e0
movq %rax, %rdi
movl -0x7c(%rbp), %esi
callq 0x2330
movq %rax, %rdi
callq 0x2100
movl $0x1, %edi
callq 0x2250
nopl (%rax)