// File: /workspace/github_cpp_makefile_star2_O3/suhasjains[P]AMR-Solver/src/block.cpp
// Function: myOctree::Block::Block()
Block::Block() {
  //		std::cerr << "default constructor of block is working" << std::endl;

        VecField mesh_field(iNx+2*pad,iNy+2*pad,iNz+2*pad, "mesh");
        mesh = new VecField(mesh_field);
	
        Field field_field(iNx+2*pad,iNy+2*pad,iNz+2*pad, "field");
	field = new Field(field_field);
	
	scalarfields = new Field* [scalar_fields.size()];
	for(int i = 0; i<scalar_fields.size() ; i++) {
        	Field field_field(iNx+2*pad,iNy+2*pad,iNz+2*pad, scalar_fields[i]);
	       	scalarfields[i] = new Field(field_field);	
	}       
	
	vectorfields = new VecField* [vector_fields.size()];
	for(int i = 0; i<vector_fields.size() ; i++) {
        	VecField vec_field(iNx+2*pad,iNy+2*pad,iNz+2*pad, vector_fields[i]);
	       	vectorfields[i] = new VecField(vec_field);	
	}       

	//dynamic allocation of domain masking - stored here because it is common for all fields. 
	flag = new Mask** [iNx+2*pad];
	for(int i=0;i<(iNx+2*pad);i++) {
		flag[i] = new Mask* [iNy+2*pad];
 		for(int j=0;j<(iNy+2*pad);j++) {
                  	flag[i][j] = new Mask [iNz+2*pad];
           	}
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, -0x30(%rbp)
movl 0xf943(%rip), %r14d     # 0x151e8
leaq -0xb0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
addl %r14d, %r14d
movl 0xfdb6(%rip), %r15d     # 0x15670
addl %r14d, %r15d
movl 0xfda8(%rip), %r12d     # 0x1566c
addl %r14d, %r12d
addl 0xfd9a(%rip), %r14d     # 0x15668
leaq 0xb91b(%rip), %rsi      # 0x111f0
leaq 0xb918(%rip), %rdx      # 0x111f4
leaq -0xc0(%rbp), %r13
movq %r13, %rdi
callq 0x2e92
leaq -0x230(%rbp), %rdi
movl %r14d, %esi
movl %r12d, %edx
movl %r15d, %ecx
movq %r13, %r8
callq 0x63ac
movq -0xc0(%rbp), %rdi
cmpq %rbx, %rdi
je 0x591e
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2210
movl $0x90, %edi
callq 0x2200
movq %rax, %r14
leaq -0x230(%rbp), %rsi
movq %rax, %rdi
callq 0x661e
movq -0x30(%rbp), %rax
movq %r14, (%rax)
movl 0xfd20(%rip), %r15d     # 0x15668
movl 0xf899(%rip), %r12d     # 0x151e8
movl 0xfd17(%rip), %ebx      # 0x1566c
movl 0xfd14(%rip), %r13d     # 0x15670
leaq -0x90(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0xb887(%rip), %rsi      # 0x111f5
leaq 0xb885(%rip), %rdx      # 0x111fa
leaq -0xa0(%rbp), %rdi
callq 0x2e92
leal (%r13,%r12,2), %ecx
leal (%rbx,%r12,2), %edx
leal (%r15,%r12,2), %esi
leaq -0x110(%rbp), %rdi
leaq -0xa0(%rbp), %r8
callq 0x697c
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x59bc
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2210
movl $0x50, %edi
callq 0x2200
movq %rax, %r14
leaq -0x110(%rbp), %rsi
movq %rax, %rdi
callq 0x6b38
movq -0x30(%rbp), %rax
movq %r14, 0x8(%rax)
movq 0xfc59(%rip), %rbx      # 0x15640
movq 0xfc4a(%rip), %r12      # 0x15638
movq %rbx, %rax
subq %r12, %rax
movq %rax, %rcx
sarq $0x2, %rcx
testq %rax, %rax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x2030
movq -0x30(%rbp), %rcx
movq %rax, 0x10(%rcx)
cmpq %r12, %rbx
je 0x5b00
movl $0x8, %ecx
xorl %ebx, %ebx
leaq -0x80(%rbp), %rdi
movq %rbx, -0x38(%rbp)
movl 0xfc33(%rip), %r15d     # 0x15668
movl 0xf7ad(%rip), %ebx      # 0x151e8
movl 0xfc2a(%rip), %r13d     # 0x1566c
movl 0xfc27(%rip), %r14d     # 0x15670
leaq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x8(%r12,%rcx), %rsi
movq %rcx, -0x40(%rbp)
movq (%r12,%rcx), %rdx
addq %rsi, %rdx
movq %rdi, %r12
callq 0x39ba
leal (%r14,%rbx,2), %ecx
leal (%r13,%rbx,2), %edx
leal (%r15,%rbx,2), %esi
leaq -0x1a0(%rbp), %r15
movq %r15, %rdi
movq %r12, %r14
movq %r12, %r8
callq 0x697c
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
movq -0x38(%rbp), %rbx
je 0x5aa8
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2210
movl $0x50, %edi
callq 0x2200
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x6b38
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %r12, (%rax,%rbx,8)
movq %r15, %rdi
callq 0x6caa
incq %rbx
movq 0xfb62(%rip), %rax      # 0x15640
movq 0xfb53(%rip), %r12      # 0x15638
subq %r12, %rax
sarq $0x5, %rax
movq -0x40(%rbp), %rcx
addq $0x20, %rcx
cmpq %rbx, %rax
movq %r14, %rdi
ja 0x5a2a
movq 0xfb51(%rip), %rbx      # 0x15658
movq 0xfb42(%rip), %r12      # 0x15650
movq %rbx, %rax
subq %r12, %rax
movq %rax, %rcx
sarq $0x2, %rcx
testq %rax, %rax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x2030
movq -0x30(%rbp), %rcx
movq %rax, 0x18(%rcx)
cmpq %r12, %rbx
je 0x5c20
movl $0x8, %ecx
xorl %ebx, %ebx
leaq -0x60(%rbp), %rdi
movq %rbx, -0x38(%rbp)
movl 0xfb13(%rip), %r15d     # 0x15668
movl 0xf68d(%rip), %ebx      # 0x151e8
movl 0xfb0a(%rip), %r13d     # 0x1566c
movl 0xfb07(%rip), %r14d     # 0x15670
leaq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%r12,%rcx), %rsi
movq %rcx, -0x40(%rbp)
movq (%r12,%rcx), %rdx
addq %rsi, %rdx
movq %rdi, %r12
callq 0x39ba
leal (%r14,%rbx,2), %ecx
leal (%r13,%rbx,2), %edx
leal (%r15,%rbx,2), %esi
leaq -0x1a0(%rbp), %r15
movq %r15, %rdi
movq %r12, %r14
movq %r12, %r8
callq 0x63ac
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
movq -0x38(%rbp), %rbx
je 0x5bc8
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2210
movl $0x90, %edi
callq 0x2200
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x661e
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %r12, (%rax,%rbx,8)
movq %r15, %rdi
callq 0x6870
incq %rbx
movq 0xfa5a(%rip), %rax      # 0x15658
movq 0xfa4b(%rip), %r12      # 0x15650
subq %r12, %rax
sarq $0x5, %rax
movq -0x40(%rbp), %rcx
addq $0x20, %rcx
cmpq %rbx, %rax
movq %r14, %rdi
ja 0x5b4a
movslq 0xfa41(%rip), %rax      # 0x15668
movslq 0xf5ba(%rip), %r15      # 0x151e8
leaq (%rax,%r15,2), %r14
movq %r14, %rax
shlq $0x3, %rax
testl %r14d, %r14d
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x2030
movq -0x30(%rbp), %rcx
movq %rax, 0x88(%rcx)
testl %r14d, %r14d
jle 0x5cf2
addq %r15, %r15
movslq 0xfa02(%rip), %rax      # 0x1566c
movslq %r15d, %rcx
addq %rcx, %rax
movq %rax, %rsi
shlq $0x3, %rsi
testl %eax, %eax
movq $-0x1, %rdx
cmovsq %rdx, %rsi
movq %rsi, -0x38(%rbp)
movslq 0xf9e1(%rip), %rsi      # 0x15670
addq %rcx, %rsi
movq %rsi, %r15
shlq $0x2, %r15
testl %esi, %esi
cmovsq %rdx, %r15
movl %r14d, %r12d
movl %eax, %r13d
xorl %r14d, %r14d
movq -0x38(%rbp), %rdi
callq 0x2030
movq -0x30(%rbp), %rcx
movq 0x88(%rcx), %rcx
movq %rax, (%rcx,%r14,8)
testl %r13d, %r13d
jle 0x5cea
xorl %ebx, %ebx
movq %r15, %rdi
callq 0x2030
movq -0x30(%rbp), %rcx
movq 0x88(%rcx), %rcx
movq (%rcx,%r14,8), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
cmpq %rbx, %r13
jne 0x5cc7
incq %r14
cmpq %r12, %r14
jne 0x5ca8
leaq -0x110(%rbp), %rdi
callq 0x6caa
leaq -0x230(%rbp), %rdi
callq 0x6870
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x50, %esi
movq %r14, %rdi
jmp 0x5def
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5e28
movq -0x90(%rbp), %rsi
incq %rsi
jmp 0x5d58
jmp 0x5d62
movq %rax, %rbx
movl $0x90, %esi
movq %r14, %rdi
callq 0x2210
jmp 0x5e28
movq %rax, %rbx
jmp 0x5e28
movq %rbx, %rcx
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
cmpq %rcx, %rdi
je 0x5e34
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x5e34
jmp 0x5e19
jmp 0x5e19
jmp 0x5e19
movq %rax, %rbx
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x5e1c
movq -0x50(%rbp), %rsi
jmp 0x5dec
movq %rax, %rbx
jmp 0x5dc8
movq %rax, %rbx
movl $0x90, %esi
movq %r12, %rdi
callq 0x2210
leaq -0x1a0(%rbp), %rdi
callq 0x6870
jmp 0x5e1c
jmp 0x5e19
movq %rax, %rbx
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x5e1c
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x5e1c
movq %rax, %rbx
jmp 0x5e0b
movq %rax, %rbx
movl $0x50, %esi
movq %r12, %rdi
callq 0x2210
leaq -0x1a0(%rbp), %rdi
callq 0x6caa
jmp 0x5e1c
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x6caa
leaq -0x230(%rbp), %rdi
callq 0x6870
movq %rbx, %rdi
callq 0x2350