// File: gabryatfendor[P]SocietySimulator/src/configuration.cpp
// Function: Configuration::loadConfiguration(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<string> Configuration::loadConfiguration(string filename)
{
    vector<string> cfg;
    ifstream input(filename);
    if (!input.is_open())
    {
        cerr << "could not open " << filename << " for reading.\n";
        exit(1);
    }
    string line;
    while(getline(input, line))
    {
        if(line[0] != '#') //avoid commented lines
        {
            //trim out spaces
            line.erase(remove(line.begin(),line.end(),' '),line.end());
            //to lower
            transform(line.begin(), line.end(), line.begin(), ::tolower);
            cfg.push_back(line);
        }
    }

    return cfg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x330, %rsp            # imm = 0x330
movq %rdx, -0x2c0(%rbp)
movq %rdi, -0x2d0(%rbp)
movq %rdi, %rax
movq %rax, -0x2c8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x2fc0
movq -0x2c0(%rbp), %rsi
leaq -0x228(%rbp), %rdi
movl $0x8, %edx
callq 0x2380
jmp 0x28e2
leaq -0x228(%rbp), %rdi
callq 0x2370
movb %al, -0x2d1(%rbp)
jmp 0x28f6
movb -0x2d1(%rbp), %al
testb $0x1, %al
jne 0x298b
jmp 0x2906
movq 0xb6e3(%rip), %rdi      # 0xdff0
leaq 0x6700(%rip), %rsi      # 0x9014
callq 0x2220
movq %rax, -0x2e0(%rbp)
jmp 0x2922
movq -0x2c0(%rbp), %rsi
movq -0x2e0(%rbp), %rdi
callq 0x21f0
movq %rax, -0x2e8(%rbp)
jmp 0x293e
movq -0x2e8(%rbp), %rdi
leaq 0x66d8(%rip), %rsi      # 0x9024
callq 0x2220
jmp 0x2953
movl $0x1, %edi
callq 0x22c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
jmp 0x2be4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
jmp 0x2bba
leaq -0x258(%rbp), %rdi
callq 0x2320
leaq -0x228(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x2050
movq %rax, -0x2f0(%rbp)
jmp 0x29b3
movq -0x2f0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x22f0
movb %al, -0x2f1(%rbp)
jmp 0x29d1
movb -0x2f1(%rbp), %al
testb $0x1, %al
jne 0x29e0
jmp 0x2b96
xorl %eax, %eax
movl %eax, %esi
leaq -0x258(%rbp), %rdi
callq 0x2400
movq %rax, -0x300(%rbp)
jmp 0x29f9
movq -0x300(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
je 0x2b91
leaq -0x258(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0x21d0
movq -0x310(%rbp), %rdi
movq %rax, -0x270(%rbp)
callq 0x2110
movq %rax, -0x278(%rbp)
movb $0x20, -0x279(%rbp)
movq -0x270(%rbp), %rdi
movq -0x278(%rbp), %rsi
leaq -0x279(%rbp), %rdx
callq 0x2fe0
movq %rax, -0x308(%rbp)
jmp 0x2a63
movq -0x308(%rbp), %rax
movq %rax, -0x268(%rbp)
leaq -0x260(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x3030
leaq -0x258(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x2110
movq %rax, -0x290(%rbp)
leaq -0x288(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x3030
movq -0x320(%rbp), %rdi
movq -0x260(%rbp), %rsi
movq -0x288(%rbp), %rdx
callq 0x2060
movq %rax, -0x318(%rbp)
jmp 0x2ad4
movq -0x318(%rbp), %rax
movq %rax, -0x298(%rbp)
leaq -0x258(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x21d0
movq -0x330(%rbp), %rdi
movq %rax, -0x2a0(%rbp)
callq 0x2110
movq -0x330(%rbp), %rdi
movq %rax, -0x2a8(%rbp)
callq 0x21d0
movq %rax, -0x2b0(%rbp)
movq -0x2a0(%rbp), %rdi
movq -0x2a8(%rbp), %rsi
movq -0x2b0(%rbp), %rdx
movq 0xb492(%rip), %rcx      # 0xdfd0
callq 0x3070
movq %rax, -0x328(%rbp)
jmp 0x2b4c
movq -0x2d0(%rbp), %rdi
movq -0x328(%rbp), %rax
movq %rax, -0x2b8(%rbp)
leaq -0x258(%rbp), %rsi
callq 0x30f0
jmp 0x2b6f
jmp 0x2b91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x2140
jmp 0x2bba
jmp 0x2997
movb $0x1, -0x19(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x2140
leaq -0x228(%rbp), %rdi
callq 0x2070
testb $0x1, -0x19(%rbp)
jne 0x2bd4
jmp 0x2bc8
leaq -0x228(%rbp), %rdi
callq 0x2070
jmp 0x2be4
movq -0x2d0(%rbp), %rdi
callq 0x3160
movq -0x2c8(%rbp), %rax
addq $0x330, %rsp            # imm = 0x330
popq %rbp
retq
movq -0x2d0(%rbp), %rdi
callq 0x3160
movq -0x230(%rbp), %rdi
callq 0x23b0
nopl (%rax)