// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/input.cpp
// Function: std::read_vector_field_Bc(std::basic_ifstream<char, std::char_traits<char>>&, int)
void read_vector_field_Bc(ifstream& file, int number) {

	int blocknumber;	
	string line, str;
	string eastbc, westbc, northbc, southbc, topbc, bottombc;
	
	myOctree::FieldBc **xbc;
	myOctree::FieldBc **ybc;
	myOctree::FieldBc **zbc;
	double **xbcval;
	double **ybcval;
	double **zbcval;
	xbc = new myOctree::FieldBc* [3];
	ybc = new myOctree::FieldBc* [3];
	zbc = new myOctree::FieldBc* [3];
	xbcval = new double* [3];
	ybcval = new double* [3];
	zbcval = new double* [3];
	for(int i = 0; i < 3; i++) {
     		xbc[i] = new myOctree::FieldBc [2];	
     		ybc[i] = new myOctree::FieldBc [2];	
     		zbc[i] = new myOctree::FieldBc [2];	
     		xbcval[i] = new double [2];	
     		ybcval[i] = new double [2];	
     		zbcval[i] = new double [2];	
	}

	myOctree::FieldBc east_bc, west_bc, north_bc, south_bc, top_bc, bottom_bc;
	double eastbcval, westbcval, northbcval, southbcval, topbcval, bottombcval;
	
	//Skips if a line is empty		
	getline(file, line);
	while(line.empty()) {
		getline(file, line);
	}

	if(line=="vector_field_boundary_conditions") {

		file >> str;
	        if(str != "{") {
	                cerr << "Expected an opening bracket" <<endl;
	                exit(1);
	        }
		
		cerr << "\nSetting vector field boundary conditions " << endl;

		while(file) { 
	
		
			if(file >> str && str == "}") break;
	                //else    myOctree::vector_fields.push_back(str);
			cerr << str << endl;	
			
			for(int i = 0; i < number ; ++i) {
		
				file >> blocknumber; 
			
			
				file >> eastbc >> westbc >> northbc >> southbc >> topbc >> bottombc;
				file >> xbcval[0][0] >> xbcval[0][1] >> xbcval[1][0] >> xbcval[1][1] >> xbcval[2][0] >> xbcval[2][1];
				
				xbc[myOctree::XDIR][myOctree::RIGHT] = string_to_FieldBc(eastbc);		
				xbc[myOctree::XDIR][myOctree::LEFT] = string_to_FieldBc(westbc);		
				xbc[myOctree::YDIR][myOctree::RIGHT] = string_to_FieldBc(northbc);		
				xbc[myOctree::YDIR][myOctree::LEFT] = string_to_FieldBc(southbc);		
				xbc[myOctree::ZDIR][myOctree::RIGHT] = string_to_FieldBc(topbc);		
				xbc[myOctree::ZDIR][myOctree::LEFT] = string_to_FieldBc(bottombc);		

				//cerr << blocknumber << eastbc << westbc << northbc << southbc << topbc << bottombc << endl;

				file >> eastbc >> westbc >> northbc >> southbc >> topbc >> bottombc;
				file >> ybcval[0][0] >> ybcval[0][1] >> ybcval[1][0] >> ybcval[1][1] >> ybcval[2][0] >> ybcval[2][1];
				
				ybc[myOctree::XDIR][myOctree::RIGHT] = string_to_FieldBc(eastbc);		
				ybc[myOctree::XDIR][myOctree::LEFT] = string_to_FieldBc(westbc);		
				ybc[myOctree::YDIR][myOctree::RIGHT] = string_to_FieldBc(northbc);		
				ybc[myOctree::YDIR][myOctree::LEFT] = string_to_FieldBc(southbc);		
				ybc[myOctree::ZDIR][myOctree::RIGHT] = string_to_FieldBc(topbc);		
				ybc[myOctree::ZDIR][myOctree::LEFT] = string_to_FieldBc(bottombc);		

				//cerr << blocknumber << eastbc << westbc << northbc << southbc << topbc << bottombc << endl;

				file >> eastbc >> westbc >> northbc >> southbc >> topbc >> bottombc;
				file >> zbcval[0][0] >> zbcval[0][1] >> zbcval[1][0] >> zbcval[1][1] >> zbcval[2][0] >> zbcval[2][1];
				
				zbc[myOctree::XDIR][myOctree::RIGHT] = string_to_FieldBc(eastbc);		
				zbc[myOctree::XDIR][myOctree::LEFT] = string_to_FieldBc(westbc);		
				zbc[myOctree::YDIR][myOctree::RIGHT] = string_to_FieldBc(northbc);		
				zbc[myOctree::YDIR][myOctree::LEFT] = string_to_FieldBc(southbc);		
				zbc[myOctree::ZDIR][myOctree::RIGHT] = string_to_FieldBc(topbc);		
				zbc[myOctree::ZDIR][myOctree::LEFT] = string_to_FieldBc(bottombc);		

				//cerr << blocknumber << eastbc << westbc << northbc << southbc << topbc << bottombc << endl;


				/*add a function here which sets boundary condition and boundary values*/
				myOctree::set_VecFieldBc_VecFieldBcVal(blocknumber, str, xbc, ybc, zbc, xbcval, ybcval, zbcval);
			}
		}	
	}

	delete 	[] xbc;
      	delete	[] ybc;
      	delete	[] zbc;
	delete 	[] xbcval;
	delete 	[] ybcval;
	delete 	[] zbcval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
movl %esi, %r12d
movq %rdi, -0x30(%rbp)
leaq -0x140(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %eax, %eax
movb %al, (%rcx)
leaq -0x120(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
leaq -0x100(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %al, (%rcx)
movb %al, (%rdx)
leaq -0xe0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
leaq -0xc0(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %al, (%rcx)
movb %al, (%rdx)
leaq -0xa0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
leaq -0x80(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %al, (%rcx)
movb %al, (%rdx)
leaq -0x60(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
pushq $0x18
popq %rdi
callq 0x2030
movq %rax, -0x48(%rbp)
pushq $0x18
popq %rdi
callq 0x2030
movq %rax, -0x40(%rbp)
pushq $0x18
popq %rdi
callq 0x2030
movq %rax, -0x38(%rbp)
pushq $0x18
popq %rdi
callq 0x2030
movq %rax, %r13
pushq $0x18
popq %rdi
callq 0x2030
movq %rax, %rbx
pushq $0x18
popq %rdi
callq 0x2030
movq %rax, %r14
xorl %r15d, %r15d
cmpq $0x18, %r15
je 0xac6a
pushq $0x8
popq %rdi
callq 0x2030
movq -0x48(%rbp), %rcx
movq %rax, (%rcx,%r15)
pushq $0x8
popq %rdi
callq 0x2030
movq -0x40(%rbp), %rcx
movq %rax, (%rcx,%r15)
pushq $0x8
popq %rdi
callq 0x2030
movq -0x38(%rbp), %rcx
movq %rax, (%rcx,%r15)
pushq $0x10
popq %rdi
callq 0x2030
movq %rax, (%r13,%r15)
pushq $0x10
popq %rdi
callq 0x2030
movq %rax, (%rbx,%r15)
pushq $0x10
popq %rdi
callq 0x2030
movq %rax, (%r14,%r15)
addq $0x8, %r15
jmp 0xac09
leaq -0x150(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2060
leaq -0x150(%rbp), %r15
cmpq $0x0, -0x148(%rbp)
jne 0xac99
movq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0x2060
jmp 0xac81
leaq 0x4861(%rip), %rsi      # 0xf501
leaq -0x150(%rbp), %rdi
callq 0xb6d5
testb %al, %al
je 0xb376
leaq -0x130(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2240
leaq 0x4785(%rip), %rsi      # 0xf450
leaq -0x130(%rbp), %rdi
callq 0xb6e5
testb %al, %al
jne 0xb418
movq 0x830a(%rip), %rdi      # 0x12ff0
leaq 0x4835(%rip), %rsi      # 0xf522
callq 0x21d0
movq %rax, %rdi
callq 0x2110
xorl %eax, %eax
testl %r12d, %r12d
cmovgl %r12d, %eax
movl %eax, -0x4c(%rbp)
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rcx,%rax)
jne 0xb376
movq -0x30(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x2240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xad55
leaq -0x130(%rbp), %rdi
leaq 0x4742(%rip), %rsi      # 0xf48a
callq 0xb6d5
testb %al, %al
jne 0xb376
movq 0x8294(%rip), %rdi      # 0x12ff0
leaq -0x130(%rbp), %rsi
callq 0x21a0
movq %rax, %rdi
callq 0x2110
movl -0x4c(%rbp), %r12d
subl $0x1, %r12d
jb 0xad06
movq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2140
movq -0x30(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0xf0(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0x90(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0x70(%rbp), %rsi
callq 0x2240
movq (%r13), %rsi
movq -0x30(%rbp), %rdi
callq 0x2150
movq (%r13), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
movq 0x8(%r13), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x8(%r13), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
movq 0x10(%r13), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x10(%r13), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
leaq -0x3b0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x2270
leaq -0x3b0(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x48(%rbp), %rcx
movq (%rcx), %rcx
movl %eax, (%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x390(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x2270
leaq -0x390(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x48(%rbp), %rcx
movq (%rcx), %rcx
movl %eax, 0x4(%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x370(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2270
leaq -0x370(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x48(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl %eax, (%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x350(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x2270
leaq -0x350(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x48(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl %eax, 0x4(%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x330(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x2270
leaq -0x330(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl %eax, (%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x310(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2270
leaq -0x310(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl %eax, 0x4(%rcx)
movq %r15, %rdi
callq 0x2100
movq -0x30(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0xf0(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0x90(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0x70(%rbp), %rsi
callq 0x2240
movq (%rbx), %rsi
movq -0x30(%rbp), %rdi
callq 0x2150
movq (%rbx), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x8(%rbx), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
movq 0x10(%rbx), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x10(%rbx), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
leaq -0x2f0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x2270
leaq -0x2f0(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x40(%rbp), %rcx
movq (%rcx), %rcx
movl %eax, (%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x2d0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x2270
leaq -0x2d0(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x40(%rbp), %rcx
movq (%rcx), %rcx
movl %eax, 0x4(%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x2b0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2270
leaq -0x2b0(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl %eax, (%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x290(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x2270
leaq -0x290(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl %eax, 0x4(%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x270(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x2270
leaq -0x270(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x40(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl %eax, (%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x250(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2270
leaq -0x250(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x40(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl %eax, 0x4(%rcx)
movq %r15, %rdi
callq 0x2100
movq -0x30(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0xf0(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0x90(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0x70(%rbp), %rsi
callq 0x2240
movq (%r14), %rsi
movq -0x30(%rbp), %rdi
callq 0x2150
movq (%r14), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
movq 0x8(%r14), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x8(%r14), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
movq 0x10(%r14), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x10(%r14), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
leaq -0x230(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x2270
leaq -0x230(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
movl %eax, (%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x210(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x2270
leaq -0x210(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
movl %eax, 0x4(%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x1f0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2270
leaq -0x1f0(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl %eax, (%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x1d0(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x2270
leaq -0x1d0(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl %eax, 0x4(%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x1b0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x2270
leaq -0x1b0(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl %eax, (%rcx)
movq %r15, %rdi
callq 0x2100
leaq -0x190(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2270
leaq -0x190(%rbp), %r15
movq %r15, %rdi
callq 0x9dee
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl %eax, 0x4(%rcx)
movq %r15, %rdi
callq 0x2100
movl -0x50(%rbp), %r15d
leaq -0x170(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x2270
movl %r15d, %edi
leaq -0x170(%rbp), %r15
movq %r15, %rsi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %r8
movq %r13, %r9
pushq %r14
pushq %rbx
callq 0x688b
popq %rax
popq %rcx
movq %r15, %rdi
callq 0x2100
jmp 0xad74
movq -0x48(%rbp), %rdi
callq 0x2250
movq -0x40(%rbp), %rdi
callq 0x2250
movq -0x38(%rbp), %rdi
callq 0x2250
movq %r13, %rdi
callq 0x2250
movq %rbx, %rdi
callq 0x2250
movq %r14, %rdi
callq 0x2250
leaq -0x70(%rbp), %rdi
callq 0x2100
leaq -0x90(%rbp), %rdi
callq 0x2100
leaq -0xb0(%rbp), %rdi
callq 0x2100
leaq -0xd0(%rbp), %rdi
callq 0x2100
leaq -0xf0(%rbp), %rdi
callq 0x2100
leaq -0x110(%rbp), %rdi
callq 0x2100
leaq -0x130(%rbp), %rdi
callq 0x2100
leaq -0x150(%rbp), %rdi
callq 0x2100
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7bd1(%rip), %rdi      # 0x12ff0
leaq 0x402c(%rip), %rsi      # 0xf452
callq 0x21d0
movq %rax, %rdi
callq 0x2110
pushq $0x1
popq %rdi
callq 0x2220
jmp 0xb456
jmp 0xb456
jmp 0xb456
jmp 0xb456
jmp 0xb456
movq %rax, %rbx
leaq -0x170(%rbp), %rdi
callq 0x2100
jmp 0xb459
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x2100
leaq -0x90(%rbp), %rdi
callq 0x2100
leaq -0xb0(%rbp), %rdi
callq 0x2100
leaq -0xd0(%rbp), %rdi
callq 0x2100
leaq -0xf0(%rbp), %rdi
callq 0x2100
leaq -0x110(%rbp), %rdi
callq 0x2100
leaq -0x130(%rbp), %rdi
callq 0x2100
leaq -0x150(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2320