// File: suhasjains[P]AMR-Solver/src/boundary.cpp
// Function: myOctree::set_VecFieldBc_VecFieldBcVal(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, myOctree::field_boundary_flags**, myOctree::field_boundary_flags**, myOctree::field_boundary_flags**, double**, double**, double**)
void set_VecFieldBc_VecFieldBcVal(int number, std::string name, FieldBc **xbc, FieldBc **ybc, FieldBc **zbc, double** xbcval, double** ybcval, double** zbcval ) {


	for (std::list<Octree*>::iterator it = nodes.begin(), end = nodes.end(); it != end; ++it) {	

	
		if((*it)->number==number) {

			std::cerr << "Block " <<  (*it)->number << std::endl;	


			for(int l = 0; l<vector_fields.size() ; l++) {	
		
				VecField *f = (*it)->get_block_data()->vectorfields[l];
	
				if( f->name == name ) {
			
					//std::cerr << "Setting BC to " << (*it)->get_block_data()->vectorfields[l]->name << std::endl;
					for (int i=0; i<3; i++) {
					      	for (int j=0; j<2; j++) {
							 f->xbc[i][j] = xbc[i][j];
							 f->ybc[i][j] = ybc[i][j];
							 f->zbc[i][j] = zbc[i][j];

							 //std::cerr << (*it)->get_block_data()->scalarfields[l]->bc[i][j];
						}
					}
					
					//Setting BC values
                                        for(int i=0; i<f->Nx; i++) {
                                                for(int j=0; j<f->Ny; j++) {
                                                        for(int k=0; k<f->Nz; k++) {
                                                                if(i<pad) {
								       f->x[i][j][k] = xbcval[XDIR][LEFT];
								       f->y[i][j][k] = ybcval[XDIR][LEFT];
								       f->z[i][j][k] = zbcval[XDIR][LEFT];
								}
								if(i>=(f->Nx + pad)) {
								    f->x[i][j][k] = xbcval[XDIR][RIGHT];
								    f->y[i][j][k] = ybcval[XDIR][RIGHT];
								    f->z[i][j][k] = zbcval[XDIR][RIGHT];
                                                                }
								if(j<pad) {
								       f->x[i][j][k] = xbcval[YDIR][LEFT];
								       f->y[i][j][k] = ybcval[YDIR][LEFT];
								       f->z[i][j][k] = zbcval[YDIR][LEFT];
                                                                }
								if(j>=(f->Ny + pad)) {
									f->x[i][j][k] = xbcval[YDIR][RIGHT];
									f->y[i][j][k] = ybcval[YDIR][RIGHT];
									f->z[i][j][k] = zbcval[YDIR][RIGHT];
                                                                }
								if(k<pad) {
								     	f->x[i][j][k] = xbcval[ZDIR][LEFT];
								     	f->y[i][j][k] = ybcval[ZDIR][LEFT];
								     	f->z[i][j][k] = zbcval[ZDIR][LEFT];
                                                                }
								if(k>=(f->Nz + pad)) {
									f->x[i][j][k] = xbcval[ZDIR][RIGHT];
									f->y[i][j][k] = ybcval[ZDIR][RIGHT];
									f->z[i][j][k] = zbcval[ZDIR][RIGHT];
								}
                                                        }
                                                }
                                        }
				}
			}		
		}
	}	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rsi, -0x70(%rbp)
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
leaq 0x197a3(%rip), %rdi     # 0x26298
callq 0x4490
movq %rax, -0x38(%rbp)
leaq 0x19793(%rip), %rdi     # 0x26298
callq 0x44c0
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x44f0
testb $0x1, %al
jne 0xcb24
jmp 0xd0f8
leaq -0x38(%rbp), %rdi
callq 0x4520
movq (%rax), %rax
movl 0x98(%rax), %eax
cmpl -0x4(%rbp), %eax
jne 0xd0e8
movq 0x194aa(%rip), %rdi     # 0x25ff0
leaq 0x1467c(%rip), %rsi     # 0x211c9
callq 0x3240
movq %rax, -0x78(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4520
movq -0x78(%rbp), %rdi
movq (%rax), %rax
movl 0x98(%rax), %esi
callq 0x3400
movq %rax, %rdi
movq 0x19445(%rip), %rsi     # 0x25fc0
callq 0x3270
movl $0x0, -0x44(%rbp)
movslq -0x44(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq 0x19b3a(%rip), %rdi     # 0x266d0
callq 0x5b00
movq %rax, %rcx
movq -0x80(%rbp), %rax
cmpq %rcx, %rax
jae 0xd0e6
leaq -0x38(%rbp), %rdi
callq 0x4520
movq (%rax), %rdi
callq 0x6de0
movq -0x70(%rbp), %rsi
movq 0x18(%rax), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
addq $0x28, %rdi
callq 0xd110
testb $0x1, %al
jne 0xcbe6
jmp 0xd0d6
movl $0x0, -0x54(%rbp)
cmpl $0x3, -0x54(%rbp)
jge 0xccad
movl $0x0, -0x58(%rbp)
cmpl $0x2, -0x58(%rbp)
jge 0xcc9d
movq -0x18(%rbp), %rax
movslq -0x54(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x58(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x50(%rbp), %rax
addq $0x48, %rax
movslq -0x54(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x58(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movslq -0x54(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x58(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x50(%rbp), %rax
addq $0x60, %rax
movslq -0x54(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x58(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x28(%rbp), %rax
movslq -0x54(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x58(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x50(%rbp), %rax
addq $0x78, %rax
movslq -0x54(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x58(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xcbfe
jmp 0xcc9f
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xcbed
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpl (%rcx), %eax
jge 0xd0d4
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0xd0c4
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0xd0b4
movl -0x5c(%rbp), %eax
leaq 0x1956d(%rip), %rcx     # 0x26268
cmpl (%rcx), %eax
jge 0xcd8a
movq -0x30(%rbp), %rax
movq (%rax), %rax
movsd 0x8(%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x10(%rbp), %rax
movq (%rax), %rax
movsd 0x8(%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x18(%rbp), %rax
movq (%rax), %rax
movsd 0x8(%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x5c(%rbp), %eax
movq -0x50(%rbp), %rcx
movl (%rcx), %ecx
leaq 0x194ce(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jl 0xce28
movq -0x30(%rbp), %rax
movq (%rax), %rax
movsd (%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x10(%rbp), %rax
movq (%rax), %rax
movsd (%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x18(%rbp), %rax
movq (%rax), %rax
movsd (%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x60(%rbp), %eax
leaq 0x19436(%rip), %rcx     # 0x26268
cmpl (%rcx), %eax
jge 0xcec4
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movsd 0x8(%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movsd 0x8(%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
movsd 0x8(%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x60(%rbp), %eax
movq -0x50(%rbp), %rcx
movl 0x4(%rcx), %ecx
leaq 0x19393(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jl 0xcf66
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movsd (%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movsd (%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
movsd (%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x64(%rbp), %eax
leaq 0x192f8(%rip), %rcx     # 0x26268
cmpl (%rcx), %eax
jge 0xd002
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0x8(%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0x8(%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0x8(%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x64(%rbp), %eax
movq -0x50(%rbp), %rcx
movl 0x8(%rcx), %ecx
leaq 0x19255(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jl 0xd0a4
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movsd (%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsd (%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movsd (%rax), %xmm0
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xd0a6
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0xcce1
jmp 0xd0b6
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0xccca
jmp 0xd0c6
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xccb4
jmp 0xd0d6
jmp 0xd0d8
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xcb87
jmp 0xd0e8
jmp 0xd0ea
leaq -0x38(%rbp), %rdi
callq 0x4550
jmp 0xcb0e
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)