// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl 0xe499(%rip), %ecx      # 0x13648
movslq 0xe01a(%rip), %rax      # 0x131d0
leal (%rax,%rax), %edx
movq %rdx, -0x30(%rbp)
leal (%rcx,%rax,2), %r9d
movl 0xe485(%rip), %edx      # 0x1364c
leal (%rdx,%rax,2), %esi
addl %eax, %edx
addl %eax, %ecx
movslq %edx, %r8
xorl %edx, %edx
testl %esi, %esi
cmovlel %edx, %esi
movslq %ecx, %r10
testl %r9d, %r9d
cmovlel %edx, %r9d
movq %r9, -0x38(%rbp)
xorl %r11d, %r11d
cmpq -0x38(%rbp), %r11
je 0x5354
movl 0xe457(%rip), %ecx      # 0x13650
movq -0x30(%rbp), %rdx
leal (%rcx,%rdx), %ebx
addl %eax, %ecx
movslq %ecx, %r14
testl %ebx, %ebx
movl $0x0, %ecx
cmovlel %ecx, %ebx
xorl %r15d, %r15d
cmpq %rsi, %r15
je 0x534c
cmpq %r10, %r11
setl %r12b
cmpq %rax, %r15
setge %cl
movq 0x88(%rdi), %r13
cmpq %r8, %r15
setl %r9b
andb %cl, %r9b
andb %r9b, %r12b
xorl %ecx, %ecx
cmpq %rcx, %rbx
je 0x5344
cmpq %rax, %rcx
jge 0x528c
testb %r9b, %r9b
jne 0x525e
movq (%r13,%r11,8), %rdx
movq (%rdx,%r15,8), %rdx
andl $0x0, (%rdx,%rcx,4)
cmpq %rax, %r11
jl 0x52c9
cmpq %r10, %r11
jl 0x5275
movq (%r13,%r11,8), %rdx
movq (%rdx,%r15,8), %rdx
andl $0x0, (%rdx,%rcx,4)
testb %r12b, %r12b
je 0x52d6
movq (%r13,%r11,8), %rdx
movq (%rdx,%r15,8), %rdx
movl $0x6, (%rdx,%rcx,4)
jmp 0x52d6
cmpq %r14, %rcx
jge 0x52b2
movq (%r13,%r11,8), %rdx
movq (%rdx,%r15,8), %rdx
cmpq %rax, %r11
jge 0x52de
cmpq %rax, %r15
jl 0x52d2
cmpq %r8, %r15
jge 0x52d2
movl $0x2, (%rdx,%rcx,4)
jmp 0x52d6
testb %r9b, %r9b
jne 0x52c4
movq (%r13,%r11,8), %rdx
movq (%rdx,%r15,8), %rdx
andl $0x0, (%rdx,%rcx,4)
cmpq %rax, %r11
jge 0x52f1
movq (%r13,%r11,8), %rdx
movq (%rdx,%r15,8), %rdx
andl $0x0, (%rdx,%rcx,4)
incq %rcx
jmp 0x523e
cmpq %r10, %r11
jge 0x531a
cmpq %rax, %r15
jge 0x532d
movl $0x4, (%rdx,%rcx,4)
jmp 0x52d6
cmpq %r10, %r11
jl 0x5303
movq (%r13,%r11,8), %rdx
movq (%rdx,%r15,8), %rdx
andl $0x0, (%rdx,%rcx,4)
testb %r12b, %r12b
je 0x52d6
movq (%r13,%r11,8), %rdx
movq (%rdx,%r15,8), %rdx
movl $0x5, (%rdx,%rcx,4)
jmp 0x52d6
cmpq %rax, %r15
jl 0x52d2
cmpq %r8, %r15
jge 0x52d2
movl $0x1, (%rdx,%rcx,4)
jmp 0x52d6
cmpq %r8, %r15
jge 0x533b
movl $0x7, (%rdx,%rcx,4)
jmp 0x52d6
movl $0x3, (%rdx,%rcx,4)
jmp 0x52d6
incq %r15
jmp 0x5212
incq %r11
jmp 0x51e9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop