// File: /workspace/github_cpp_makefile_star2_O2/estwings57[P]CasHMC/sources/ConfigReader.cpp
// Function: CasHMC::ReadIniFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void ReadIniFile(string file_name)
{
	fstream file_stream(file_name.c_str(), ios::in);
    if(!file_stream.good()) {
		ERROR("CasHMC could not open "<<file_name<<" for reading");
		exit(0);
	}
	
	string line, field_name, field_value;
	int commentIdx, equalsIdx, spaceIdx;
	unsigned int lineNumber=0;
	
	while(!file_stream.eof())
	{
		lineNumber++;
		getline(file_stream, line);
		//skip zero-length lines
		if(line.size() == 0) {
			//DEBUG("Skipping blank line "<<lineNumber);
			continue;
		}
		//search for a comment
		commentIdx = line.find_first_of(";");
		if(commentIdx != string::npos) {
			if(commentIdx == 0) {
				//DEBUG("Skipping comment line "<<lineNumber);
				continue;
			}
			line = line.substr(0, commentIdx);
		}
		else {
			continue;
		}
		//a line has to have an equals sign
		equalsIdx = line.find_first_of("=");
		if(equalsIdx == string::npos) {
			//DEBUG("Skipping comment line "<<lineNumber);
			continue;
		}

		//extract field value
		field_value = line.substr(equalsIdx+1, line.size());
		spaceIdx = field_value.find_last_not_of(" ");
		field_value = field_value.substr(0, spaceIdx+1);
		spaceIdx = field_value.find_last_of(" ");
		field_value = field_value.substr(spaceIdx+1, field_value.size());
		 
		//extract field name
		line = line.substr(0, equalsIdx);
		spaceIdx = line.find_last_not_of(" ");
		line = line.substr(0, spaceIdx+1);
		spaceIdx = line.find_last_of(" ");
		field_name = line.substr(spaceIdx+1, line.size());

		//cout<<"["<<lineNumber<<"] "<<field_name<<" : "<<field_value<<endl;
		SetField(field_name, field_value);
	}
    file_stream.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
movq %rdi, %rbx
movq (%rdi), %rsi
leaq 0xc8(%rsp), %r14
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x43d0
movq (%r14), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0xe8(%rsp,%rax)
jne 0x11c35
movabsq $-0x100000000, %r13     # imm = 0xFFFFFFFF00000000
leaq 0x18(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
leaq 0x58(%rsp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
xorl %esi, %esi
movb %sil, (%rcx)
movb %sil, (%rdx)
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %sil, (%rcx)
leaq 0xc8(%rsp), %r15
leaq 0x8(%rsp), %r14
leaq 0xa8(%rsp), %r12
leaq 0x88(%rsp), %rbp
testb $0x2, 0xe8(%rsp,%rax)
jne 0x11beb
movq %rbp, %rbx
movq %r15, %rdi
movq %r14, %rsi
callq 0x4090
cmpq $0x0, 0x10(%rsp)
movq %rbx, %rbp
je 0x11bda
movq %r14, %rdi
leaq 0x143c5(%rip), %rsi     # 0x25d69
xorl %edx, %edx
callq 0x4190
movq %rax, %rcx
shlq $0x20, %rcx
cmpq %r13, %rcx
sete %dl
testl %eax, %eax
sete %al
orb %dl, %al
jne 0x11bda
sarq $0x20, %rcx
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4330
movq %r14, %rdi
movq %r12, %rsi
callq 0x4380
movq %r12, %rdi
callq 0x4598
movq %r14, %rdi
leaq 0x15d24(%rip), %rsi     # 0x27717
xorl %edx, %edx
callq 0x4190
movq %rax, %rdx
shlq $0x20, %rdx
cmpq %r13, %rdx
je 0x11bda
movq %rax, (%rsp)
movabsq $0x100000000, %r15      # imm = 0x100000000
addq %r15, %rdx
sarq $0x20, %rdx
movq 0x10(%rsp), %rcx
movq %r12, %rdi
movq %r14, %rsi
callq 0x4330
movq %r12, %r13
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x4380
movq %r13, %rdi
callq 0x4598
movq %r12, %rdi
leaq 0x14000(%rip), %r14     # 0x25a54
movq %r14, %rsi
pushq $-0x1
popq %rbp
movq %rbp, %rdx
callq 0x4540
shlq $0x20, %rax
leaq (%rax,%r15), %rcx
sarq $0x20, %rcx
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x4330
movq %r12, %rdi
movq %r13, %rsi
callq 0x4380
movq %r13, %rdi
callq 0x4598
movq %r12, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x42d0
shlq $0x20, %rax
leaq (%rax,%r15), %rdx
sarq $0x20, %rdx
movq 0x30(%rsp), %rcx
movq %r13, %rdi
movq %r12, %rsi
callq 0x4330
movslq (%rsp), %r15
movq %r12, %rdi
movq %r13, %rsi
callq 0x4380
movq %r13, %rdi
callq 0x4598
movq %r13, %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0x4330
movq %r13, %r12
movq %r14, %rdi
movq %r13, %rsi
callq 0x4380
movq %r13, %rdi
callq 0x4598
movq %r14, %rdi
leaq 0x13f50(%rip), %rbp     # 0x25a54
movq %rbp, %rsi
pushq $-0x1
popq %r13
movq %r13, %rdx
callq 0x4540
shlq $0x20, %rax
movabsq $0x100000000, %r15      # imm = 0x100000000
leaq (%rax,%r15), %rcx
sarq $0x20, %rcx
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4330
movq %r14, %rdi
movq %r12, %rsi
callq 0x4380
movq %r12, %rdi
callq 0x4598
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x42d0
shlq $0x20, %rax
leaq (%rax,%r15), %rdx
sarq $0x20, %rdx
movq 0x10(%rsp), %rcx
movq %r12, %rdi
movq %r14, %rsi
callq 0x4330
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x4380
movq %r12, %rdi
callq 0x4598
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0x43e0
movabsq $-0x100000000, %r13     # imm = 0xFFFFFFFF00000000
leaq 0xc8(%rsp), %r15
movq %rbx, %rbp
movq %rbx, %rdi
leaq 0x28(%rsp), %rsi
callq 0x43e0
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x11d26
movq %rbp, %rdi
callq 0x4598
movq %rbx, %rdi
callq 0x4598
movq 0xc8(%rsp), %rax
movq -0x18(%rax), %rax
jmp 0x1196f
leaq 0xc8(%rsp), %rdi
callq 0x4070
leaq 0x28(%rsp), %rdi
callq 0x4598
leaq 0x48(%rsp), %rdi
callq 0x4598
leaq 0x8(%rsp), %rdi
callq 0x4598
leaq 0xc8(%rsp), %rdi
callq 0x40a0
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1f3b4(%rip), %rdi     # 0x30ff0
leaq 0x123df(%rip), %rsi     # 0x24022
callq 0x4300
leaq 0x140dd(%rip), %rsi     # 0x25d2c
movq %rax, %rdi
callq 0x4300
leaq 0x12c19(%rip), %rsi     # 0x24877
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
movl $0xa4, %esi
callq 0x44f0
leaq 0x123c7(%rip), %rsi     # 0x24041
movq %rax, %rdi
callq 0x4300
leaq 0x140bc(%rip), %rsi     # 0x25d45
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
movq %rbx, %rsi
callq 0x42b0
leaq 0x140b9(%rip), %rsi     # 0x25d5c
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
xorl %edi, %edi
callq 0x4370
movq %rax, %rbx
jmp 0x11d11
jmp 0x11cf0
jmp 0x11cf0
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x4598
jmp 0x11cd8
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x4598
jmp 0x11cf3
jmp 0x11cf0
jmp 0x11cf0
jmp 0x11cf0
jmp 0x11cf0
jmp 0x11cf0
jmp 0x11cf0
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4598
leaq 0x48(%rsp), %rdi
callq 0x4598
leaq 0x8(%rsp), %rdi
callq 0x4598
leaq 0xc8(%rsp), %rdi
callq 0x40a0
movq %rbx, %rdi
callq 0x4520