// File: /workspace/github_cpp_makefile_star2_O2/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 $0x58, %rsp
movq %r9, %rbx
movq %r8, -0x60(%rbp)
movq %rcx, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
movq %rsi, -0x38(%rbp)
leaq 0xc942(%rip), %rcx      # 0x131f8
movq 0x18(%rbp), %r13
movq 0x10(%rbp), %r14
movq %rcx, %r15
movl %edi, -0x2c(%rbp)
movq (%r15), %r15
cmpq %rcx, %r15
je 0x6c47
movq 0x10(%r15), %rax
cmpl %edi, 0x98(%rax)
jne 0x68c4
movq 0xc70d(%rip), %rdi      # 0x12ff0
leaq 0x8911(%rip), %rsi      # 0xf1fb
callq 0x21d0
movq 0x10(%r15), %rcx
movl 0x98(%rcx), %esi
movq %rax, %rdi
callq 0x2310
movq %rax, %rdi
callq 0x2110
xorl %edx, %edx
movq %r15, -0x40(%rbp)
leaq 0xcd1a(%rip), %rcx      # 0x13630
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x5, %rax
cmpq %rdx, %rax
jbe 0x6c38
movq 0x10(%r15), %rdi
movq %rdx, %r15
callq 0x3db0
movq 0x18(%rax), %rax
movq %r15, -0x48(%rbp)
movq (%rax,%r15,8), %r15
leaq 0x28(%r15), %rdi
movq -0x38(%rbp), %rsi
callq 0x6c56
testb %al, %al
je 0x6c28
leaq 0x78(%r15), %rax
xorl %ecx, %ecx
cmpq $0x3, %rcx
je 0x69ac
movq -0x50(%rbp), %rdx
movq (%rdx,%rcx,8), %rdx
movq -0x58(%rbp), %rsi
movq (%rsi,%rcx,8), %rsi
movq -0x60(%rbp), %rdi
movq (%rdi,%rcx,8), %rdi
xorl %r8d, %r8d
cmpq $0x2, %r8
je 0x69a3
movl (%rdx,%r8,4), %r9d
movl %r9d, -0x30(%rax,%r8,4)
movl (%rsi,%r8,4), %r9d
movl %r9d, -0x18(%rax,%r8,4)
movl (%rdi,%r8,4), %r9d
movl %r9d, (%rax,%r8,4)
incq %r8
jmp 0x697e
incq %rcx
addq $0x8, %rax
jmp 0x695d
movl (%r15), %ecx
testl %ecx, %ecx
movl $0x0, %edx
movq %rcx, -0x70(%rbp)
cmovgl %ecx, %edx
movq %rdx, -0x68(%rbp)
xorl %edx, %edx
cmpq -0x68(%rbp), %rdx
je 0x6c28
movl 0x4(%r15), %ecx
testl %ecx, %ecx
movl $0x0, %edi
movq %rcx, -0x78(%rbp)
cmovgl %ecx, %edi
xorl %r8d, %r8d
cmpq %rdi, %r8
je 0x6c20
movl 0x8(%r15), %r9d
leaq 0xc7da(%rip), %rax      # 0x131d0
movslq (%rax), %r10
movq -0x70(%rbp), %rax
addl %r10d, %eax
movslq %eax, %r11
movq -0x78(%rbp), %rax
addl %r10d, %eax
movslq %eax, %rcx
leal (%r10,%r9), %eax
movslq %eax, %r12
testl %r9d, %r9d
movl $0x0, %eax
cmovlel %eax, %r9d
xorl %eax, %eax
cmpq %rax, %r9
je 0x6c18
cmpq %r10, %rdx
jge 0x6a7c
movq (%rbx), %rsi
movsd 0x8(%rsi), %xmm0
movq 0x10(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
movq (%r14), %rsi
movsd 0x8(%rsi), %xmm0
movq 0x18(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
movq (%r13), %rsi
movsd 0x8(%rsi), %xmm0
movq 0x20(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
cmpq %r11, %rdx
jl 0x6aca
movq (%rbx), %rsi
movsd (%rsi), %xmm0
movq 0x10(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
movq (%r14), %rsi
movsd (%rsi), %xmm0
movq 0x18(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
movq (%r13), %rsi
movsd (%rsi), %xmm0
movq 0x20(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
cmpq %r10, %r8
jge 0x6b1d
movq 0x8(%rbx), %rsi
movsd 0x8(%rsi), %xmm0
movq 0x10(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
movq 0x8(%r14), %rsi
movsd 0x8(%rsi), %xmm0
movq 0x18(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
movq 0x8(%r13), %rsi
movsd 0x8(%rsi), %xmm0
movq 0x20(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
cmpq %rcx, %r8
jl 0x6b6d
movq 0x8(%rbx), %rsi
movsd (%rsi), %xmm0
movq 0x10(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
movq 0x8(%r14), %rsi
movsd (%rsi), %xmm0
movq 0x18(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
movq 0x8(%r13), %rsi
movsd (%rsi), %xmm0
movq 0x20(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
cmpq %r10, %rax
jge 0x6bc0
movq 0x10(%rbx), %rsi
movsd 0x8(%rsi), %xmm0
movq 0x10(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
movq 0x10(%r14), %rsi
movsd 0x8(%rsi), %xmm0
movq 0x18(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
movq 0x10(%r13), %rsi
movsd 0x8(%rsi), %xmm0
movq 0x20(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
cmpq %r12, %rax
jl 0x6c10
movq 0x10(%rbx), %rsi
movsd (%rsi), %xmm0
movq 0x10(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
movq 0x10(%r14), %rsi
movsd (%rsi), %xmm0
movq 0x18(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
movq 0x10(%r13), %rsi
movsd (%rsi), %xmm0
movq 0x20(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%r8,8), %rsi
movsd %xmm0, (%rsi,%rax,8)
incq %rax
jmp 0x6a22
incq %r8
jmp 0x69e2
incq %rdx
jmp 0x69c3
movq -0x48(%rbp), %rdx
incq %rdx
movq -0x40(%rbp), %r15
jmp 0x690f
movl -0x2c(%rbp), %edi
leaq 0xc5b6(%rip), %rcx      # 0x131f8
jmp 0x68c4
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq