// File: ian-howell[P]configparser/src/config_parser.cpp
// Function: Config::read_configuration(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Config::read_configuration(const std::string& line, const std::string& header)
{
    if (header == "")
    {
        std::string error = "No section provided for: `" + line + "`";
        throw std::runtime_error(error);
    }

    if (line.find('=') == std::string::npos)
    {
        std::string error = "Invalid configuration: `" + line + "`";
        throw std::runtime_error(error);
    }

    std::istringstream iss(line);
    std::string key;
    std::string val;
    std::getline(iss, key, '=');

    if (key.size()== 0)
    {
        std::string error = "No key found in configuration: `" + line + "`";
        throw std::runtime_error(error);
    }

    std::getline(iss, val);

    sections[header][trim_copy(key)] = trim_copy(val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x380, %rsp            # imm = 0x380
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x330(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x5413(%rip), %rsi      # 0x9050
callq 0x5280
testb $0x1, %al
jne 0x3c4b
jmp 0x3d17
movq -0x10(%rbp), %rdx
leaq 0x541c(%rip), %rsi      # 0x9072
leaq -0x58(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x4e00
movq -0x338(%rbp), %rsi
leaq 0x5430(%rip), %rdx      # 0x90a4
leaq -0x38(%rbp), %rdi
callq 0x4db0
jmp 0x3c7f
leaq -0x58(%rbp), %rdi
callq 0x31a0
movl $0x10, %edi
callq 0x3150
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x340(%rbp)
leaq -0x38(%rbp), %rsi
callq 0x33d0
jmp 0x3caa
movq -0x340(%rbp), %rdi
movq 0xa338(%rip), %rsi      # 0xdff0
movq 0xa2f9(%rip), %rdx      # 0xdfb8
callq 0x3410
jmp 0x4115
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x31a0
jmp 0x410c
movq -0x340(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x31f0
jmp 0x3d09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x31a0
jmp 0x410c
movq -0x10(%rbp), %rdi
movl $0x3d, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x3340
cmpq $-0x1, %rax
jne 0x3e11
movq -0x10(%rbp), %rdx
leaq 0x534f(%rip), %rsi      # 0x908d
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0x4e00
movq -0x348(%rbp), %rsi
leaq 0x5345(%rip), %rdx      # 0x90a4
leaq -0x88(%rbp), %rdi
callq 0x4db0
jmp 0x3d6d
leaq -0xa8(%rbp), %rdi
callq 0x31a0
movl $0x10, %edi
callq 0x3150
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x350(%rbp)
leaq -0x88(%rbp), %rsi
callq 0x33d0
jmp 0x3d9e
movq -0x350(%rbp), %rdi
movq 0xa244(%rip), %rsi      # 0xdff0
movq 0xa205(%rip), %rdx      # 0xdfb8
callq 0x3410
jmp 0x4115
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x31a0
jmp 0x410c
movq -0x350(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x31f0
jmp 0x3e00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x31a0
jmp 0x410c
movq -0x10(%rbp), %rsi
leaq -0x228(%rbp), %rdi
movq %rdi, -0x360(%rbp)
movl $0x8, %edx
callq 0x33f0
leaq -0x248(%rbp), %rdi
movq %rdi, -0x358(%rbp)
callq 0x3350
leaq -0x268(%rbp), %rdi
callq 0x3350
movq -0x360(%rbp), %rdi
movq -0x358(%rbp), %rsi
movl $0x3d, %edx
callq 0x3470
jmp 0x3e66
leaq -0x248(%rbp), %rdi
callq 0x31d0
cmpq $0x0, %rax
jne 0x3f66
movq -0x10(%rbp), %rdx
leaq 0x521f(%rip), %rsi      # 0x90a6
leaq -0x2a8(%rbp), %rdi
callq 0x4e00
jmp 0x3e95
leaq 0x5208(%rip), %rdx      # 0x90a4
leaq -0x288(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x4db0
jmp 0x3eb1
leaq -0x2a8(%rbp), %rdi
callq 0x31a0
movl $0x10, %edi
callq 0x3150
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x368(%rbp)
leaq -0x288(%rbp), %rsi
callq 0x33d0
jmp 0x3ee2
movq -0x368(%rbp), %rdi
movq 0xa100(%rip), %rsi      # 0xdff0
movq 0xa0c1(%rip), %rdx      # 0xdfb8
callq 0x3410
jmp 0x4115
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x40e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x2a8(%rbp), %rdi
callq 0x31a0
jmp 0x40e8
movq -0x368(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x31f0
jmp 0x3f55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x31a0
jmp 0x40e8
leaq -0x228(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x3080
jmp 0x3f7b
leaq -0x2e8(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x3120
jmp 0x3f90
movq -0x330(%rbp), %rsi
leaq -0x2c8(%rbp), %rdi
leaq -0x2e8(%rbp), %rdx
callq 0x43f0
jmp 0x3fac
movq -0x330(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52b0
movq %rax, -0x370(%rbp)
jmp 0x3fc5
leaq -0x328(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x3120
jmp 0x3fda
movq -0x330(%rbp), %rsi
leaq -0x308(%rbp), %rdi
leaq -0x328(%rbp), %rdx
callq 0x43f0
jmp 0x3ff6
movq -0x370(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x5390
movq %rax, -0x378(%rbp)
jmp 0x4012
movq -0x378(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x3310
leaq -0x308(%rbp), %rdi
callq 0x31a0
leaq -0x328(%rbp), %rdi
callq 0x31a0
leaq -0x2c8(%rbp), %rdi
callq 0x31a0
leaq -0x2e8(%rbp), %rdi
callq 0x31a0
leaq -0x268(%rbp), %rdi
callq 0x31a0
leaq -0x248(%rbp), %rdi
callq 0x31a0
leaq -0x228(%rbp), %rdi
callq 0x3140
addq $0x380, %rsp            # imm = 0x380
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x40dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x40d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x40c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x308(%rbp), %rdi
callq 0x31a0
leaq -0x328(%rbp), %rdi
callq 0x31a0
leaq -0x2c8(%rbp), %rdi
callq 0x31a0
leaq -0x2e8(%rbp), %rdi
callq 0x31a0
leaq -0x268(%rbp), %rdi
callq 0x31a0
leaq -0x248(%rbp), %rdi
callq 0x31a0
leaq -0x228(%rbp), %rdi
callq 0x3140
movq -0x60(%rbp), %rdi
callq 0x3440
nopw %cs:(%rax,%rax)