// File: /workspace/github_cpp_makefile_star2_O2/ian-howell[P]configparser/src/config_parser.cpp
// Function: Config::Config(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Config::Config(std::string filename)
{
    std::ifstream fin(filename);

    if (fin.good())
    {
        std::string line;
        std::string current_header = "";
        while (std::getline(fin, line))
        {
            trim(line);

            // Skip empty lines
            if (line.size() == 0)
                continue;

            switch (line[0])
            {
                case '#':
                case ';':
                    // Ignore comments
                    break;
                case '[':
                    // Section header
                    current_header = read_header(line);
                    break;
                default:
                    // Everything else will be configurations
                    read_configuration(line, current_header);
            }
        }
        fin.close();
    }
    else
    {
        throw std::runtime_error("File `" + filename + "` does not exist");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
andl $0x0, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
leaq 0x60(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x2290
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x80(%rsp,%rax)
jne 0x25b7
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x1b47(%rip), %rsi      # 0x4030
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x2f28
leaq 0x60(%rsp), %r14
movq %rsp, %r15
leaq 0x40(%rsp), %r12
leaq 0x20(%rsp), %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x2070
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x257f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x267e
cmpq $0x0, 0x8(%rsp)
je 0x250a
movq (%rsp), %rax
movzbl (%rax), %eax
cmpl $0x23, %eax
je 0x250a
cmpl $0x3b, %eax
je 0x250a
cmpl $0x5b, %eax
jne 0x256f
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2690
movq %r13, %rdi
movq %r12, %rsi
callq 0x21f0
movq %r12, %rdi
callq 0x2100
jmp 0x250a
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x2792
jmp 0x250a
leaq 0x60(%rsp), %rdi
callq 0x2080
leaq 0x20(%rsp), %rdi
callq 0x2100
movq %rsp, %rdi
callq 0x2100
leaq 0x60(%rsp), %rdi
callq 0x20a0
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x2120
movq %rax, %r14
leaq 0x1a3b(%rip), %rsi      # 0x4004
leaq 0x20(%rsp), %rdi
movq %r15, %rdx
callq 0x2f82
leaq 0x1a2e(%rip), %rdx      # 0x400b
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x2f63
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x22a0
xorl %ebp, %ebp
movq 0x49ef(%rip), %rsi      # 0x6ff0
movq 0x49b0(%rip), %rdx      # 0x6fb8
movq %r14, %rdi
callq 0x22d0
movq %rax, %r15
movq %rsp, %rdi
callq 0x2100
jmp 0x2623
movq %rax, %r15
movb $0x1, %bpl
leaq 0x20(%rsp), %rdi
callq 0x2100
testb %bpl, %bpl
jne 0x2637
jmp 0x2664
movq %rax, %r15
movq %r14, %rdi
callq 0x2150
jmp 0x2664
jmp 0x264f
movq %rax, %r15
jmp 0x265c
movq %rax, %r15
jmp 0x266e
jmp 0x264f
movq %rax, %r15
leaq 0x20(%rsp), %rdi
callq 0x2100
movq %rsp, %rdi
callq 0x2100
leaq 0x60(%rsp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x313c
movq %r15, %rdi
callq 0x22e0