// File: /workspace/github_cpp_makefile_star2_O2/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 $0x1f8, %rsp            # imm = 0x1F8
movl %esi, %ebx
movq %rdi, -0x30(%rbp)
leaq -0x68(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %eax, %eax
movb %al, (%rcx)
leaq -0x48(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
leaq -0x128(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %al, (%rcx)
movb %al, (%rdx)
leaq -0x108(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
leaq -0xe8(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %al, (%rcx)
movb %al, (%rdx)
leaq -0xc8(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
leaq -0xa8(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %al, (%rcx)
movb %al, (%rdx)
leaq -0x88(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
pushq $0x18
popq %rdi
callq 0x2030
movq %rax, %r14
pushq $0x18
popq %rdi
callq 0x2030
movq %rax, %r15
xorl %r13d, %r13d
pushq $0x10
popq %r12
cmpq $0x3, %r13
je 0xa6f7
pushq $0x8
popq %rdi
callq 0x2030
movq %rax, (%r14,%r13,8)
movq %r12, %rdi
callq 0x2030
movq %rax, (%r15,%r13,8)
incq %r13
jmp 0xa6d4
leaq -0x78(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2060
leaq -0x78(%rbp), %r12
cmpq $0x0, -0x70(%rbp)
jne 0xa71d
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0x2060
jmp 0xa708
leaq 0x4d92(%rip), %rsi      # 0xf4b6
leaq -0x78(%rbp), %rdi
callq 0xb6d5
testb %al, %al
je 0xa9fb
leaq -0x58(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2240
leaq 0x4d07(%rip), %rsi      # 0xf450
leaq -0x58(%rbp), %rdi
callq 0xb6e5
testb %al, %al
jne 0xaa77
movq 0x888f(%rip), %rdi      # 0x12ff0
leaq 0x4d6f(%rip), %rsi      # 0xf4d7
callq 0x21d0
movq %rax, %rdi
callq 0x2110
xorl %eax, %eax
testl %ebx, %ebx
cmovgl %ebx, %eax
movl %eax, -0x34(%rbp)
leaq -0x158(%rbp), %rbx
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rcx,%rax)
jne 0xa9fb
movq -0x30(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x2240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xa7cf
leaq -0x58(%rbp), %rdi
leaq 0x4cc8(%rip), %rsi      # 0xf48a
callq 0xb6d5
testb %al, %al
jne 0xa9fb
movq 0x881a(%rip), %rdi      # 0x12ff0
leaq -0x58(%rbp), %rsi
callq 0x21a0
movq %rax, %rdi
callq 0x2110
movl -0x34(%rbp), %r13d
subl $0x1, %r13d
jb 0xa786
movq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2140
movq -0x30(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0x118(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0xf8(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0xb8(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq -0x98(%rbp), %rsi
callq 0x2240
movq (%r15), %rsi
movq -0x30(%rbp), %rdi
callq 0x2150
movq (%r15), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
movq 0x8(%r15), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x8(%r15), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
movq 0x10(%r15), %rsi
movq %rax, %rdi
callq 0x2150
movq 0x10(%r15), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2150
leaq -0x218(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x2270
leaq -0x218(%rbp), %r12
movq %r12, %rdi
callq 0x9dee
movq (%r14), %rcx
movl %eax, (%rcx)
movq %r12, %rdi
callq 0x2100
leaq -0x1f8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x2270
leaq -0x1f8(%rbp), %r12
movq %r12, %rdi
callq 0x9dee
movq (%r14), %rcx
movl %eax, 0x4(%rcx)
movq %r12, %rdi
callq 0x2100
leaq -0x1d8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x2270
leaq -0x1d8(%rbp), %r12
movq %r12, %rdi
callq 0x9dee
movq 0x8(%r14), %rcx
movl %eax, (%rcx)
movq %r12, %rdi
callq 0x2100
leaq -0x1b8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2270
leaq -0x1b8(%rbp), %r12
movq %r12, %rdi
callq 0x9dee
movq 0x8(%r14), %rcx
movl %eax, 0x4(%rcx)
movq %r12, %rdi
callq 0x2100
leaq -0x198(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x2270
leaq -0x198(%rbp), %r12
movq %r12, %rdi
callq 0x9dee
movq 0x10(%r14), %rcx
movl %eax, (%rcx)
movq %r12, %rdi
callq 0x2100
leaq -0x178(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x2270
leaq -0x178(%rbp), %r12
movq %r12, %rdi
callq 0x9dee
movq 0x10(%r14), %rcx
movl %eax, 0x4(%rcx)
movq %r12, %rdi
callq 0x2100
movl -0x38(%rbp), %r12d
movq %rbx, %rdi
leaq -0x58(%rbp), %rsi
callq 0x2270
movl %r12d, %edi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x6624
movq %rbx, %rdi
callq 0x2100
jmp 0xa7eb
movq %r14, %rdi
callq 0x2250
movq %r15, %rdi
callq 0x2250
leaq -0x98(%rbp), %rdi
callq 0x2100
leaq -0xb8(%rbp), %rdi
callq 0x2100
leaq -0xd8(%rbp), %rdi
callq 0x2100
leaq -0xf8(%rbp), %rdi
callq 0x2100
leaq -0x118(%rbp), %rdi
callq 0x2100
leaq -0x138(%rbp), %rdi
callq 0x2100
leaq -0x58(%rbp), %rdi
callq 0x2100
leaq -0x78(%rbp), %rdi
callq 0x2100
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8572(%rip), %rdi      # 0x12ff0
leaq 0x49cd(%rip), %rsi      # 0xf452
callq 0x21d0
movq %rax, %rdi
callq 0x2110
pushq $0x1
popq %rdi
callq 0x2220
jmp 0xaab5
jmp 0xaab5
jmp 0xaab5
jmp 0xaab5
jmp 0xaab5
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x2100
jmp 0xaab8
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x2100
leaq -0xb8(%rbp), %rdi
callq 0x2100
leaq -0xd8(%rbp), %rdi
callq 0x2100
leaq -0xf8(%rbp), %rdi
callq 0x2100
leaq -0x118(%rbp), %rdi
callq 0x2100
leaq -0x138(%rbp), %rdi
callq 0x2100
leaq -0x58(%rbp), %rdi
callq 0x2100
leaq -0x78(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2320