// File: suhasjains[P]AMR-Solver/src/octree.cpp
// Function: myOctree::Octree::refine()
void Octree::refine() {
    
    int i, j, k;
    double xmin, xmax, ymin, ymax, zmin, zmax;
    double lev = this->level + 1;
    
    //creating children nodes
    for(k=0; k<2; k++) {
        for(j=0; j<2; j++) {
            for(i=0; i<2; i++) {
                
                if(i==0) {
                    xmin = this->x_min;
                    xmax = this->x_centre;
                }
                else {
                    xmin = this->x_centre;
                    xmax = this->x_max;
                }
                
                if(j==0) {
                    ymin = this->y_min;
                    ymax = this->y_centre;
                }
                else {
                    ymin = this->y_centre;
                    ymax = this->y_max;
                }
                
                if(k==0) {
                    zmin = this->z_min;
                    zmax = this->z_centre;
                }
                else {
                    zmin = this->z_centre;
                    zmax = this->z_max;
                }

                
                //creating new child object
                Octree child(xmin, xmax, ymin, ymax, zmin, zmax, lev);
                
                //deleting the pushed node to the list
                nodes.pop_back();
                
                //assigning parent to the child
                child.parent = this;
                
                //invoking copy constructor
                this->children[i][j][k] = new Octree(child);
                //*(this->children[i][j][k]) = child;


            }
        }
    }
    
	//setting neighbours to children - this could be redundant - yet to test
    	for(k=0; k<2; k++) {
        	for(j=0; j<2; j++) {
            		for(i=0; i<2; i++) {

				if(i==0) {
					this->children[i][j][k]->neighbour[XDIR][RIGHT] = this->children[i+1][j][k];
					if(this->neighbour[XDIR][LEFT] != NULL) 	this->children[i][j][k]->neighbour[XDIR][LEFT] = this->neighbour[XDIR][LEFT]->children[i+1][j][k];
				}	
				if(j==0) {
					this->children[i][j][k]->neighbour[YDIR][RIGHT] = this->children[i][j+1][k];
					if(this->neighbour[YDIR][LEFT] != NULL)	this->children[i][j][k]->neighbour[YDIR][LEFT] = this->neighbour[YDIR][LEFT]->children[i][j+1][k];
				}	
				if(k==0) {
					this->children[i][j][k]->neighbour[ZDIR][RIGHT] = this->children[i][j][k+1];
					if(this->neighbour[ZDIR][LEFT] != NULL)	this->children[i][j][k]->neighbour[ZDIR][LEFT] = this->neighbour[ZDIR][LEFT]->children[i][j][k+1];
				}	
				if(i==1) {
					this->children[i][j][k]->neighbour[XDIR][LEFT] = this->children[i-1][j][k];
					if(this->neighbour[XDIR][RIGHT] != NULL)	this->children[i][j][k]->neighbour[XDIR][RIGHT] = this->neighbour[XDIR][RIGHT]->children[i-1][j][k];
				}	
				if(j==1) {
					this->children[i][j][k]->neighbour[YDIR][LEFT] = this->children[i][j-1][k];
					if(this->neighbour[YDIR][RIGHT] != NULL)	this->children[i][j][k]->neighbour[YDIR][RIGHT] = this->neighbour[YDIR][RIGHT]->children[i][j-1][k];
				}	
				if(k==1) {
					this->children[i][j][k]->neighbour[ZDIR][LEFT] = this->children[i][j][k-1];
					if(this->neighbour[ZDIR][RIGHT] != NULL)	this->children[i][j][k]->neighbour[ZDIR][RIGHT] = this->neighbour[ZDIR][RIGHT]->children[i][j][k-1];
				}	
			}
		}	
	}		

	//setting boundaries to children
    	for(k=0; k<2; k++) {
        	for(j=0; j<2; j++) {
            		for(i=0; i<2; i++) {

				if(i==0) {
					this->children[i][j][k]->bc[XDIR][RIGHT] = NONE;
					this->children[i][j][k]->bc[XDIR][LEFT] = this->bc[XDIR][LEFT];
				}	
				if(j==0) {
					this->children[i][j][k]->bc[YDIR][RIGHT] = NONE;
					this->children[i][j][k]->bc[YDIR][LEFT] = this->bc[YDIR][LEFT];
				}	
				if(k==0) {
					this->children[i][j][k]->bc[ZDIR][RIGHT] = NONE;
					this->children[i][j][k]->bc[ZDIR][LEFT] = this->bc[ZDIR][LEFT];
				}	
				if(i==1) {
					this->children[i][j][k]->bc[XDIR][LEFT] = NONE;
					this->children[i][j][k]->bc[XDIR][RIGHT] = this->bc[XDIR][RIGHT];
				}	
				if(j==1) {
					this->children[i][j][k]->bc[YDIR][LEFT] = NONE;
					this->children[i][j][k]->bc[YDIR][RIGHT] = this->bc[YDIR][RIGHT];
				}	
				if(k==1) {
					this->children[i][j][k]->bc[ZDIR][LEFT] = NONE;
					this->children[i][j][k]->bc[ZDIR][RIGHT] = this->bc[ZDIR][RIGHT];
				}	
			}
		}	
	}		

	//setting boundary conditions to children fields 
    	for(k=0; k<2; k++) {
        	for(j=0; j<2; j++) {
            		for(i=0; i<2; i++) {
		
				for(int l = 0; l<scalar_fields.size() ; l++) {
					for (int m=0; m<3; m++) {
						for (int n=0; n<2; n++) {
					
							if(this->children[i][j][k]->bc[m][n] == BOUNDARY) {
								this->children[i][j][k]->get_block_data()->scalarfields[l]->bc[m][n] = \
								this->get_block_data()->scalarfields[l]->bc[m][n];  			
							}
							
							if(this->children[i][j][k]->bc[m][n] == NONE) {
								this->children[i][j][k]->get_block_data()->scalarfields[l]->bc[m][n] = none;
							}
							
							if(this->children[i][j][k]->bc[m][n] == MPI_BOUNDARY) {
								this->children[i][j][k]->get_block_data()->scalarfields[l]->bc[m][n] = mpi_boundary;
							}
						}	
					}
				}
				
				for(int l = 0; l<vector_fields.size() ; l++) {
					for (int m=0; m<3; m++) {
						for (int n=0; n<2; n++) {
					
							if(this->children[i][j][k]->bc[m][n] == BOUNDARY) {
								this->children[i][j][k]->get_block_data()->vectorfields[l]->xbc[m][n] = \
								this->get_block_data()->vectorfields[l]->xbc[m][n];  			
								this->children[i][j][k]->get_block_data()->vectorfields[l]->ybc[m][n] = \
								this->get_block_data()->vectorfields[l]->ybc[m][n];  			
								this->children[i][j][k]->get_block_data()->vectorfields[l]->zbc[m][n] = \
								this->get_block_data()->vectorfields[l]->zbc[m][n];  			
							}
							
							if(this->children[i][j][k]->bc[m][n] == NONE) {
								this->children[i][j][k]->get_block_data()->vectorfields[l]->xbc[m][n] = none;
								this->children[i][j][k]->get_block_data()->vectorfields[l]->ybc[m][n] = none;
								this->children[i][j][k]->get_block_data()->vectorfields[l]->zbc[m][n] = none;
							}
							
							if(this->children[i][j][k]->bc[m][n] == MPI_BOUNDARY) {
								this->children[i][j][k]->get_block_data()->vectorfields[l]->xbc[m][n] = mpi_boundary;
								this->children[i][j][k]->get_block_data()->vectorfields[l]->ybc[m][n] = mpi_boundary;
								this->children[i][j][k]->get_block_data()->vectorfields[l]->zbc[m][n] = mpi_boundary;
							}
						}	
					}
				}
			}
		}	
	}

	//Bilinear interpolation to fill ghost cells of children nodes


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x178(%rbp)
movl 0xf0(%rax), %eax
addl $0x1, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x50(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x2, -0x14(%rbp)
jge 0x7464
movl $0x0, -0x10(%rbp)
cmpl $0x2, -0x10(%rbp)
jge 0x7454
movl $0x0, -0xc(%rbp)
cmpl $0x2, -0xc(%rbp)
jge 0x7444
cmpl $0x0, -0xc(%rbp)
jne 0x72a2
movq -0x178(%rbp), %rax
movsd 0x68(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x50(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x72bd
movq -0x178(%rbp), %rax
movsd 0x50(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x70(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x72e0
movq -0x178(%rbp), %rax
movsd 0x78(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x58(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
jmp 0x72fe
movq -0x178(%rbp), %rax
movsd 0x58(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x80(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x7324
movq -0x178(%rbp), %rax
movsd 0x88(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd 0x60(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
jmp 0x7342
movq -0x178(%rbp), %rax
movsd 0x60(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd 0x90(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
movsd -0x30(%rbp), %xmm2
movsd -0x38(%rbp), %xmm3
movsd -0x40(%rbp), %xmm4
movsd -0x48(%rbp), %xmm5
cvttsd2si -0x50(%rbp), %esi
leaq -0x148(%rbp), %rdi
callq 0x88c0
leaq 0x1ef20(%rip), %rdi     # 0x26298
callq 0x5ac0
movq -0x178(%rbp), %rax
movq %rax, -0x60(%rbp)
movl $0xf8, %edi
callq 0x3250
movq %rax, -0x180(%rbp)
jmp 0x739b
movq -0x180(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x85d0
jmp 0x73b0
movq -0x180(%rbp), %rdx
movq -0x178(%rbp), %rax
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
leaq -0x148(%rbp), %rdi
callq 0x8590
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7275
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x150(%rbp)
movl %eax, -0x154(%rbp)
jmp 0x7433
movq -0x180(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x150(%rbp)
movl %eax, -0x154(%rbp)
movl $0xf8, %esi
callq 0x3260
leaq -0x148(%rbp), %rdi
callq 0x8590
jmp 0x857c
jmp 0x7446
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x7264
jmp 0x7456
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x7253
movl $0x0, -0x14(%rbp)
cmpl $0x2, -0x14(%rbp)
jge 0x79a7
movl $0x0, -0x10(%rbp)
cmpl $0x2, -0x10(%rbp)
jge 0x7997
movl $0x0, -0xc(%rbp)
cmpl $0x2, -0xc(%rbp)
jge 0x7987
cmpl $0x0, -0xc(%rbp)
jne 0x7567
movq -0x178(%rbp), %rax
movq %rax, %rcx
addq $0xa0, %rcx
movl -0xc(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rdx
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rsi
shlq $0x5, %rsi
addq %rsi, %rcx
movslq -0x10(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rcx
movslq -0x14(%rbp), %rsi
movq (%rcx,%rsi,8), %rcx
movq %rdx, 0x8(%rcx)
cmpq $0x0, 0x10(%rax)
je 0x7565
movq -0x178(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0xa0, %rcx
movl -0xc(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
addq $0xa0, %rax
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq %rcx, 0x10(%rax)
jmp 0x7567
cmpl $0x0, -0x10(%rbp)
jne 0x7637
movq -0x178(%rbp), %rax
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movl -0x10(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rdx
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rsi
shlq $0x5, %rsi
addq %rsi, %rcx
movslq -0x10(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rcx
movslq -0x14(%rbp), %rsi
movq (%rcx,%rsi,8), %rcx
movq %rdx, 0x18(%rcx)
cmpq $0x0, 0x20(%rax)
je 0x7635
movq -0x178(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movl -0x10(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
addq $0xa0, %rax
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq %rcx, 0x20(%rax)
jmp 0x7637
cmpl $0x0, -0x14(%rbp)
jne 0x7707
movq -0x178(%rbp), %rax
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl -0x14(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rdx
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rsi
shlq $0x5, %rsi
addq %rsi, %rcx
movslq -0x10(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rcx
movslq -0x14(%rbp), %rsi
movq (%rcx,%rsi,8), %rcx
movq %rdx, 0x28(%rcx)
cmpq $0x0, 0x30(%rax)
je 0x7705
movq -0x178(%rbp), %rax
movq 0x30(%rax), %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl -0x14(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
addq $0xa0, %rax
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq %rcx, 0x30(%rax)
jmp 0x7707
cmpl $0x1, -0xc(%rbp)
jne 0x77d7
movq -0x178(%rbp), %rax
movq %rax, %rcx
addq $0xa0, %rcx
movl -0xc(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rdx
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rsi
shlq $0x5, %rsi
addq %rsi, %rcx
movslq -0x10(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rcx
movslq -0x14(%rbp), %rsi
movq (%rcx,%rsi,8), %rcx
movq %rdx, 0x10(%rcx)
cmpq $0x0, 0x8(%rax)
je 0x77d5
movq -0x178(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0xa0, %rcx
movl -0xc(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
addq $0xa0, %rax
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq %rcx, 0x8(%rax)
jmp 0x77d7
cmpl $0x1, -0x10(%rbp)
jne 0x78a7
movq -0x178(%rbp), %rax
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movl -0x10(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rdx
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rsi
shlq $0x5, %rsi
addq %rsi, %rcx
movslq -0x10(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rcx
movslq -0x14(%rbp), %rsi
movq (%rcx,%rsi,8), %rcx
movq %rdx, 0x20(%rcx)
cmpq $0x0, 0x18(%rax)
je 0x78a5
movq -0x178(%rbp), %rax
movq 0x18(%rax), %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movl -0x10(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
addq $0xa0, %rax
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq %rcx, 0x18(%rax)
jmp 0x78a7
cmpl $0x1, -0x14(%rbp)
jne 0x7977
movq -0x178(%rbp), %rax
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl -0x14(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rdx
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rsi
shlq $0x5, %rsi
addq %rsi, %rcx
movslq -0x10(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rcx
movslq -0x14(%rbp), %rsi
movq (%rcx,%rsi,8), %rcx
movq %rdx, 0x30(%rcx)
cmpq $0x0, 0x28(%rax)
je 0x7975
movq -0x178(%rbp), %rax
movq 0x28(%rax), %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl -0x14(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
addq $0xa0, %rax
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq %rcx, 0x28(%rax)
jmp 0x7977
jmp 0x7979
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x748d
jmp 0x7989
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x747c
jmp 0x7999
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x746b
movl $0x0, -0x14(%rbp)
cmpl $0x2, -0x14(%rbp)
jge 0x7c6e
movl $0x0, -0x10(%rbp)
cmpl $0x2, -0x10(%rbp)
jge 0x7c5e
movl $0x0, -0xc(%rbp)
cmpl $0x2, -0xc(%rbp)
jge 0x7c4e
cmpl $0x0, -0xc(%rbp)
jne 0x7a40
movq -0x178(%rbp), %rax
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl $0x0, 0x38(%rcx)
movl 0x3c(%rax), %ecx
addq $0xa0, %rax
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x3c(%rax)
cmpl $0x0, -0x10(%rbp)
jne 0x7aa6
movq -0x178(%rbp), %rax
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl $0x0, 0x40(%rcx)
movl 0x44(%rax), %ecx
addq $0xa0, %rax
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x44(%rax)
cmpl $0x0, -0x14(%rbp)
jne 0x7b0c
movq -0x178(%rbp), %rax
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl $0x0, 0x48(%rcx)
movl 0x4c(%rax), %ecx
addq $0xa0, %rax
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x4c(%rax)
cmpl $0x1, -0xc(%rbp)
jne 0x7b72
movq -0x178(%rbp), %rax
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl $0x0, 0x3c(%rcx)
movl 0x38(%rax), %ecx
addq $0xa0, %rax
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x38(%rax)
cmpl $0x1, -0x10(%rbp)
jne 0x7bd8
movq -0x178(%rbp), %rax
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl $0x0, 0x44(%rcx)
movl 0x40(%rax), %ecx
addq $0xa0, %rax
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x40(%rax)
cmpl $0x1, -0x14(%rbp)
jne 0x7c3e
movq -0x178(%rbp), %rax
movq %rax, %rcx
addq $0xa0, %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl $0x0, 0x4c(%rcx)
movl 0x48(%rax), %ecx
addq $0xa0, %rax
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x48(%rax)
jmp 0x7c40
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x79d0
jmp 0x7c50
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x79bf
jmp 0x7c60
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x79ae
movl $0x0, -0x14(%rbp)
cmpl $0x2, -0x14(%rbp)
jge 0x8573
movl $0x0, -0x10(%rbp)
cmpl $0x2, -0x10(%rbp)
jge 0x8563
movl $0x0, -0xc(%rbp)
cmpl $0x2, -0xc(%rbp)
jge 0x8553
movl $0x0, -0x158(%rbp)
movslq -0x158(%rbp), %rax
movq %rax, -0x188(%rbp)
leaq 0x1e9f8(%rip), %rdi     # 0x266b8
callq 0x5b00
movq %rax, %rcx
movq -0x188(%rbp), %rax
cmpq %rcx, %rax
jae 0x7f89
movl $0x0, -0x15c(%rbp)
cmpl $0x3, -0x15c(%rbp)
jge 0x7f73
movl $0x0, -0x160(%rbp)
cmpl $0x2, -0x160(%rbp)
jge 0x7f5d
movq -0x178(%rbp), %rax
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x38, %rax
movslq -0x15c(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x160(%rbp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x7df5
movq -0x178(%rbp), %rdi
callq 0x6de0
movq %rax, %rcx
movq -0x178(%rbp), %rax
movq 0x10(%rcx), %rcx
movslq -0x158(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
addq $0x38, %rcx
movslq -0x15c(%rbp), %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movslq -0x160(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x18c(%rbp)
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x6de0
movl -0x18c(%rbp), %edx
movq 0x10(%rax), %rax
movslq -0x158(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x38, %rax
movslq -0x15c(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x160(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x178(%rbp), %rax
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x38, %rax
movslq -0x15c(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x160(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x7e9e
movq -0x178(%rbp), %rax
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x6de0
movq 0x10(%rax), %rax
movslq -0x158(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x38, %rax
movslq -0x15c(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x160(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x178(%rbp), %rax
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x38, %rax
movslq -0x15c(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x160(%rbp), %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x7f47
movq -0x178(%rbp), %rax
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x6de0
movq 0x10(%rax), %rax
movslq -0x158(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x38, %rax
movslq -0x15c(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x160(%rbp), %rcx
movl $0x3, (%rax,%rcx,4)
jmp 0x7f49
movl -0x160(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x160(%rbp)
jmp 0x7cf9
jmp 0x7f5f
movl -0x15c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x15c(%rbp)
jmp 0x7ce2
jmp 0x7f75
movl -0x158(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x158(%rbp)
jmp 0x7cab
movl $0x0, -0x164(%rbp)
movslq -0x164(%rbp), %rax
movq %rax, -0x198(%rbp)
leaq 0x1e728(%rip), %rdi     # 0x266d0
callq 0x5b00
movq %rax, %rcx
movq -0x198(%rbp), %rax
cmpq %rcx, %rax
jae 0x8543
movl $0x0, -0x168(%rbp)
cmpl $0x3, -0x168(%rbp)
jge 0x852d
movl $0x0, -0x16c(%rbp)
cmpl $0x2, -0x16c(%rbp)
jge 0x8517
movq -0x178(%rbp), %rax
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x38, %rax
movslq -0x168(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x16c(%rbp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x821f
movq -0x178(%rbp), %rdi
callq 0x6de0
movq %rax, %rcx
movq -0x178(%rbp), %rax
movq 0x18(%rcx), %rcx
movslq -0x164(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
addq $0x48, %rcx
movslq -0x168(%rbp), %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movslq -0x16c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x1a4(%rbp)
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x6de0
movl -0x1a4(%rbp), %edx
movq -0x178(%rbp), %rdi
movq 0x18(%rax), %rax
movslq -0x164(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x48, %rax
movslq -0x168(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x16c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
callq 0x6de0
movq %rax, %rcx
movq -0x178(%rbp), %rax
movq 0x18(%rcx), %rcx
movslq -0x164(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
addq $0x60, %rcx
movslq -0x168(%rbp), %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movslq -0x16c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x1a0(%rbp)
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x6de0
movl -0x1a0(%rbp), %edx
movq -0x178(%rbp), %rdi
movq 0x18(%rax), %rax
movslq -0x164(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x60, %rax
movslq -0x168(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x16c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
callq 0x6de0
movq %rax, %rcx
movq -0x178(%rbp), %rax
movq 0x18(%rcx), %rcx
movslq -0x164(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
addq $0x78, %rcx
movslq -0x168(%rbp), %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movslq -0x16c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x19c(%rbp)
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x6de0
movl -0x19c(%rbp), %edx
movq 0x18(%rax), %rax
movslq -0x164(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x78, %rax
movslq -0x168(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x16c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x178(%rbp), %rax
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x38, %rax
movslq -0x168(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x16c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x8390
movq -0x178(%rbp), %rax
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x6de0
movq %rax, %rcx
movq -0x178(%rbp), %rax
movq 0x18(%rcx), %rcx
movslq -0x164(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
addq $0x48, %rcx
movslq -0x168(%rbp), %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movslq -0x16c(%rbp), %rdx
movl $0x0, (%rcx,%rdx,4)
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x6de0
movq %rax, %rcx
movq -0x178(%rbp), %rax
movq 0x18(%rcx), %rcx
movslq -0x164(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
addq $0x60, %rcx
movslq -0x168(%rbp), %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movslq -0x16c(%rbp), %rdx
movl $0x0, (%rcx,%rdx,4)
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x6de0
movq 0x18(%rax), %rax
movslq -0x164(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x78, %rax
movslq -0x168(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x16c(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x178(%rbp), %rax
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x38, %rax
movslq -0x168(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x16c(%rbp), %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x8501
movq -0x178(%rbp), %rax
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x6de0
movq %rax, %rcx
movq -0x178(%rbp), %rax
movq 0x18(%rcx), %rcx
movslq -0x164(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
addq $0x48, %rcx
movslq -0x168(%rbp), %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movslq -0x16c(%rbp), %rdx
movl $0x3, (%rcx,%rdx,4)
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x6de0
movq %rax, %rcx
movq -0x178(%rbp), %rax
movq 0x18(%rcx), %rcx
movslq -0x164(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
addq $0x60, %rcx
movslq -0x168(%rbp), %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movslq -0x16c(%rbp), %rdx
movl $0x3, (%rcx,%rdx,4)
addq $0xa0, %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x6de0
movq 0x18(%rax), %rax
movslq -0x164(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x78, %rax
movslq -0x168(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x16c(%rbp), %rcx
movl $0x3, (%rax,%rcx,4)
jmp 0x8503
movl -0x16c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x16c(%rbp)
jmp 0x7fe1
jmp 0x8519
movl -0x168(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x168(%rbp)
jmp 0x7fca
jmp 0x852f
movl -0x164(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x164(%rbp)
jmp 0x7f93
jmp 0x8545
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7c97
jmp 0x8555
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x7c86
jmp 0x8565
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x7c75
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x150(%rbp), %rdi
callq 0x3420
nopl (%rax,%rax)