// File: /workspace/github_cpp_makefile_star2_O1/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 0xbc24
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %edx
leaq -0x70(%rbp), %rsi
movq %r14, %rdi
callq 0x2370
leaq -0x70(%rbp), %rbx
cmpq $0x0, -0x68(%rbp)
jne 0xbc9b
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2370
jmp 0xbc70
leaq 0x5806(%rip), %rsi      # 0x114a8
leaq -0x70(%rbp), %rdi
callq 0x20a0
testl %eax, %eax
je 0xbdd3
movq %r15, %rdi
callq 0x2280
movq %r12, %rdi
callq 0x2280
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xbce5
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0xbd07
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0xbd29
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0xbd4b
movq -0x100(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xbd6d
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0xbd8f
movq -0x140(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xbda8
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xbdc1
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2200
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 0x2270
leaq 0x565c(%rip), %rsi      # 0x11442
leaq -0x50(%rbp), %rdi
callq 0x20a0
testl %eax, %eax
jne 0xc22a
movq 0x91f2(%rip), %rbx      # 0x14ff0
leaq 0x56c4(%rip), %rsi      # 0x114c9
movl $0x29, %edx
movq %rbx, %rdi
callq 0x2230
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq 0x91c0(%rip), %rdi      # 0x14ff0
callq 0x2040
movq %rax, %rdi
callq 0x2150
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r14,%rax)
jne 0xbcb3
movq %r14, %rdi
leaq -0x50(%rbp), %rsi
callq 0x2270
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xbe82
leaq -0x50(%rbp), %rdi
leaq 0x5607(%rip), %rsi      # 0x1147c
callq 0x20a0
testl %eax, %eax
je 0xbcb3
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x915f(%rip), %rdi      # 0x14ff0
callq 0x2230
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
cmpl $0x0, -0x2c(%rbp)
jle 0xbe3d
movl -0x2c(%rbp), %ebx
movq %r14, %rdi
leaq -0x30(%rbp), %rsi
callq 0x2130
movq %r14, %rdi
leaq -0x150(%rbp), %rsi
callq 0x2270
movq %rax, %rdi
leaq -0x130(%rbp), %rsi
callq 0x2270
movq %rax, %rdi
leaq -0x110(%rbp), %rsi
callq 0x2270
movq %rax, %rdi
leaq -0xf0(%rbp), %rsi
callq 0x2270
movq %rax, %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2270
movq %rax, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x2270
movq (%r12), %rsi
movq %r14, %rdi
callq 0x2140
movq (%r12), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2140
movq 0x8(%r12), %rsi
movq %rax, %rdi
callq 0x2140
movq 0x8(%r12), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2140
movq 0x10(%r12), %rsi
movq %rax, %rdi
callq 0x2140
movq 0x10(%r12), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2140
leaq -0x200(%rbp), %rax
movq %rax, -0x210(%rbp)
movq -0x150(%rbp), %rsi
movq -0x148(%rbp), %rdx
addq %rsi, %rdx
leaq -0x210(%rbp), %rdi
callq 0x391e
leaq -0x210(%rbp), %rdi
callq 0xaf21
movq (%r15), %rcx
movl %eax, (%rcx)
movq -0x210(%rbp), %rdi
leaq -0x200(%rbp), %rax
cmpq %rax, %rdi
je 0xbfe9
movq -0x200(%rbp), %rsi
incq %rsi
callq 0x2200
leaq -0x1e0(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1f0(%rbp), %rdi
callq 0x391e
leaq -0x1f0(%rbp), %rdi
callq 0xaf21
movq (%r15), %rcx
movl %eax, 0x4(%rcx)
movq -0x1f0(%rbp), %rdi
leaq -0x1e0(%rbp), %rax
cmpq %rax, %rdi
je 0xc048
movq -0x1e0(%rbp), %rsi
incq %rsi
callq 0x2200
leaq -0x1c0(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1d0(%rbp), %rdi
callq 0x391e
leaq -0x1d0(%rbp), %rdi
callq 0xaf21
movq 0x8(%r15), %rcx
movl %eax, (%rcx)
movq -0x1d0(%rbp), %rdi
leaq -0x1c0(%rbp), %rax
cmpq %rax, %rdi
je 0xc0a7
movq -0x1c0(%rbp), %rsi
incq %rsi
callq 0x2200
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1b0(%rbp), %rdi
callq 0x391e
leaq -0x1b0(%rbp), %rdi
callq 0xaf21
movq 0x8(%r15), %rcx
movl %eax, 0x4(%rcx)
movq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rax
cmpq %rax, %rdi
je 0xc107
movq -0x1a0(%rbp), %rsi
incq %rsi
callq 0x2200
leaq -0x180(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x190(%rbp), %rdi
callq 0x391e
leaq -0x190(%rbp), %rdi
callq 0xaf21
movq 0x10(%r15), %rcx
movl %eax, (%rcx)
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rax
cmpq %rax, %rdi
je 0xc166
movq -0x180(%rbp), %rsi
incq %rsi
callq 0x2200
leaq -0x160(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x170(%rbp), %rdi
callq 0x391e
leaq -0x170(%rbp), %rdi
callq 0xaf21
movq 0x10(%r15), %rcx
movl %eax, 0x4(%rcx)
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0xc1c6
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x2200
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 0x391e
movl %r13d, %edi
leaq -0x90(%rbp), %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x6cb8
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xc21d
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2200
decl %ebx
jne 0xbecd
jmp 0xbe3d
movq 0x8dbf(%rip), %rdi      # 0x14ff0
leaq 0x520c(%rip), %rsi      # 0x11444
movl $0x1b, %edx
callq 0x2230
movq 0x8da7(%rip), %rdi      # 0x14ff0
callq 0x2100
movl $0x1, %edi
callq 0x2250
jmp 0xc283
jmp 0xc283
jmp 0xc283
jmp 0xc283
jmp 0xc283
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xc286
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2200
jmp 0xc286
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xc2a8
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0xc2ca
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0xc2ec
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0xc30e
movq -0x100(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xc330
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0xc352
movq -0x140(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xc36b
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc384
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2340