// File: suhasjains[P]AMR-Solver/src/octree.cpp
// Function: myOctree::Octree::Octree()
Octree::Octree() {
//	std::cerr << " default 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;
		}
	}	
	
	x_centre = 0.0;
	y_centre = 0.0;
	z_centre = 0.0;
	x_min = 0.0;
	y_min = 0.0;
	z_min = 0.0;
	x_max = 0.0;
	y_max = 0.0;
	z_max = 0.0;

	level = 0;

	//boundary conditions
	for(int m=0;m<3;m++) {
		for(int n=0;n<2;n++) {
			bc[m][n] = NONE;
		}
	}	

	number = 0;

    //creating block to assign it to the data
    Block new_block;
    block_data = new Block(new_block);
    
    nodes.push_back(this);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x2, -0xc(%rbp)
jge 0x8c75
movl $0x0, -0x10(%rbp)
cmpl $0x2, -0x10(%rbp)
jge 0x8c68
movl $0x0, -0x14(%rbp)
cmpl $0x2, -0x14(%rbp)
jge 0x8c5b
movq -0xd8(%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 $0x0, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8c1b
jmp 0x8c5d
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x8c0e
jmp 0x8c6a
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x8c01
movq -0xd8(%rbp), %rax
movq $0x0, 0xe8(%rax)
movb $0x0, (%rax)
movb $0x0, 0x1(%rax)
movl $0x0, -0x18(%rbp)
cmpl $0x3, -0x18(%rbp)
jge 0x8ce2
movl $0x0, -0x1c(%rbp)
cmpl $0x2, -0x1c(%rbp)
jge 0x8cd5
movq -0xd8(%rbp), %rax
addq $0x8, %rax
movslq -0x18(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x1c(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x8ca2
jmp 0x8cd7
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x8c95
movq -0xd8(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x50(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x58(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x60(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x68(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x78(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x88(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x70(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x80(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x90(%rax)
movl $0x0, 0xf0(%rax)
movl $0x0, -0x20(%rbp)
cmpl $0x3, -0x20(%rbp)
jge 0x8d97
movl $0x0, -0x24(%rbp)
cmpl $0x2, -0x24(%rbp)
jge 0x8d8a
movq -0xd8(%rbp), %rax
addq $0x38, %rax
movslq -0x20(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x24(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x8d58
jmp 0x8d8c
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x8d4b
movq -0xd8(%rbp), %rax
movl $0x0, 0x98(%rax)
leaq -0xb8(%rbp), %rdi
callq 0xa1b0
movl $0x90, %edi
callq 0x3250
movq %rax, -0xe0(%rbp)
jmp 0x8dc7
movq -0xe0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xaa10
jmp 0x8ddc
movq -0xd8(%rbp), %rax
movq -0xe0(%rbp), %rcx
movq %rcx, 0xe0(%rax)
movq %rax, -0xd0(%rbp)
leaq 0x1d499(%rip), %rdi     # 0x26298
leaq -0xd0(%rbp), %rsi
callq 0x8e80
jmp 0x8e0d
leaq -0xb8(%rbp), %rdi
callq 0xaeb0
addq $0xe0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x8e59
movq -0xe0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
movl $0x90, %esi
callq 0x3260
leaq -0xb8(%rbp), %rdi
callq 0xaeb0
movq -0xc0(%rbp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)