// File: suhasjains[P]AMR-Solver/src/block.cpp
// Function: myOctree::Block::set_domain_masking()
void Block::set_domain_masking() {

	//Domain masking
	for(int i=0;i<(this->iNx+2*pad);i++) {
 		for(int j=0;j<(this->iNy+2*pad);j++) {
 			for(int k=0;k<(this->iNz+2*pad);k++) {
		
				if(k<pad) {
					if(j<pad) {
						this->flag[i][j][k] = CORNER;
					}
					else if(j>=(this->iNy+pad)) {
						this->flag[i][j][k] = CORNER;
					}	
					if(i<pad) {
						this->flag[i][j][k] = CORNER;
					}
					else if(i>=(this->iNx+pad)) {
						this->flag[i][j][k] = CORNER;
					}
					if(i>=pad && i<(this->iNx+pad) && j>=pad && j<(this->iNy+pad)) {
						this->flag[i][j][k] = BOTTOM_GHOST;
					}	
				}
				else if(k>=(this->iNz+pad)) {
					if(j<pad) {
						this->flag[i][j][k] = CORNER;
					}
					else if(j>=(this->iNy+pad)) {
						this->flag[i][j][k] = CORNER;
					}	
					if(i<pad) {
						this->flag[i][j][k] = CORNER;
					}
					else if(i>=(this->iNx+pad)) {
						this->flag[i][j][k] = CORNER;
					}	
					if(i>=pad && i<(this->iNx+pad) && j>=pad && j<(this->iNy+pad)) {
						this->flag[i][j][k] = TOP_GHOST;
					}	
				}
				else if (k>=pad && k<(this->iNz+pad)) {
					if(i<pad) {
						if(j<pad) {
							this->flag[i][j][k] = CORNER;
						}
						else if(j>=(this->iNy+pad)) {
							this->flag[i][j][k] = CORNER;
						}
						else if(j>=pad && j<(this->iNy+pad)) {
							this->flag[i][j][k] = WEST_GHOST;	
						}	
					}
					else if(i>=(this->iNx+pad)) {
						if(j<pad) {
							this->flag[i][j][k] = CORNER;
						}
						else if(j>=(this->iNy+pad)) {
							this->flag[i][j][k] = CORNER;
						}
						else if(j>=pad && j<(this->iNy+pad)) {
							this->flag[i][j][k] = EAST_GHOST;	
						}	
					}
					else if(i>=pad && i<(this->iNx+pad)) {
						if(j<pad) {
							this->flag[i][j][k] = SOUTH_GHOST;	
						}
						else if(j>=(this->iNy+pad)) {
							this->flag[i][j][k] = NORTH_GHOST;	
						}	
						else if(j>=pad && j<(this->iNy+pad)) {
							this->flag[i][j][k] = DOMAIN;	
						}	
					}
				}	
			}
		}
	}	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl 0x1cb28(%rip), %ecx     # 0x266e8
movl 0x1c6a2(%rip), %edx     # 0x26268
shll %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0xa1a5
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl 0x1cb0a(%rip), %ecx     # 0x266ec
movl 0x1c680(%rip), %edx     # 0x26268
shll %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0xa195
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl 0x1caec(%rip), %ecx     # 0x266f0
movl 0x1c65e(%rip), %edx     # 0x26268
shll %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0xa185
movl -0x14(%rbp), %eax
cmpl 0x1c649(%rip), %eax     # 0x26268
jge 0x9d68
movl -0x10(%rbp), %eax
cmpl 0x1c63a(%rip), %eax     # 0x26268
jge 0x9c58
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x9c93
movl -0x10(%rbp), %eax
movl 0x1ca8b(%rip), %ecx     # 0x266ec
addl 0x1c601(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jl 0x9c91
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x9c93
movl -0xc(%rbp), %eax
cmpl 0x1c5cc(%rip), %eax     # 0x26268
jge 0x9cc6
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x9d01
movl -0xc(%rbp), %eax
movl 0x1ca19(%rip), %ecx     # 0x266e8
addl 0x1c593(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jl 0x9cff
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x9d01
movl -0xc(%rbp), %eax
cmpl 0x1c55e(%rip), %eax     # 0x26268
jl 0x9d63
movl -0xc(%rbp), %eax
movl 0x1c9d3(%rip), %ecx     # 0x266e8
addl 0x1c54d(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jge 0x9d63
movl -0x10(%rbp), %eax
cmpl 0x1c540(%rip), %eax     # 0x26268
jl 0x9d63
movl -0x10(%rbp), %eax
movl 0x1c9b9(%rip), %ecx     # 0x266ec
addl 0x1c52f(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jge 0x9d63
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x6, (%rax,%rcx,4)
jmp 0xa175
movl -0x14(%rbp), %eax
movl 0x1c97f(%rip), %ecx     # 0x266f0
addl 0x1c4f1(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jl 0x9ec2
movl -0x10(%rbp), %eax
cmpl 0x1c4e0(%rip), %eax     # 0x26268
jge 0x9db2
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x9ded
movl -0x10(%rbp), %eax
movl 0x1c931(%rip), %ecx     # 0x266ec
addl 0x1c4a7(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jl 0x9deb
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x9ded
movl -0xc(%rbp), %eax
cmpl 0x1c472(%rip), %eax     # 0x26268
jge 0x9e20
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x9e5b
movl -0xc(%rbp), %eax
movl 0x1c8bf(%rip), %ecx     # 0x266e8
addl 0x1c439(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jl 0x9e59
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x9e5b
movl -0xc(%rbp), %eax
cmpl 0x1c404(%rip), %eax     # 0x26268
jl 0x9ebd
movl -0xc(%rbp), %eax
movl 0x1c879(%rip), %ecx     # 0x266e8
addl 0x1c3f3(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jge 0x9ebd
movl -0x10(%rbp), %eax
cmpl 0x1c3e6(%rip), %eax     # 0x26268
jl 0x9ebd
movl -0x10(%rbp), %eax
movl 0x1c85f(%rip), %ecx     # 0x266ec
addl 0x1c3d5(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jge 0x9ebd
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x5, (%rax,%rcx,4)
jmp 0xa173
movl -0x14(%rbp), %eax
cmpl 0x1c39d(%rip), %eax     # 0x26268
jl 0xa171
movl -0x14(%rbp), %eax
movl 0x1c816(%rip), %ecx     # 0x266f0
addl 0x1c388(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jge 0xa171
movl -0xc(%rbp), %eax
cmpl 0x1c377(%rip), %eax     # 0x26268
jge 0x9fb5
movl -0x10(%rbp), %eax
cmpl 0x1c368(%rip), %eax     # 0x26268
jge 0x9f2d
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x9fb0
movl -0x10(%rbp), %eax
movl 0x1c7b6(%rip), %ecx     # 0x266ec
addl 0x1c32c(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jl 0x9f68
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x9fae
movl -0x10(%rbp), %eax
cmpl 0x1c2f7(%rip), %eax     # 0x26268
jl 0x9fac
movl -0x10(%rbp), %eax
movl 0x1c770(%rip), %ecx     # 0x266ec
addl 0x1c2e6(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jge 0x9fac
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x2, (%rax,%rcx,4)
jmp 0x9fae
jmp 0x9fb0
jmp 0xa16f
movl -0xc(%rbp), %eax
movl 0x1c72a(%rip), %ecx     # 0x266e8
addl 0x1c2a4(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jl 0xa08a
movl -0x10(%rbp), %eax
cmpl 0x1c293(%rip), %eax     # 0x26268
jge 0xa002
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0xa085
movl -0x10(%rbp), %eax
movl 0x1c6e1(%rip), %ecx     # 0x266ec
addl 0x1c257(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jl 0xa03d
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0xa083
movl -0x10(%rbp), %eax
cmpl 0x1c222(%rip), %eax     # 0x26268
jl 0xa081
movl -0x10(%rbp), %eax
movl 0x1c69b(%rip), %ecx     # 0x266ec
addl 0x1c211(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jge 0xa081
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0xa083
jmp 0xa085
jmp 0xa16d
movl -0xc(%rbp), %eax
cmpl 0x1c1d5(%rip), %eax     # 0x26268
jl 0xa16b
movl -0xc(%rbp), %eax
movl 0x1c646(%rip), %ecx     # 0x266e8
addl 0x1c1c0(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jge 0xa16b
movl -0x10(%rbp), %eax
cmpl 0x1c1af(%rip), %eax     # 0x26268
jge 0xa0e6
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x4, (%rax,%rcx,4)
jmp 0xa169
movl -0x10(%rbp), %eax
movl 0x1c5fd(%rip), %ecx     # 0x266ec
addl 0x1c173(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jl 0xa121
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x3, (%rax,%rcx,4)
jmp 0xa167
movl -0x10(%rbp), %eax
cmpl 0x1c13e(%rip), %eax     # 0x26268
jl 0xa165
movl -0x10(%rbp), %eax
movl 0x1c5b7(%rip), %ecx     # 0x266ec
addl 0x1c12d(%rip), %ecx     # 0x26268
cmpl %ecx, %eax
jge 0xa165
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x7, (%rax,%rcx,4)
jmp 0xa167
jmp 0xa169
jmp 0xa16b
jmp 0xa16d
jmp 0xa16f
jmp 0xa171
jmp 0xa173
jmp 0xa175
jmp 0xa177
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x9bfb
jmp 0xa187
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x9bd9
jmp 0xa197
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x9bb7
popq %rbp
retq
nopw (%rax,%rax)