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


	int blocknumber;	
	string line, str;
	string eastbc, westbc, northbc, southbc, topbc, bottombc;

		
	myOctree::FieldBc **bc;
	double **bcval;
	bc = new myOctree::FieldBc* [3];
	bcval = new double* [3];
	for(int i = 0; i < 3; i++) {
     		bc[i] = new myOctree::FieldBc [2];	
		bcval[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=="scalar_field_boundary_conditions") {

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

		while(file) { 
	
		
			if(file >> str && str == "}") break;
                        //else    myOctree::scalar_fields.push_back(str);
			cerr << str << endl;

			for(int i = 0; i < number ; ++i) {
		
				file >> blocknumber; 
				file >> eastbc >> westbc >> northbc >> southbc >> topbc >> bottombc;
				file >> bcval[0][0] >> bcval[0][1] >> bcval[1][0] >> bcval[1][1] >> bcval[2][0] >> bcval[2][1];
				
				bc[myOctree::XDIR][myOctree::RIGHT] = string_to_FieldBc(eastbc);		
				bc[myOctree::XDIR][myOctree::LEFT] = string_to_FieldBc(westbc);		
				bc[myOctree::YDIR][myOctree::RIGHT] = string_to_FieldBc(northbc);		
				bc[myOctree::YDIR][myOctree::LEFT] = string_to_FieldBc(southbc);		
				bc[myOctree::ZDIR][myOctree::RIGHT] = string_to_FieldBc(topbc);		
				bc[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_FieldBc_FieldBcVal(blocknumber, str, bc, bcval);
			}
		}	
	}

	delete [] bc;
	delete [] bcval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movl %esi, -0x2c(%rbp)
movq %rdi, %r14
leaq -0x60(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x40(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x140(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x120(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x100(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xe0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xc0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xa0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movl $0x18, %edi
callq 0x2030
movq %rax, %r15
movl $0x18, %edi
callq 0x2030
movq %rax, %r12
xorl %ebx, %ebx
movl $0x8, %edi
callq 0x2030
movq %rax, (%r15,%rbx,8)
movl $0x10, %edi
callq 0x2030
movq %rax, (%r12,%rbx,8)
incq %rbx
cmpq $0x3, %rbx
jne 0xbc28
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %edx
leaq -0x70(%rbp), %rsi
movq %r14, %rdi
callq 0x2380
leaq -0x70(%rbp), %rbx
cmpq $0x0, -0x68(%rbp)
jne 0xbc9f
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2380
jmp 0xbc74
leaq 0x5830(%rip), %rsi      # 0x114d6
leaq -0x70(%rbp), %rdi
callq 0x20a0
testl %eax, %eax
je 0xbdd7
movq %r15, %rdi
callq 0x2290
movq %r12, %rdi
callq 0x2290
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xbce9
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0xbd0b
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0xbd2d
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0xbd4f
movq -0x100(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xbd71
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0xbd93
movq -0x140(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xbdac
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xbdc5
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0x2280
leaq 0x5686(%rip), %rsi      # 0x11470
leaq -0x50(%rbp), %rdi
callq 0x20a0
testl %eax, %eax
jne 0xc22e
movq 0x91ee(%rip), %rbx      # 0x14ff0
leaq 0x56ee(%rip), %rsi      # 0x114f7
movl $0x29, %edx
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq 0x91bc(%rip), %rdi      # 0x14ff0
callq 0x2040
movq %rax, %rdi
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r14,%rax)
jne 0xbcb7
movq %r14, %rdi
leaq -0x50(%rbp), %rsi
callq 0x2280
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xbe86
leaq -0x50(%rbp), %rdi
leaq 0x5631(%rip), %rsi      # 0x114aa
callq 0x20a0
testl %eax, %eax
je 0xbcb7
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x915b(%rip), %rdi      # 0x14ff0
callq 0x2240
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
cmpl $0x0, -0x2c(%rbp)
jle 0xbe41
movl -0x2c(%rbp), %ebx
movq %r14, %rdi
leaq -0x30(%rbp), %rsi
callq 0x2140
movq %r14, %rdi
leaq -0x150(%rbp), %rsi
callq 0x2280
movq %rax, %rdi
leaq -0x130(%rbp), %rsi
callq 0x2280
movq %rax, %rdi
leaq -0x110(%rbp), %rsi
callq 0x2280
movq %rax, %rdi
leaq -0xf0(%rbp), %rsi
callq 0x2280
movq %rax, %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2280
movq %rax, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x2280
movq (%r12), %rsi
movq %r14, %rdi
callq 0x2150
movq (%r12), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
movq 0x8(%r12), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x8(%r12), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
movq 0x10(%r12), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x10(%r12), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
leaq -0x200(%rbp), %rax
movq %rax, -0x210(%rbp)
movq -0x150(%rbp), %rsi
movq -0x148(%rbp), %rdx
addq %rsi, %rdx
leaq -0x210(%rbp), %rdi
callq 0x39ba
leaq -0x210(%rbp), %rdi
callq 0xaf25
movq (%r15), %rcx
movl %eax, (%rcx)
movq -0x210(%rbp), %rdi
leaq -0x200(%rbp), %rax
cmpq %rax, %rdi
je 0xbfed
movq -0x200(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x1e0(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1f0(%rbp), %rdi
callq 0x39ba
leaq -0x1f0(%rbp), %rdi
callq 0xaf25
movq (%r15), %rcx
movl %eax, 0x4(%rcx)
movq -0x1f0(%rbp), %rdi
leaq -0x1e0(%rbp), %rax
cmpq %rax, %rdi
je 0xc04c
movq -0x1e0(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x1c0(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1d0(%rbp), %rdi
callq 0x39ba
leaq -0x1d0(%rbp), %rdi
callq 0xaf25
movq 0x8(%r15), %rcx
movl %eax, (%rcx)
movq -0x1d0(%rbp), %rdi
leaq -0x1c0(%rbp), %rax
cmpq %rax, %rdi
je 0xc0ab
movq -0x1c0(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1b0(%rbp), %rdi
callq 0x39ba
leaq -0x1b0(%rbp), %rdi
callq 0xaf25
movq 0x8(%r15), %rcx
movl %eax, 0x4(%rcx)
movq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rax
cmpq %rax, %rdi
je 0xc10b
movq -0x1a0(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x180(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x190(%rbp), %rdi
callq 0x39ba
leaq -0x190(%rbp), %rdi
callq 0xaf25
movq 0x10(%r15), %rcx
movl %eax, (%rcx)
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rax
cmpq %rax, %rdi
je 0xc16a
movq -0x180(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x160(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x170(%rbp), %rdi
callq 0x39ba
leaq -0x170(%rbp), %rdi
callq 0xaf25
movq 0x10(%r15), %rcx
movl %eax, 0x4(%rcx)
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0xc1ca
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x2210
movl -0x30(%rbp), %r13d
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x39ba
movl %r13d, %edi
leaq -0x90(%rbp), %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x6d48
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xc221
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2210
decl %ebx
jne 0xbed1
jmp 0xbe41
movq 0x8dbb(%rip), %rdi      # 0x14ff0
leaq 0x5236(%rip), %rsi      # 0x11472
movl $0x1b, %edx
callq 0x2240
movq 0x8da3(%rip), %rdi      # 0x14ff0
callq 0x2100
movl $0x1, %edi
callq 0x2260
jmp 0xc287
jmp 0xc287
jmp 0xc287
jmp 0xc287
jmp 0xc287
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xc28a
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0xc28a
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xc2ac
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0xc2ce
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0xc2f0
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0xc312
movq -0x100(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xc334
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0xc356
movq -0x140(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xc36f
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc388
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2350