// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0x0, 0x8(%rdi)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rcx, 0x28(%rdi)
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x2250
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x80(%rsp,%rax)
jne 0x25d5
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2b9f(%rip), %rdx      # 0x504c
leaq 0x20(%rsp), %rdi
movq %rdx, %rsi
callq 0x39e4
leaq 0x50(%rsp), %rbp
movq %rsp, %r15
leaq 0x40(%rsp), %r12
leaq 0x20(%rsp), %r13
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x22c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2578
movq %r15, %rsi
callq 0x312a
movq %r15, %rsi
callq 0x324e
cmpq $0x0, 0x8(%rsp)
je 0x24cc
movq (%rsp), %rax
movzbl (%rax), %eax
cmpl $0x23, %eax
je 0x24cc
cmpl $0x3b, %eax
je 0x24cc
cmpl $0x5b, %eax
jne 0x2565
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x273a
movq %r13, %rdi
movq %r12, %rsi
callq 0x21c0
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x24cc
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x24cc
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x28c4
jmp 0x24cc
leaq 0x60(%rsp), %rdi
callq 0x2070
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x259e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2170
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x25b9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
leaq 0x60(%rsp), %rdi
callq 0x2080
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20f0
movq %rax, %r14
leaq 0x2a37(%rip), %rsi      # 0x5020
leaq 0x20(%rsp), %rdi
movq %r15, %rdx
callq 0x33f7
leaq 0x2a2a(%rip), %rsi      # 0x5027
leaq 0x20(%rsp), %rdi
callq 0x22d0
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x262a
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x2636
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %r14, %rdi
callq 0x2260
xorl %ebp, %ebp
movq 0x598c(%rip), %rsi      # 0x7ff0
movq 0x594d(%rip), %rdx      # 0x7fb8
movq %r14, %rdi
callq 0x2290
movq %rax, %r15
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x2694
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x2694
movq %rax, %r15
movb $0x1, %bpl
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x26b7
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x26b7
movq %rax, %r15
movb $0x1, %bpl
testb %bpl, %bpl
je 0x270e
movq %r14, %rdi
callq 0x2120
jmp 0x270e
jmp 0x26d4
movq %rax, %r15
jmp 0x26f3
movq %rax, %r15
jmp 0x2718
jmp 0x26d4
movq %rax, %r15
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x26f3
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2170
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x270e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
leaq 0x60(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x35d8
movq %r15, %rdi
callq 0x22a0