// File: /workspace/github_cpp_makefile_star2_O3/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, -0x80(%rbp)
movl %edi, %ebx
movl $0x4, %edi
callq 0x2200
movq %rax, -0x68(%rbp)
movl $0x4, %edi
callq 0x2200
movq %rax, -0x60(%rbp)
movl $0x4, %edi
callq 0x2200
movq %rax, -0x70(%rbp)
callq 0x309e
movl %ebx, -0x74(%rbp)
movslq %ebx, %rax
leaq (%rax,%rax,2), %rax
leaq 0xc579(%rip), %rcx      # 0x15440
leaq (%rcx,%rax,8), %rax
movq (%rax), %rsi
movq %rax, -0xa0(%rbp)
cmpq %rax, %rsi
je 0x9bb2
movq %rsi, -0x38(%rbp)
movq 0x10(%rsi), %rdi
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq -0x70(%rbp), %rcx
callq 0x424c
movq -0x38(%rbp), %rsi
leaq 0xc736(%rip), %rcx      # 0x15638
movq 0x8(%rcx), %rax
cmpq (%rcx), %rax
je 0x9b90
xorl %edx, %edx
movq 0x10(%rsi), %rdi
movq %rdx, %rbx
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x10(%rax), %rax
movq %rbx, -0x58(%rbp)
movq (%rax,%rbx,8), %rax
movq %rax, -0x50(%rbp)
movq 0x20(%rax), %rdx
movq -0x80(%rbp), %rax
cmpq 0x8(%rax), %rdx
jne 0x9b6e
testq %rdx, %rdx
je 0x8f68
movq -0x80(%rbp), %rax
movq (%rax), %rsi
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2220
movq -0x38(%rbp), %rsi
testl %eax, %eax
jne 0x9b6e
movq -0x50(%rbp), %rax
movl (%rax), %ecx
testl %ecx, %ecx
jle 0x9b6e
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movq $0x0, -0x30(%rbp)
testl %eax, %eax
jle 0x9b57
movq -0x50(%rbp), %rcx
movl 0x8(%rcx), %ecx
movslq -0x30(%rbp), %rdx
movq %rdx, -0x88(%rbp)
movq $0x0, -0x40(%rbp)
testl %ecx, %ecx
jle 0x9b3a
movslq -0x40(%rbp), %rax
movq %rax, -0x90(%rbp)
xorl %edx, %edx
movq %rdx, -0x48(%rbp)
movslq %edx, %rax
movq %rax, -0xa8(%rbp)
xorl %r14d, %r14d
movl %r14d, %eax
movq %rax, -0x98(%rbp)
movb $0x1, %r15b
xorl %r13d, %r13d
xorl %ebx, %ebx
movq 0x10(%rsi), %rdi
leaq (%rdi,%r14,8), %rax
cmpl $0x0, 0x38(%rax,%rbx,4)
je 0x9007
movl $0x1, %ebx
movb $0x1, %r13b
testb $0x1, %r15b
movl $0x0, %r15d
jne 0x8fdf
jmp 0x99f0
movq %r14, %r12
shlq $0x4, %r12
leaq (%rdi,%r12), %rax
movq 0x8(%rax,%rbx,8), %rax
testq %rax, %rax
je 0x91a2
movq %rax, %rdi
callq 0x41e2
movq %rbx, %rcx
orq -0x98(%rbp), %rcx
notb %r13b
cmpl -0x74(%rbp), %eax
jne 0x92f6
testq %rcx, %rcx
movq -0x38(%rbp), %rsi
jne 0x90e0
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x90e0
movq 0x10(%rsi), %rax
addq %r12, %rax
movq 0x8(%rax,%rbx,8), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
leaq 0xc147(%rip), %rcx      # 0x151ec
movslq (%rcx), %rcx
movq -0x88(%rbp), %rdx
subq %rcx, %rdx
movq (%rax,%rdx,8), %rax
movq -0x40(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq -0x48(%rbp), %rdi
movsd (%rax,%rdi,8), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%rdx,8), %rax
movsd %xmm0, (%rax,%rdi,8)
testq %r14, %r14
setne %al
orb %r13b, %al
testb $0x1, %al
je 0x9883
cmpq $0x1, %r14
setne %cl
movl %r15d, %eax
notb %al
orb %al, %cl
testb $0x1, %cl
jne 0x9522
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x3, (%rax,%rcx,4)
jne 0x8fee
movq 0x10(%rsi), %rax
movq 0x18(%rax), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdi
movq (%rax,%rdi,8), %rax
leaq 0xc086(%rip), %rcx      # 0x151f0
movslq (%rcx), %rcx
movq -0x90(%rbp), %rdx
subq %rcx, %rdx
movq (%rax,%rdx,8), %rax
movq -0x48(%rbp), %rdx
movsd (%rax,%rdx,8), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rdi,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax,%rdx,8)
jmp 0x8fee
movq %rbx, %rax
orq -0x98(%rbp), %rax
jne 0x9240
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x9240
movq 0x10(%rsi), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x423e
addq %r12, %rax
movq 0x8(%rax,%rbx,8), %rsi
movq -0x30(%rbp), %r8
movl %r8d, %eax
leaq 0xbfea(%rip), %rcx      # 0x151ec
subl (%rcx), %eax
movq -0x60(%rbp), %rcx
movl (%rcx), %r10d
movq -0x70(%rbp), %rcx
movl (%rcx), %r11d
movq -0xb0(%rbp), %rdi
movq -0x58(%rbp), %rdx
movl %r8d, %ecx
movq -0x40(%rbp), %r8
movq -0x48(%rbp), %r9
pushq %r11
pushq %r10
pushq $0x0
pushq %r9
pushq %r8
pushq %rax
callq 0x8bab
movq -0x38(%rbp), %rsi
addq $0x30, %rsp
testq %r14, %r14
setne %al
notb %r13b
orb %r13b, %al
testb $0x1, %al
je 0x97f4
cmpq $0x1, %r14
setne %cl
movl %r15d, %eax
notb %al
orb %al, %cl
testb $0x1, %cl
jne 0x940c
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x3, (%rax,%rcx,4)
jne 0x8fee
movq 0x10(%rsi), %rbx
movq %rbx, %rdi
callq 0x423e
movq 0x18(%rax), %rsi
movq -0x40(%rbp), %r8
movl %r8d, %eax
leaq 0xbf35(%rip), %rcx      # 0x151f0
subl (%rcx), %eax
movq -0x68(%rbp), %rcx
movl (%rcx), %r10d
movq -0x70(%rbp), %rcx
movl (%rcx), %r11d
movq %rbx, %rdi
movq -0x58(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x48(%rbp), %r9
pushq %r11
pushq $0x0
pushq %r10
pushq %r9
pushq %rax
pushq %rcx
callq 0x8bab
movq -0x38(%rbp), %rsi
addq $0x30, %rsp
jmp 0x8fee
testq %rcx, %rcx
movq -0x38(%rbp), %rsi
jne 0x937c
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x937c
movq 0x10(%rsi), %rax
addq %r12, %rax
movq 0x8(%rax,%rbx,8), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0xbea6(%rip), %rax      # 0x151ec
subl (%rax), %edx
movq -0x58(%rbp), %rsi
movq -0x40(%rbp), %rbx
movl %ebx, %ecx
movq -0x48(%rbp), %r8
callq 0xf8d3
movq -0x38(%rbp), %rsi
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%rbx,8), %rax
movq -0x48(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
testq %r14, %r14
setne %al
orb %r13b, %al
testb $0x1, %al
jne 0x94ab
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x9716
movq 0x10(%rsi), %rax
movq 0x10(%rax), %rdi
leaq 0xbe1e(%rip), %rax      # 0x151ec
movl (%rax), %edx
addl -0x30(%rbp), %edx
movq -0x58(%rbp), %rsi
movq -0x40(%rbp), %rbx
movl %ebx, %ecx
movq -0x48(%rbp), %r8
callq 0xf8d3
movq -0x38(%rbp), %rsi
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%rbx,8), %rax
movq -0x48(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x9716
cmpq $0x1, %r14
setne %cl
orb %r13b, %cl
testb $0x1, %cl
jne 0x95cd
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x4, (%rax,%rcx,4)
jne 0x9658
movq 0x10(%rsi), %rbx
movq %rbx, %rdi
callq 0x423e
movq 0x10(%rax,%r12), %rsi
leaq 0xbd87(%rip), %rax      # 0x151f0
movl (%rax), %eax
movq -0x40(%rbp), %r8
addl %r8d, %eax
movq -0x68(%rbp), %rcx
movl (%rcx), %r10d
movq -0x70(%rbp), %rcx
movl (%rcx), %r11d
movq %rbx, %rdi
movq -0x58(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x48(%rbp), %r9
pushq %r11
pushq $0x1
pushq %r10
pushq %r9
pushq %rax
pushq %rcx
callq 0x8bab
movq -0x38(%rbp), %rsi
addq $0x30, %rsp
jmp 0x9658
cmpq $0x1, %r14
setne %cl
movl %r15d, %eax
notb %al
orb %al, %cl
testb $0x1, %cl
jne 0x9671
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x3, (%rax,%rcx,4)
jne 0x8fee
movq 0x10(%rsi), %rax
movq 0x18(%rax), %rdi
movq -0x40(%rbp), %r12
movl %r12d, %ecx
leaq 0xbce6(%rip), %rax      # 0x151f0
subl (%rax), %ecx
movq -0x58(%rbp), %rsi
movq -0x30(%rbp), %rbx
movl %ebx, %edx
movq -0x48(%rbp), %r13
movl %r13d, %r8d
jmp 0x96f2
cmpq $0x1, %r14
setne %cl
orb %r13b, %cl
testb $0x1, %cl
jne 0x972f
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x4, (%rax,%rcx,4)
jne 0x97db
movq 0x10(%rsi), %rax
movq 0x10(%rax,%r12), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdx
movq (%rax,%rdx,8), %rax
leaq 0xbc58(%rip), %rcx      # 0x151f0
movslq (%rcx), %rcx
addq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rdi
movsd (%rax,%rdi,8), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rdx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax,%rdi,8)
jmp 0x97db
cmpq $0x2, %r14
setne %cl
orb %al, %cl
testb $0x1, %cl
jne 0x9658
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x5, (%rax,%rcx,4)
jne 0x8fee
movq 0x10(%rsi), %rbx
movq %rbx, %rdi
callq 0x423e
movq 0x28(%rax), %rsi
movq -0x48(%rbp), %r9
movl %r9d, %eax
leaq 0xbbc9(%rip), %rcx      # 0x151f4
subl (%rcx), %eax
movq -0x68(%rbp), %rcx
movl (%rcx), %r10d
movq -0x60(%rbp), %rcx
movl (%rcx), %r11d
movq %rbx, %rdi
movq -0x58(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x40(%rbp), %r8
pushq $0x0
pushq %r11
pushq %r10
pushq %rax
pushq %r8
jmp 0x92e3
cmpq $0x2, %r14
setne %al
orb %al, %r13b
testb $0x1, %r13b
jne 0x8fee
jmp 0x9a02
cmpq $0x1, %r14
setne %cl
orb %r13b, %cl
testb $0x1, %cl
je 0x9979
cmpq $0x2, %r14
setne %cl
orb %al, %cl
testb $0x1, %cl
jne 0x9716
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x5, (%rax,%rcx,4)
jne 0x8fee
movq 0x10(%rsi), %rax
movq 0x28(%rax), %rdi
movq -0x48(%rbp), %r13
movl %r13d, %r8d
leaq 0xbb16(%rip), %rax      # 0x151f4
subl (%rax), %r8d
movq -0x58(%rbp), %rsi
movq -0x30(%rbp), %rbx
movl %ebx, %edx
movq -0x40(%rbp), %r12
movl %r12d, %ecx
callq 0xf8d3
movq -0x38(%rbp), %rsi
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%r13,8)
jmp 0x8fee
cmpq $0x2, %r14
setne %al
orb %al, %r13b
testb $0x1, %r13b
jne 0x8fee
jmp 0x991a
cmpq $0x2, %r14
setne %cl
orb %al, %cl
testb $0x1, %cl
jne 0x97db
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x5, (%rax,%rcx,4)
jne 0x8fee
movq 0x10(%rsi), %rax
movq 0x28(%rax), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdi
movq (%rax,%rdi,8), %rax
movq -0x40(%rbp), %r8
movq (%rax,%r8,8), %rax
leaq 0xba49(%rip), %rcx      # 0x151f4
movslq (%rcx), %rcx
movq -0xa8(%rbp), %rdx
subq %rcx, %rdx
movsd (%rax,%rdx,8), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rdi,8), %rax
movq (%rax,%r8,8), %rax
movq -0x48(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x8fee
cmpq $0x2, %r14
setne %al
orb %al, %r13b
testb $0x1, %r13b
jne 0x8fee
jmp 0x9a8d
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x99f0
movq 0x10(%rsi), %rbx
movq %rbx, %rdi
callq 0x423e
movq 0x10(%rax), %rsi
leaq 0xb9af(%rip), %rax      # 0x151ec
movl (%rax), %eax
movq -0x30(%rbp), %r8
addl %r8d, %eax
movq -0x60(%rbp), %rcx
movl (%rcx), %r10d
movq -0x70(%rbp), %rcx
movl (%rcx), %r11d
movq %rbx, %rdi
movq -0x58(%rbp), %rdx
movl %r8d, %ecx
movq -0x40(%rbp), %r8
movq -0x48(%rbp), %r9
pushq %r11
pushq %r10
pushq $0x1
pushq %r9
pushq %r8
pushq %rax
callq 0x8bab
movq -0x38(%rbp), %rsi
addq $0x30, %rsp
jmp 0x99f0
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x99f0
movq 0x10(%rsi), %rax
movq 0x10(%rax), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
leaq 0xb90f(%rip), %rcx      # 0x151ec
movslq (%rcx), %rcx
addq -0x88(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq -0x48(%rbp), %rdi
movsd (%rax,%rdi,8), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%rdx,8), %rax
movsd %xmm0, (%rax,%rdi,8)
jmp 0x99f0
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x6, (%rax,%rcx,4)
jne 0x99f0
movq 0x10(%rsi), %rax
movq 0x10(%rax,%r12), %rdi
leaq 0xb898(%rip), %rax      # 0x151f4
movl (%rax), %r8d
movq -0x48(%rbp), %r12
addl %r12d, %r8d
movq -0x58(%rbp), %rsi
movq -0x30(%rbp), %rbx
movl %ebx, %edx
movq -0x40(%rbp), %r15
movl %r15d, %ecx
jmp 0x99d1
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x4, (%rax,%rcx,4)
jne 0x99f0
movq 0x10(%rsi), %rax
movq 0x10(%rax,%r12), %rdi
leaq 0xb839(%rip), %rax      # 0x151f0
movl (%rax), %ecx
movq -0x40(%rbp), %r15
addl %r15d, %ecx
movq -0x58(%rbp), %rsi
movq -0x30(%rbp), %rbx
movl %ebx, %edx
movq -0x48(%rbp), %r12
movl %r12d, %r8d
callq 0xf8d3
movq -0x38(%rbp), %rsi
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r15,8), %rax
movsd %xmm0, (%rax,%r12,8)
incq %r14
cmpq $0x3, %r14
jne 0x8fcd
jmp 0x9b1b
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x6, (%rax,%rcx,4)
jne 0x9b1b
movq 0x10(%rsi), %rbx
movq %rbx, %rdi
callq 0x423e
movq 0x30(%rax), %rsi
leaq 0xb7a9(%rip), %rax      # 0x151f4
movl (%rax), %eax
movq -0x48(%rbp), %r9
addl %r9d, %eax
movq -0x68(%rbp), %rcx
movl (%rcx), %r10d
movq -0x60(%rbp), %rcx
movl (%rcx), %r11d
movq %rbx, %rdi
movq -0x58(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x40(%rbp), %r8
pushq $0x1
pushq %r11
pushq %r10
pushq %rax
pushq %r8
pushq %rcx
callq 0x8bab
movq -0x38(%rbp), %rsi
addq $0x30, %rsp
jmp 0x9b1b
movq 0x10(%rsi), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x88(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
cmpl $0x6, (%rax,%rcx,4)
jne 0x9b1b
movq 0x10(%rsi), %rax
movq 0x30(%rax), %rdi
callq 0x418c
movq -0x38(%rbp), %rsi
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdi
movq (%rax,%rdi,8), %rax
movq -0x40(%rbp), %r8
movq (%rax,%r8,8), %rax
leaq 0xb701(%rip), %rcx      # 0x151f4
movslq (%rcx), %rcx
movq -0x48(%rbp), %r9
movslq %r9d, %rdx
addq %rcx, %rdx
movsd (%rax,%rdx,8), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rdi,8), %rax
movq (%rax,%r8,8), %rax
movsd %xmm0, (%rax,%r9,8)
movq -0x48(%rbp), %rdx
incq %rdx
movq -0x50(%rbp), %rax
movslq 0x8(%rax), %rcx
cmpq %rcx, %rdx
jl 0x8fbc
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x40(%rbp), %r8
incq %r8
movslq %eax, %rdx
movq %r8, -0x40(%rbp)
cmpq %rdx, %r8
jl 0x8fa7
movq -0x50(%rbp), %rcx
movl (%rcx), %ecx
movq -0x30(%rbp), %r8
incq %r8
movslq %ecx, %rdx
movq %r8, -0x30(%rbp)
cmpq %rdx, %r8
jl 0x8f85
movq -0x58(%rbp), %rdx
incq %rdx
leaq 0xbabc(%rip), %rcx      # 0x15638
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x5, %rax
cmpq %rdx, %rax
ja 0x8f11
movq (%rsi), %rsi
cmpq -0xa0(%rbp), %rsi
jne 0x8ede
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xb437(%rip), %rdi      # 0x14ff0
leaq 0x7677(%rip), %rsi      # 0x11237
callq 0x21f0
movq %rax, %rdi
movl -0x74(%rbp), %esi
callq 0x2340
movq %rax, %rdi
callq 0x2100
movl $0x1, %edi
callq 0x2260
nop