// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, -0x58(%rbp)
movq %rcx, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
movq %rsi, -0x38(%rbp)
movl %edi, -0x2c(%rbp)
leaq 0xe273(%rip), %rax      # 0x15208
movq (%rax), %r15
cmpq %rax, %r15
je 0x7384
movq %r9, %rbx
movq 0x18(%rbp), %r13
movq 0x10(%rbp), %r14
movq 0x10(%r15), %rax
movl -0x2c(%rbp), %ecx
cmpl %ecx, 0x98(%rax)
jne 0x7374
movl $0x6, %edx
movq 0xe025(%rip), %r12      # 0x14ff0
movq %r12, %rdi
leaq 0xa226(%rip), %rsi      # 0x111fb
callq 0x2230
movq 0x10(%r15), %rax
movl 0x98(%rax), %esi
movq %r12, %rdi
callq 0x2330
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
leaq 0xe623(%rip), %rcx      # 0x15640
movq 0x8(%rcx), %rax
cmpq (%rcx), %rax
je 0x7374
xorl %r12d, %r12d
movq %r15, -0x60(%rbp)
movq 0x10(%r15), %rdi
callq 0x4064
movq 0x18(%rax), %rax
movq %r12, -0x68(%rbp)
movq (%rax,%r12,8), %r12
movq 0x30(%r12), %rdx
movq -0x38(%rbp), %rax
cmpq 0x8(%rax), %rdx
jne 0x734e
testq %rdx, %rdx
je 0x7077
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movq 0x28(%r12), %rdi
callq 0x2210
testl %eax, %eax
jne 0x734e
leaq 0x48(%r12), %rax
xorl %ecx, %ecx
movq -0x58(%rbp), %r10
movq -0x50(%rbp), %r11
movq -0x48(%rbp), %r15
movq (%r15,%rcx,8), %rdx
movq (%r11,%rcx,8), %rsi
movq (%r10,%rcx,8), %rdi
xorl %r8d, %r8d
movl (%rdx,%r8), %r9d
movl %r9d, (%rax,%r8)
movl (%rsi,%r8), %r9d
movl %r9d, 0x18(%rax,%r8)
movl (%rdi,%r8), %r9d
movl %r9d, 0x30(%rax,%r8)
addq $0x4, %r8
cmpq $0x4, %r8
je 0x7099
incq %rcx
addq $0x8, %rax
cmpq $0x3, %rcx
jne 0x708a
movslq (%r12), %rcx
movq %rcx, -0x40(%rbp)
testq %rcx, %rcx
jle 0x734e
movl 0x4(%r12), %ecx
xorl %edx, %edx
testl %ecx, %ecx
jle 0x7341
movl 0x8(%r12), %esi
leaq 0xe0ea(%rip), %rax      # 0x151e0
movslq (%rax), %rdi
movq -0x40(%rbp), %rax
leal (%rdi,%rax), %r8d
movslq %r8d, %r8
leal (%rcx,%rdi), %r10d
leal (%rsi,%rdi), %r9d
movslq %r9d, %r9
movslq %r10d, %r10
xorl %r11d, %r11d
testl %esi, %esi
jle 0x7335
xorl %r15d, %r15d
cmpq %rdi, %rdx
jge 0x7177
movq (%rbx), %rax
movsd 0x8(%rax), %xmm0
movq 0x10(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
movq (%r14), %rax
movsd 0x8(%rax), %xmm0
movq 0x18(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
movq (%r13), %rax
movsd 0x8(%rax), %xmm0
movq 0x20(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
cmpq %r8, %rdx
jl 0x71cb
movq (%rbx), %rax
movsd (%rax), %xmm0
movq 0x10(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
movq (%r14), %rax
movsd (%rax), %xmm0
movq 0x18(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
movq (%r13), %rax
movsd (%rax), %xmm0
movq 0x20(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
cmpq %rdi, %r11
jge 0x7224
movq 0x8(%rbx), %rax
movsd 0x8(%rax), %xmm0
movq 0x10(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
movq 0x8(%r14), %rax
movsd 0x8(%rax), %xmm0
movq 0x18(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
movq 0x8(%r13), %rax
movsd 0x8(%rax), %xmm0
movq 0x20(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
cmpq %r10, %r11
jl 0x727a
movq 0x8(%rbx), %rax
movsd (%rax), %xmm0
movq 0x10(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
movq 0x8(%r14), %rax
movsd (%rax), %xmm0
movq 0x18(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
movq 0x8(%r13), %rax
movsd (%rax), %xmm0
movq 0x20(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
cmpq %rdi, %r15
jge 0x72d3
movq 0x10(%rbx), %rax
movsd 0x8(%rax), %xmm0
movq 0x10(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
movq 0x10(%r14), %rax
movsd 0x8(%rax), %xmm0
movq 0x18(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
movq 0x10(%r13), %rax
movsd 0x8(%rax), %xmm0
movq 0x20(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
cmpq %r9, %r15
jl 0x7329
movq 0x10(%rbx), %rax
movsd (%rax), %xmm0
movq 0x10(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
movq 0x10(%r14), %rax
movsd (%rax), %xmm0
movq 0x18(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
movq 0x10(%r13), %rax
movsd (%rax), %xmm0
movq 0x20(%r12), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r11,8), %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
cmpq %r15, %rsi
jne 0x7120
incq %r11
cmpq %rcx, %r11
jne 0x7115
incq %rdx
cmpq -0x40(%rbp), %rdx
jne 0x70e2
movq -0x68(%rbp), %r12
incq %r12
leaq 0xe2e4(%rip), %rcx      # 0x15640
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x5, %rax
cmpq %r12, %rax
movq -0x60(%rbp), %r15
ja 0x7031
movq (%r15), %r15
cmpq 0xdc2a(%rip), %r15      # 0x14fa8
jne 0x6fac
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop