// File: /workspace/github_cpp_makefile_star2_O2/Manuel123cool[P]smiley/read_variable.cpp
// Function: Variable::testIfVariable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool Variable::testIfVariable(std::string code)
{
    if (code.length() <= 0)
        return false;

    bool isInString{ MyRegex::testString(code, ":) ") };
    if (!isInString) 
        return false;

    if (checkIfValueIsIdentifier(code))
    {
        std::string value{ getValue(code) };
        int count{ 0 };
        for (const auto &elem : m_variables)
        {
            if (value == elem.identifier)
            {
                TypeValue typeValue;

                typeValue.identifier = getIdentifier(code); 
                typeValue.value = m_variables.at(count).value; 
                typeValue.type = m_variables.at(count).type; 
                m_variables.push_back(typeValue); 
                return true;
            } 
            ++count;
        } 
    }

    std::string identifier{ getIdentifier(code) };
    std::string value{ getValue(code) };
    Types type{ getType(code) };

    for (int i{ 0 }; i < m_variables.size(); ++i)
    {
        if (m_variables.at(i).identifier == identifier)
        {
            m_variables.at(i).value = value; 
            m_variables.at(i).type = type;
            return true;
        }
    } 
    
    TypeValue typeValue;

    typeValue.identifier = identifier; 
    typeValue.value = value; 
    typeValue.type = type; 
    m_variables.push_back(typeValue);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
cmpq $0x0, 0x8(%rsi)
je 0x292a
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x108(%rsp), %rdi
callq 0x21e0
leaq 0x77ff(%rip), %rsi      # 0xa051
leaq 0xe8(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x57ec
leaq 0x108(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x5ddc
movl %eax, %ebp
leaq 0xe8(%rsp), %rdi
callq 0x20c0
leaq 0x108(%rsp), %rdi
callq 0x20c0
testb %bpl, %bpl
je 0x292a
leaq 0x128(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
movq %r14, %rsi
callq 0x2c06
movl %eax, %ebp
leaq 0x128(%rsp), %rdi
callq 0x20c0
testb %bpl, %bpl
je 0x2939
leaq 0x168(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
movq %rsp, %rdi
movq %r14, %rdx
callq 0x2ce0
leaq 0x168(%rsp), %rdi
callq 0x20c0
movq (%rbx), %r13
movq 0x8(%rbx), %rbp
xorl %r12d, %r12d
movq %rsp, %r14
cmpq %rbp, %r13
je 0x2931
addq $0x28, %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x27e7
testb %al, %al
jne 0x2a90
incq %r12
addq $0x20, %r13
jmp 0x2905
xorl %eax, %eax
jmp 0x2b47
movq %rsp, %rdi
callq 0x20c0
leaq 0x148(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x21e0
movq %rsp, %r14
movq %r14, %rdi
movq %r12, %rdx
callq 0x2de0
leaq 0x148(%rsp), %rdi
callq 0x20c0
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
callq 0x21e0
leaq 0x20(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
callq 0x2ce0
leaq 0xa8(%rsp), %rdi
callq 0x20c0
leaq 0x88(%rsp), %rdi
movq %r15, %rsi
callq 0x21e0
leaq 0x88(%rsp), %rsi
callq 0x2ece
movl %eax, %ebp
leaq 0x88(%rsp), %rdi
callq 0x20c0
pushq $-0x1
popq %r15
pushq $0x48
popq %r13
movq %rsp, %r12
incq %r15
movq 0x8(%rbx), %rax
subq (%rbx), %rax
cqto
idivq %r13
cmpq %r15, %rax
jbe 0x2a2a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5828
addq $0x28, %rax
movq %rax, %rdi
movq %r12, %rsi
callq 0x27e7
testb %al, %al
je 0x29cd
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5828
addq $0x8, %rax
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5828
movl %ebp, (%rax)
jmp 0x2a81
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
movq %rsp, %rsi
callq 0x20f0
leaq 0x48(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x20f0
leaq 0x40(%rsp), %rsi
movl %ebp, (%rsi)
movq %rbx, %rdi
callq 0x5846
leaq 0x40(%rsp), %rdi
callq 0x5872
leaq 0x20(%rsp), %rdi
callq 0x20c0
jmp 0x2b3d
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0xc8(%rsp), %rdi
movq %r15, %rsi
callq 0x21e0
leaq 0x20(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
callq 0x2de0
leaq 0x68(%rsp), %rdi
leaq 0x20(%rsp), %r15
movq %r15, %rsi
callq 0x21c0
movq %r15, %rdi
callq 0x20c0
leaq 0xc8(%rsp), %rdi
callq 0x20c0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5828
leaq 0x48(%rsp), %rdi
addq $0x8, %rax
movq %rax, %rsi
callq 0x20f0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5828
movl (%rax), %eax
leaq 0x40(%rsp), %rsi
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0x5846
leaq 0x40(%rsp), %rdi
callq 0x5872
movq %rsp, %rdi
callq 0x20c0
movb $0x1, %al
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x20c0
jmp 0x2ba0
jmp 0x2b9d
jmp 0x2b90
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x20c0
jmp 0x2bec
jmp 0x2be9
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
jmp 0x2bf1
movq %rax, %rbx
jmp 0x2bf6
movq %rax, %rbx
movq %r12, %r14
jmp 0x2bf6
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x5872
jmp 0x2bf6
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
jmp 0x2bf9
jmp 0x2be9
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x5872
jmp 0x2bec
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x20c0
jmp 0x2bdf
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
jmp 0x2bf9
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x2250