// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/configuration.cpp
// Function: Configuration::valueForKey(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int Configuration::valueForKey(string key)
{
    int value = 0;
    vector<string> file = this->configFile;
    vector<string>::iterator it;
    for(it = file.begin();it < file.end();it++)
    {
        string fileKey;
        //check where's =
        string::size_type pos = (*it).find('=');
        //takes what's before =
        if (pos != string::npos)
        {
            fileKey =  (*it).substr(0, pos);
        }
        //trim eventual spaces
        fileKey.erase(remove(fileKey.begin(),fileKey.end(),' '),fileKey.end());
        //if key from file is equal to key inputted
        if(fileKey == key)
        {
            //take the value
            string extracted = (*it).substr((*it).find("=")+1);
            //trim eventual blank spaces
            extracted.erase(remove(extracted.begin(),extracted.end(),' '),extracted.end());
            //convert string to int
            value = stoi(extracted);
        }
    }
    
    return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r15
movq %rdi, %rsi
leaq -0xa0(%rbp), %rbx
movq %rbx, %rdi
callq 0x2b60
movq (%rbx), %r14
movq $0x0, -0x58(%rbp)
cmpq 0x8(%rbx), %r14
jae 0x2a0a
leaq -0x40(%rbp), %rbx
movq $0x0, -0x58(%rbp)
leaq -0x78(%rbp), %r12
movq %r15, -0x88(%rbp)
movq %rbx, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
movq %r14, %rdi
movl $0x3d, %esi
xorl %edx, %edx
callq 0x21f0
cmpq $-0x1, %rax
je 0x28b8
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x21b0
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x21e0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x28b8
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2190
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
addq %rdi, %rsi
movb $0x20, -0x78(%rbp)
movq %r12, %r13
movq %r12, %rdx
callq 0x2c41
movq %rax, %rcx
subq -0x50(%rbp), %rcx
movq %rcx, -0x48(%rbp)
movb $0x0, (%rax)
movq -0x50(%rbp), %r12
movq -0x48(%rbp), %rdx
cmpq 0x8(%r15), %rdx
jne 0x29e2
testq %rdx, %rdx
je 0x290a
movq (%r15), %rsi
movq %r12, %rdi
callq 0x21a0
testl %eax, %eax
jne 0x29e2
movl $0x1, %ecx
movq %r14, %rdi
leaq 0x270a(%rip), %rsi      # 0x5023
xorl %edx, %edx
callq 0x2290
leaq 0x1(%rax), %rdx
movq %r13, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x21b0
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
addq %rdi, %rsi
movb $0x20, -0x80(%rbp)
leaq -0x80(%rbp), %r15
movq %r15, %rdx
callq 0x2c41
movq %rax, %rcx
subq -0x78(%rbp), %rcx
movq %rcx, -0x70(%rbp)
movb $0x0, (%rax)
movq -0x78(%rbp), %rbx
callq 0x2040
movq %rax, %r12
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, (%r12)
movq %rbx, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x2210
cmpq %rbx, -0x80(%rbp)
je 0x2a29
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x2a35
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x2a35
movq %rax, -0x58(%rbp)
testl %ecx, %ecx
jne 0x29ba
movl -0x2c(%rbp), %eax
movl %eax, (%r12)
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x29d3
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2190
movq -0x50(%rbp), %r12
leaq -0x40(%rbp), %rbx
movq -0x88(%rbp), %r15
cmpq %rbx, %r12
je 0x29f6
movq -0x40(%rbp), %rsi
incq %rsi
movq %r12, %rdi
callq 0x2190
addq $0x20, %r14
cmpq -0x98(%rbp), %r14
movq %r13, %r12
jb 0x285e
leaq -0xa0(%rbp), %rdi
callq 0x2af2
movq -0x58(%rbp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x25f5(%rip), %rdi      # 0x5025
callq 0x20c0
leaq 0x25e9(%rip), %rdi      # 0x5025
callq 0x2220
movq %rax, %rbx
jmp 0x2a59
jmp 0x2a76
movq %rax, %rbx
cmpl $0x0, (%r12)
jne 0x2a59
movl -0x2c(%rbp), %eax
movl %eax, (%r12)
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x2a79
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2190
jmp 0x2a79
jmp 0x2a76
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x2a92
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2190
leaq -0xa0(%rbp), %rdi
callq 0x2af2
movq %rbx, %rdi
callq 0x22a0