// File: /workspace/github_cpp_makefile_star2_O1/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, %r12
movq %rdi, %rsi
leaq -0x98(%rbp), %r15
movq %r15, %rdi
callq 0x2b46
movq (%r15), %r14
movq $0x0, -0x70(%rbp)
cmpq 0x8(%r15), %r14
jae 0x29f7
leaq -0x58(%rbp), %rbx
leaq -0x38(%rbp), %r15
movq $0x0, -0x70(%rbp)
leaq -0x48(%rbp), %r13
movq %r12, -0x80(%rbp)
movq %rbx, -0x68(%rbp)
movq $0x0, -0x60(%rbp)
movb $0x0, -0x58(%rbp)
movq %r14, %rdi
movl $0x3d, %esi
xorl %edx, %edx
callq 0x21f0
cmpq $-0x1, %rax
je 0x28b5
movq %r13, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x21b0
leaq -0x68(%rbp), %rdi
movq %r13, %rsi
callq 0x21e0
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x28b5
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2190
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
addq %rdi, %rsi
movb $0x20, -0x48(%rbp)
movq %r13, %rdx
callq 0x2c27
movq %rax, %rcx
subq -0x68(%rbp), %rcx
movq %rcx, -0x60(%rbp)
movb $0x0, (%rax)
movq -0x60(%rbp), %rdx
cmpq 0x8(%r12), %rdx
jne 0x29d1
testq %rdx, %rdx
je 0x2903
movq -0x68(%rbp), %rdi
movq (%r12), %rsi
callq 0x21a0
testl %eax, %eax
jne 0x29d1
movl $0x1, %ecx
movq %r14, %rdi
leaq 0x2711(%rip), %rsi      # 0x5023
xorl %edx, %edx
callq 0x2290
leaq 0x1(%rax), %rdx
movq %r13, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x21b0
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq %rdi, %rsi
movb $0x20, -0x78(%rbp)
leaq -0x78(%rbp), %r13
movq %r13, %rdx
callq 0x2c27
movq %rax, %rcx
subq -0x48(%rbp), %rcx
movq %rcx, -0x40(%rbp)
movb $0x0, (%rax)
movq -0x48(%rbp), %rbx
callq 0x2040
movq %rax, %r12
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x2210
cmpq %rbx, -0x78(%rbp)
je 0x2a16
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x2a22
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x2a22
movq %rax, -0x70(%rbp)
testl %ecx, %ecx
jne 0x29ac
movl %r15d, (%r12)
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %r15
cmpq %r15, %rdi
je 0x29c5
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2190
leaq -0x58(%rbp), %rbx
movq -0x80(%rbp), %r12
leaq -0x48(%rbp), %r13
movq -0x68(%rbp), %rdi
cmpq %rbx, %rdi
je 0x29e6
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2190
addq $0x20, %r14
cmpq -0x90(%rbp), %r14
jb 0x285f
leaq -0x98(%rbp), %rdi
callq 0x2adc
movq -0x70(%rbp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2608(%rip), %rdi      # 0x5025
callq 0x20c0
leaq 0x25fc(%rip), %rdi      # 0x5025
callq 0x2220
movq %rax, %rbx
jmp 0x2a43
jmp 0x2a60
movq %rax, %rbx
cmpl $0x0, (%r12)
jne 0x2a43
movl %r15d, (%r12)
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2a63
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2190
jmp 0x2a63
jmp 0x2a60
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x2a7c
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2190
leaq -0x98(%rbp), %rdi
callq 0x2adc
movq %rbx, %rdi
callq 0x22a0