// File: 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
subq $0x330, %rsp            # imm = 0x330
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x298(%rbp)
movl 0x1c518(%rip), %edx     # 0x266e8
movl 0x1c092(%rip), %eax     # 0x26268
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x28c(%rbp)
movl 0x1c503(%rip), %edx     # 0x266ec
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x288(%rbp)
movl 0x1c4f6(%rip), %edx     # 0x266f0
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x284(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0x3430
movq -0x280(%rbp), %rdx
leaq 0x16f98(%rip), %rsi     # 0x211be
leaq -0xb8(%rbp), %rdi
callq 0x4570
jmp 0xa234
movl -0x284(%rbp), %ecx
movl -0x288(%rbp), %edx
movl -0x28c(%rbp), %esi
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %r8
callq 0xb430
jmp 0xa25b
leaq -0xb8(%rbp), %rdi
callq 0x3180
leaq -0xb9(%rbp), %rdi
callq 0x3290
movl $0x90, %edi
callq 0x3250
movq %rax, -0x2a0(%rbp)
jmp 0xa286
movq -0x2a0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xbaf0
jmp 0xa29b
movq -0x298(%rbp), %rax
movq -0x2a0(%rbp), %rcx
movq %rcx, (%rax)
movl 0x1c436(%rip), %edx     # 0x266e8
movl 0x1bfb0(%rip), %eax     # 0x26268
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x2b4(%rbp)
movl 0x1c421(%rip), %edx     # 0x266ec
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x2b0(%rbp)
movl 0x1c414(%rip), %edx     # 0x266f0
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x2ac(%rbp)
leaq -0x141(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x3430
movq -0x2a8(%rbp), %rdx
leaq 0x16ebb(%rip), %rsi     # 0x211c3
leaq -0x140(%rbp), %rdi
callq 0x4570
jmp 0xa316
movl -0x2ac(%rbp), %ecx
movl -0x2b0(%rbp), %edx
movl -0x2b4(%rbp), %esi
leaq -0x120(%rbp), %rdi
leaq -0x140(%rbp), %r8
callq 0xc0a0
jmp 0xa33d
leaq -0x140(%rbp), %rdi
callq 0x3180
leaq -0x141(%rbp), %rdi
callq 0x3290
movl $0x50, %edi
callq 0x3250
movq %rax, -0x2c0(%rbp)
jmp 0xa368
movq -0x2c0(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0xc440
jmp 0xa37d
movq -0x298(%rbp), %rax
movq -0x2c0(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x1c322(%rip), %rdi     # 0x266b8
callq 0x5b00
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x2c8(%rbp)
jmp 0xa3bf
movq -0x298(%rbp), %rax
movq -0x2c8(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl $0x0, -0x148(%rbp)
movslq -0x148(%rbp), %rax
movq %rax, -0x2d0(%rbp)
leaq 0x1c2c8(%rip), %rdi     # 0x266b8
callq 0x5b00
movq %rax, %rcx
movq -0x2d0(%rbp), %rax
cmpq %rcx, %rax
jae 0xa66e
movl 0x1c2da(%rip), %edx     # 0x266e8
movl 0x1be54(%rip), %eax     # 0x26268
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x2dc(%rbp)
movl 0x1c2c5(%rip), %edx     # 0x266ec
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x2d8(%rbp)
movl 0x1c2b8(%rip), %edx     # 0x266f0
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x2d4(%rbp)
movslq -0x148(%rbp), %rsi
leaq 0x1c267(%rip), %rdi     # 0x266b8
callq 0x5b20
movq %rax, %rsi
leaq -0x1b8(%rbp), %rdi
callq 0x3120
jmp 0xa467
movl -0x2d4(%rbp), %ecx
movl -0x2d8(%rbp), %edx
movl -0x2dc(%rbp), %esi
leaq -0x198(%rbp), %rdi
leaq -0x1b8(%rbp), %r8
callq 0xc0a0
jmp 0xa48e
leaq -0x1b8(%rbp), %rdi
callq 0x3180
movl $0x50, %edi
callq 0x3250
movq %rax, -0x2e8(%rbp)
jmp 0xa4ad
movq -0x2e8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0xc440
jmp 0xa4c2
movq -0x2e8(%rbp), %rdx
movq -0x298(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x148(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
leaq -0x198(%rbp), %rdi
callq 0xc640
movl -0x148(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x148(%rbp)
jmp 0xa3db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0xa531
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x3180
leaq -0xb9(%rbp), %rdi
callq 0x3290
jmp 0xaa03
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0xa9f7
movq -0x2a0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
movl $0x90, %esi
callq 0x3260
jmp 0xa9f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0xa5b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x3180
leaq -0x141(%rbp), %rdi
callq 0x3290
jmp 0xa9f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0xa9eb
movq -0x2c0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
movl $0x50, %esi
callq 0x3260
jmp 0xa9eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x3180
jmp 0xa9eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0xa65d
movq -0x2e8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
movl $0x50, %esi
callq 0x3260
leaq -0x198(%rbp), %rdi
callq 0xc640
jmp 0xa9eb
leaq 0x1c05b(%rip), %rdi     # 0x266d0
callq 0x5b00
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x2f0(%rbp)
jmp 0xa69e
movq -0x298(%rbp), %rax
movq -0x2f0(%rbp), %rcx
movq %rcx, 0x18(%rax)
movl $0x0, -0x1bc(%rbp)
movslq -0x1bc(%rbp), %rax
movq %rax, -0x2f8(%rbp)
leaq 0x1c001(%rip), %rdi     # 0x266d0
callq 0x5b00
movq %rax, %rcx
movq -0x2f8(%rbp), %rax
cmpq %rcx, %rax
jae 0xa849
movl 0x1bffb(%rip), %edx     # 0x266e8
movl 0x1bb75(%rip), %eax     # 0x26268
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x304(%rbp)
movl 0x1bfe6(%rip), %edx     # 0x266ec
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x300(%rbp)
movl 0x1bfd9(%rip), %edx     # 0x266f0
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x2fc(%rbp)
movslq -0x1bc(%rbp), %rsi
leaq 0x1bfa0(%rip), %rdi     # 0x266d0
callq 0x5b20
movq %rax, %rsi
leaq -0x270(%rbp), %rdi
callq 0x3120
jmp 0xa746
movl -0x2fc(%rbp), %ecx
movl -0x300(%rbp), %edx
movl -0x304(%rbp), %esi
leaq -0x250(%rbp), %rdi
leaq -0x270(%rbp), %r8
callq 0xb430
jmp 0xa76d
leaq -0x270(%rbp), %rdi
callq 0x3180
movl $0x90, %edi
callq 0x3250
movq %rax, -0x310(%rbp)
jmp 0xa78c
movq -0x310(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0xbaf0
jmp 0xa7a1
movq -0x310(%rbp), %rdx
movq -0x298(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x1bc(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
leaq -0x250(%rbp), %rdi
callq 0xbef0
movl -0x1bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1bc(%rbp)
jmp 0xa6ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x3180
jmp 0xa9eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0xa838
movq -0x310(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
movl $0x90, %esi
callq 0x3260
leaq -0x250(%rbp), %rdi
callq 0xbef0
jmp 0xa9eb
movl 0x1be99(%rip), %edx     # 0x266e8
movl 0x1ba13(%rip), %eax     # 0x26268
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
cltq
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x318(%rbp)
jmp 0xa882
movq -0x298(%rbp), %rax
movq -0x318(%rbp), %rcx
movq %rcx, 0x88(%rax)
movl $0x0, -0x274(%rbp)
movl -0x274(%rbp), %eax
movl 0x1be3b(%rip), %ecx     # 0x266e8
movl 0x1b9b5(%rip), %edx     # 0x26268
shll %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0xa9ca
movl 0x1be27(%rip), %edx     # 0x266ec
movl 0x1b99d(%rip), %eax     # 0x26268
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
cltq
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x320(%rbp)
jmp 0xa8f8
movq -0x320(%rbp), %rdx
movq -0x298(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0x274(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x278(%rbp)
movl -0x278(%rbp), %eax
movl 0x1bdbe(%rip), %ecx     # 0x266ec
movl 0x1b934(%rip), %edx     # 0x26268
shll %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0xa9b4
movl 0x1bdae(%rip), %edx     # 0x266f0
movl 0x1b920(%rip), %eax     # 0x26268
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
cltq
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x328(%rbp)
jmp 0xa975
movq -0x328(%rbp), %rdx
movq -0x298(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0x274(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x278(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x278(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x278(%rbp)
jmp 0xa922
jmp 0xa9b6
movl -0x274(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x274(%rbp)
jmp 0xa8a1
leaq -0x120(%rbp), %rdi
callq 0xc640
leaq -0x98(%rbp), %rdi
callq 0xbef0
addq $0x330, %rsp            # imm = 0x330
popq %rbp
retq
leaq -0x120(%rbp), %rdi
callq 0xc640
leaq -0x98(%rbp), %rdi
callq 0xbef0
movq -0xc8(%rbp), %rdi
callq 0x3420
nop