// File: /workspace/github_cpp_makefile_star2_O3/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 %r8, -0x68(%rbp)
movq %rcx, -0x60(%rbp)
movq %rdx, -0x58(%rbp)
movq %rsi, -0x40(%rbp)
movl %edi, -0x34(%rbp)
leaq 0xe1fb(%rip), %rax      # 0x15218
movq (%rax), %r15
cmpq %rax, %r15
je 0x743b
movq %r9, %rbx
movq 0x18(%rbp), %r13
movq 0x10(%rbp), %r14
movq 0x10(%r15), %rax
movl -0x34(%rbp), %ecx
cmpl %ecx, 0x98(%rax)
jne 0x742b
movl $0x6, %edx
movq 0xdf9d(%rip), %r12      # 0x14ff0
movq %r12, %rdi
leaq 0xa19e(%rip), %rsi      # 0x111fb
callq 0x2240
movq 0x10(%r15), %rax
movl 0x98(%rax), %esi
movq %r12, %rdi
callq 0x2340
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
leaq 0xe5ab(%rip), %rcx      # 0x15650
movq 0x8(%rcx), %rax
cmpq (%rcx), %rax
je 0x742b
xorl %r12d, %r12d
movq %r15, -0x48(%rbp)
movq 0x10(%r15), %rdi
callq 0x418c
movq 0x18(%rax), %rax
movq %r12, -0x50(%rbp)
movq (%rax,%r12,8), %r12
movq 0x30(%r12), %rdx
movq -0x40(%rbp), %rax
cmpq 0x8(%rax), %rdx
jne 0x7405
testq %rdx, %rdx
je 0x70ff
movq -0x40(%rbp), %rax
movq (%rax), %rsi
movq 0x28(%r12), %rdi
callq 0x2220
testl %eax, %eax
jne 0x7405
leaq 0x48(%r12), %rax
movq %rax, -0x30(%rbp)
leaq 0x60(%r12), %rax
movq %rax, -0x78(%rbp)
leaq 0x78(%r12), %rax
movq %rax, -0x70(%rbp)
xorl %esi, %esi
movq -0x58(%rbp), %rax
movq (%rax,%rsi,8), %rdi
movq -0x60(%rbp), %rax
movq (%rax,%rsi,8), %r8
movq -0x68(%rbp), %rax
movq (%rax,%rsi,8), %r9
movb $0x1, %r10b
movq -0x30(%rbp), %rax
leaq (%rax,%rsi,8), %r11
movq -0x78(%rbp), %rax
leaq (%rax,%rsi,8), %r15
movq -0x70(%rbp), %rax
leaq (%rax,%rsi,8), %rax
xorl %ecx, %ecx
movl (%rdi,%rcx,4), %edx
movl %edx, (%r11,%rcx,4)
movl (%r8,%rcx,4), %edx
movl %edx, (%r15,%rcx,4)
movl (%r9,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movl $0x1, %ecx
testb $0x1, %r10b
movl $0x0, %r10d
jne 0x7151
incq %rsi
cmpq $0x3, %rsi
jne 0x711c
movslq (%r12), %rcx
movq %rcx, -0x30(%rbp)
testq %rcx, %rcx
jle 0x7405
movl 0x4(%r12), %ecx
xorl %edx, %edx
testl %ecx, %ecx
jle 0x73f8
movl 0x8(%r12), %esi
leaq 0xe03b(%rip), %rax      # 0x151e8
movslq (%rax), %rdi
movq -0x30(%rbp), %rax
leal (%rdi,%rax), %r8d
movslq %r8d, %r8
leal (%rdi,%rcx), %r10d
leal (%rsi,%rdi), %r9d
movslq %r9d, %r9
movslq %r10d, %r10
xorl %r11d, %r11d
testl %esi, %esi
jle 0x73ec
xorl %r15d, %r15d
cmpq %rdi, %rdx
jge 0x722e
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 0x7282
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 0x72db
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 0x7331
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 0x738a
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 0x73e0
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 0x71d7
incq %r11
cmpq %rcx, %r11
jne 0x71cc
incq %rdx
cmpq -0x30(%rbp), %rdx
jne 0x7199
movq -0x50(%rbp), %r12
incq %r12
leaq 0xe23d(%rip), %rcx      # 0x15650
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x5, %rax
cmpq %r12, %rax
movq -0x48(%rbp), %r15
ja 0x70b9
movq (%r15), %r15
cmpq 0xdb73(%rip), %r15      # 0x14fa8
jne 0x7034
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop