// File: suhasjains[P]AMR-Solver/src/octree.cpp
// Function: myOctree::Octree::Octree(double, double, double, double, double, double, int)
Octree::Octree( double x1, double x2, double y1, double y2, double z1, double z2, int l ) : x_min(x1), x_max(x2), y_min(y1), y_max(y2), z_min(z1), z_max(z2), level(l)   {
//	std::cerr << " parametrized constructor of octree is working " << std::endl;
    
    	for(int i=0; i<2; i++) {
        	for(int j=0; j<2; j++) {
            		for(int k=0; k<2; k++)
                		children[i][j][k] = NULL;
        	}
    	}
    
	parent = NULL;
   	setToRefine = false;
	setToCoarsen = false; 
	
	//neighbors
	for(int m=0;m<3;m++) {
		for(int n=0;n<2;n++) {
			neighbour[m][n] = NULL;
		}
	}	
   
	//boundary conditions
	for(int m=0;m<3;m++) {
		for(int n=0;n<2;n++) {
			bc[m][n] = NONE;
		}
	}	

	number = 0;
 
    	x_centre = (x_min + x_max ) / 2.0;
    	y_centre = (y_min + y_max ) / 2.0;
    	z_centre = (z_min + z_max ) / 2.0;
    
    
    	//creating block to assign it to the data
    	Block new_block(x_min, x_max, y_min, y_max, z_min, z_max);
    	block_data = new Block(new_block);
    
    	nodes.push_back(this);
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movsd %xmm2, -0x20(%rbp)
movsd %xmm3, -0x28(%rbp)
movsd %xmm4, -0x30(%rbp)
movsd %xmm5, -0x38(%rbp)
movl %esi, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, 0x68(%rax)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, 0x70(%rax)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, 0x78(%rax)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, 0x80(%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x88(%rax)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0x90(%rax)
movl -0x3c(%rbp), %ecx
movl %ecx, 0xf0(%rax)
movl $0x0, -0x40(%rbp)
cmpl $0x2, -0x40(%rbp)
jge 0x89c4
movl $0x0, -0x44(%rbp)
cmpl $0x2, -0x44(%rbp)
jge 0x89b7
movl $0x0, -0x48(%rbp)
cmpl $0x2, -0x48(%rbp)
jge 0x89aa
movq -0x108(%rbp), %rax
addq $0xa0, %rax
movslq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x44(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x48(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x896a
jmp 0x89ac
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x895d
jmp 0x89b9
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x8950
movq -0x108(%rbp), %rax
movq $0x0, 0xe8(%rax)
movb $0x0, (%rax)
movb $0x0, 0x1(%rax)
movl $0x0, -0x4c(%rbp)
cmpl $0x3, -0x4c(%rbp)
jge 0x8a31
movl $0x0, -0x50(%rbp)
cmpl $0x2, -0x50(%rbp)
jge 0x8a24
movq -0x108(%rbp), %rax
addq $0x8, %rax
movslq -0x4c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x50(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x89f1
jmp 0x8a26
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x89e4
movl $0x0, -0x54(%rbp)
cmpl $0x3, -0x54(%rbp)
jge 0x8a84
movl $0x0, -0x58(%rbp)
cmpl $0x2, -0x58(%rbp)
jge 0x8a77
movq -0x108(%rbp), %rax
addq $0x38, %rax
movslq -0x54(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x58(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x8a45
jmp 0x8a79
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x8a38
movq -0x108(%rbp), %rax
movl $0x0, 0x98(%rax)
movsd 0x68(%rax), %xmm0
movsd 0x70(%rax), %xmm1
addsd %xmm1, %xmm0
movsd 0x186d5(%rip), %xmm1    # 0x21180
mulsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rax)
movsd 0x78(%rax), %xmm0
movsd 0x80(%rax), %xmm2
addsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rax)
movsd 0x88(%rax), %xmm0
movsd 0x90(%rax), %xmm2
addsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x60(%rax)
movsd 0x68(%rax), %xmm0
movsd 0x70(%rax), %xmm1
movsd 0x78(%rax), %xmm2
movsd 0x80(%rax), %xmm3
movsd 0x88(%rax), %xmm4
movsd 0x90(%rax), %xmm5
leaq -0xe8(%rbp), %rdi
callq 0x8ff0
movl $0x90, %edi
callq 0x3250
movq %rax, -0x110(%rbp)
jmp 0x8b31
movq -0x110(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0xaa10
jmp 0x8b46
movq -0x108(%rbp), %rax
movq -0x110(%rbp), %rcx
movq %rcx, 0xe0(%rax)
movq %rax, -0x100(%rbp)
leaq 0x1d72f(%rip), %rdi     # 0x26298
leaq -0x100(%rbp), %rsi
callq 0x8e80
jmp 0x8b77
leaq -0xe8(%rbp), %rdi
callq 0xaeb0
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf0(%rbp)
movl %eax, -0xf4(%rbp)
jmp 0x8bc3
movq -0x110(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf0(%rbp)
movl %eax, -0xf4(%rbp)
movl $0x90, %esi
callq 0x3260
leaq -0xe8(%rbp), %rdi
callq 0xaeb0
movq -0xf0(%rbp), %rdi
callq 0x3420
nopl (%rax,%rax)