// File: /workspace/github_cpp_makefile_star2_O3/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
movq %r14, %rdi
movl $0x8, %edx
callq 0x43b0
movq (%r14), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0xe8(%rsp,%rax)
jne 0x17ed4
leaq (%rsp,%rax), %rdi
addq $0xc8, %rdi
leaq 0x58(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x98(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x18(%rsp), %r13
leaq 0xc8(%rsp), %rbx
leaq 0x48(%rsp), %r14
leaq 0x8(%rsp), %r12
leaq 0x28(%rsp), %rbp
movl $0xa, %esi
callq 0x42d0
movsbl %al, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4560
cmpq $0x0, 0x50(%rsp)
je 0x17e2a
movl $0x1, %ecx
movq %r14, %rdi
leaq 0x1a28f(%rip), %rsi     # 0x31d88
xorl %edx, %edx
callq 0x4420
movq %rax, %rcx
shlq $0x20, %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
sete %dl
testl %eax, %eax
sete %al
orb %dl, %al
jne 0x17e2a
sarq $0x20, %rcx
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4310
movq %r14, %rdi
movq %r12, %rsi
callq 0x4370
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x17b57
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movl $0x1, %ecx
movq %r14, %rdi
leaq 0x1bbc1(%rip), %rsi     # 0x33727
xorl %edx, %edx
callq 0x4420
movq %rax, %r15
movq %rax, %rdx
shlq $0x20, %rdx
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
cmpq %rax, %rdx
je 0x17e2a
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rdx
sarq $0x20, %rdx
movq 0x50(%rsp), %rcx
movq %r12, %rdi
movq %r14, %rsi
callq 0x4310
movq %rbp, %rdi
movq %r12, %rsi
callq 0x4370
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x17bcd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movl $0x1, %ecx
movq %rbp, %rdi
leaq 0x19f10(%rip), %rsi     # 0x31aec
movq $-0x1, %rdx
callq 0x4470
shlq $0x20, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
addq %rax, %rcx
sarq $0x20, %rcx
movq %r12, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x4310
movq %rbp, %rdi
movq %r12, %rsi
callq 0x4370
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x17c2c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movl $0x1, %ecx
movq %rbp, %rdi
leaq 0x19eb1(%rip), %rsi     # 0x31aec
movq $-0x1, %rdx
callq 0x4590
shlq $0x20, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq (%rax,%rcx), %rdx
sarq $0x20, %rdx
movq 0x30(%rsp), %rcx
movq %r12, %rdi
movq %rbp, %rsi
callq 0x4310
movq %rbp, %rdi
movq %r12, %rsi
callq 0x4370
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x17c8f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movslq %r15d, %rcx
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4310
movq %r14, %rdi
movq %r12, %rsi
callq 0x4370
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x17cc1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movl $0x1, %ecx
movq %r14, %rdi
leaq 0x19e1c(%rip), %rsi     # 0x31aec
movq $-0x1, %rdx
callq 0x4470
shlq $0x20, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
addq %rax, %rcx
sarq $0x20, %rcx
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4310
movq %r14, %rdi
movq %r12, %rsi
callq 0x4370
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x17d20
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movl $0x1, %ecx
movq %r14, %rdi
leaq 0x19dbd(%rip), %rsi     # 0x31aec
movq $-0x1, %rdx
callq 0x4590
shlq $0x20, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq (%rax,%rcx), %rdx
sarq $0x20, %rdx
movq 0x50(%rsp), %rcx
movq %r12, %rdi
movq %r14, %rsi
callq 0x4310
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
callq 0x4370
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x17d88
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x13ebc
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %r15
movq %r15, %rdi
callq 0x13ebc
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0x18065
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x17e0e
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x17e2a
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0xc8(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rdi
addq $0xc8, %rdi
testb $0x2, 0x20(%rdi)
je 0x17ac6
leaq 0xc8(%rsp), %rdi
callq 0x4080
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x17e74
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x17e99
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x17eb5
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4300
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 0x23115(%rip), %rdi     # 0x3aff0
leaq 0x18140(%rip), %rsi     # 0x30022
movl $0x8, %edx
callq 0x4340
movq 0x230fd(%rip), %rdi     # 0x3aff0
leaq 0x19e51(%rip), %rsi     # 0x31d4b
movl $0x18, %edx
callq 0x4340
movq 0x230e5(%rip), %rdi     # 0x3aff0
leaq 0x18985(%rip), %rsi     # 0x30897
movl $0x1, %edx
callq 0x4340
movq 0x230cd(%rip), %rdi     # 0x3aff0
movl $0xa4, %esi
callq 0x4500
movq %rax, %r14
leaq 0x1810a(%rip), %rsi     # 0x30041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x19e19(%rip), %rsi     # 0x31d64
movl $0x16, %edx
movq %r14, %rdi
callq 0x4340
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x4340
movq %rax, %rbx
leaq 0x19e0a(%rip), %rsi     # 0x31d7b
movl $0xc, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
xorl %edi, %edi
callq 0x4360
movq %rax, %rbx
jmp 0x18050
jmp 0x17ff0
jmp 0x17ff0
jmp 0x17ff0
jmp 0x17ff0
jmp 0x17ff0
jmp 0x17ff0
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x17fd0
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x17fd0
jmp 0x17ff0
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x17ff3
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x17ff3
jmp 0x17ff0
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1800f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x18034
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x18050
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0xc8(%rsp), %rdi
callq 0x40a0
movq %rbx, %rdi
callq 0x4540