// File: /workspace/github_cpp_makefile_star2_O1/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 0x186ca
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)
movq 0xc8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0xe8(%rsp,%rax)
jne 0x18641
leaq (%rsp,%rax), %rdi
addq $0xc8, %rdi
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 0x18620
movl $0x1, %ecx
movq %r14, %rdi
leaq 0x1aa29(%rip), %rsi     # 0x32d18
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 0x18620
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 0x1834d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movl $0x1, %ecx
movq %r14, %rdi
leaq 0x1c34b(%rip), %rsi     # 0x346a7
xorl %edx, %edx
callq 0x4420
movq %rax, %r15
movq %rax, %rdx
shlq $0x20, %rdx
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
cmpq %rax, %rdx
je 0x18620
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 0x183c3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movl $0x1, %ecx
movq %rbp, %rdi
leaq 0x1a6aa(%rip), %rsi     # 0x32a7c
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 0x18422
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movl $0x1, %ecx
movq %rbp, %rdi
leaq 0x1a64b(%rip), %rsi     # 0x32a7c
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 0x18485
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 0x184b7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movl $0x1, %ecx
movq %r14, %rdi
leaq 0x1a5b6(%rip), %rsi     # 0x32a7c
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 0x18516
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movl $0x1, %ecx
movq %r14, %rdi
leaq 0x1a557(%rip), %rsi     # 0x32a7c
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 0x1857e
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 0x1430e
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 0x1430e
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0x1885b
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x18604
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x18620
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 0x182bc
leaq 0xc8(%rsp), %rdi
callq 0x4080
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1866a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x1868f
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x186ab
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 0x2391f(%rip), %rdi     # 0x3bff0
leaq 0x1894a(%rip), %rsi     # 0x31022
movl $0x8, %edx
callq 0x4340
movq 0x23907(%rip), %rdi     # 0x3bff0
leaq 0x1a5eb(%rip), %rsi     # 0x32cdb
movl $0x18, %edx
callq 0x4340
movq 0x238ef(%rip), %rdi     # 0x3bff0
leaq 0x1912f(%rip), %rsi     # 0x31837
movl $0x1, %edx
callq 0x4340
movq 0x238d7(%rip), %rdi     # 0x3bff0
movl $0xa4, %esi
callq 0x4500
movq %rax, %r14
leaq 0x18914(%rip), %rsi     # 0x31041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x1a5b3(%rip), %rsi     # 0x32cf4
movl $0x16, %edx
movq %r14, %rdi
callq 0x4340
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x4340
movq %rax, %rbx
leaq 0x1a5a4(%rip), %rsi     # 0x32d0b
movl $0xc, %edx
movq %rax, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4170
xorl %edi, %edi
callq 0x4360
movq %rax, %rbx
jmp 0x18846
jmp 0x187e6
jmp 0x187e6
jmp 0x187e6
jmp 0x187e6
jmp 0x187e6
jmp 0x187e6
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x187c6
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x187c6
jmp 0x187e6
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x187e9
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x187e9
jmp 0x187e6
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x18805
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x1882a
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x18846
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0xc8(%rsp), %rdi
callq 0x40a0
movq %rbx, %rdi
callq 0x4540