// File: /workspace/github_cpp_makefile_star2_O2/Merulo[P]CompilerJFTT/src/Register/RegisterBlock.cpp
// Function: RegisterBlock::loadFromMemory(Block&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, Register&, Register&)
void RegisterBlock::loadFromMemory(Block& b, std::string name, Register& r, Register& freeRegister)
{
    r.needToSafe = false;
    if (_symbolTable->isItVariable(name))
    {
        if (name == "IF_CONTROL_VARIABLE")
        {
            return;
        }        
        loadVariableFromMemory(b, name, r, freeRegister);
    }
    else if (_symbolTable->isItTable(name))
    {
        std::string rest = name.substr(name.find("(") + 1, std::string::npos);
        rest.pop_back();
        if (isDigits(rest))
        {
            loadConstTableFromMemory(b, name, r, freeRegister, std::stoull(rest));
        }
        else
        {
            loadVarTableFromMemory(b, name, r, freeRegister, rest);
        }
    }   
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %r8, (%rsp)
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
movb $0x0, 0x50(%rcx)
movq (%rdi), %rbp
leaq 0xa8(%rsp), %r12
movq %r12, %rdi
movq %rdx, %rsi
callq 0x4390
movq %rbp, %rdi
movq %r12, %rsi
callq 0x10950
movl %eax, %ebp
leaq 0xa8(%rsp), %rdi
callq 0x4548
testb %bpl, %bpl
je 0x53b8
leaq 0x1dd2f(%rip), %rsi     # 0x230a6
movq %r13, %rdi
callq 0x8453
testb %al, %al
jne 0x54b9
leaq 0x88(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x4390
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x7502
leaq 0x88(%rsp), %rdi
jmp 0x54b4
movq (%r15), %r12
leaq 0x68(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x4390
movq %r12, %rdi
movq %rbp, %rsi
callq 0x108c4
movl %eax, %ebp
leaq 0x68(%rsp), %rdi
callq 0x4548
testb %bpl, %bpl
je 0x54b9
leaq 0x1f1cb(%rip), %rsi     # 0x245bd
movq %r13, %rdi
xorl %edx, %edx
callq 0x4520
leaq 0x1(%rax), %rdx
leaq 0x8(%rsp), %r12
pushq $-0x1
popq %rcx
movq %r12, %rdi
movq %r13, %rsi
callq 0x42a0
movq %r12, %rdi
callq 0x4330
movq %r15, %rdi
movq %r12, %rsi
callq 0x8460
testb %al, %al
je 0x5462
leaq 0xc8(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x4390
leaq 0x8(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x8476
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
movq %rax, %r9
callq 0x7906
jmp 0x54a7
leaq 0x48(%rsp), %rdi
movq %r13, %rsi
callq 0x4390
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x4390
leaq 0x48(%rsp), %rbp
leaq 0x28(%rsp), %r9
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
movq (%rsp), %r8
callq 0x7c3e
leaq 0x28(%rsp), %rdi
callq 0x4548
movq %rbp, %rdi
callq 0x4548
leaq 0x8(%rsp), %rdi
callq 0x4548
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4548
jmp 0x54dd
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x54ef
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x4548
jmp 0x5506
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
jmp 0x5522
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x5522
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0x5522
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x4548
movq %rbx, %rdi
callq 0x4490
nop