// File: /workspace/github_cpp_makefile_star2_O1/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 $0xf8, %rsp
movq %r8, (%rsp)
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, 0x8(%rsp)
movq %rdi, %r15
movb $0x0, 0x50(%rcx)
movq (%rdi), %rbp
leaq 0xe0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
leaq 0xd0(%rsp), %r12
movq %r12, %rdi
callq 0xca12
movq %rbp, %rdi
movq %r12, %rsi
callq 0x1b450
movl %eax, %ebp
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x6268
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x42a0
testb %bpl, %bpl
je 0x62dc
leaq 0x31e32(%rip), %rsi     # 0x380a6
movq %r13, %rdi
callq 0x40d0
testl %eax, %eax
je 0x64c9
leaq 0xc0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0xb0(%rsp), %r12
movq %r12, %rdi
callq 0xca12
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0xaa48
movq 0xb0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x64c9
movq 0xc0(%rsp), %rsi
jmp 0x64c1
movq (%r15), %r12
leaq 0xa0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rbp
movq %rbp, %rdi
callq 0xca12
movq %r12, %rdi
movq %rbp, %rsi
callq 0x1b39a
movl %eax, %ebp
movq 0x90(%rsp), %rdi
cmpq %r14, %rdi
je 0x6330
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x42a0
testb %bpl, %bpl
je 0x64c9
leaq 0x3327d(%rip), %rsi     # 0x395bd
movl $0x1, %ecx
movq %r13, %rdi
xorl %edx, %edx
callq 0x44a0
leaq 0x1(%rax), %rdx
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
movq $-0x1, %rcx
callq 0x42c0
movq %r12, %rdi
callq 0x4370
movq %r15, %rdi
movq %r12, %rsi
callq 0xc228
testb %al, %al
je 0x63ff
leaq 0x80(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xca12
movq 0x10(%rsp), %r13
callq 0x4050
movq %rax, %r12
movl (%rax), %eax
movl %eax, (%rsp)
movl $0x0, (%r12)
leaq 0xf0(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
movl $0xa, %edx
callq 0x43c0
cmpq %r13, (%rbp)
je 0x64db
movl (%r12), %ecx
testl %ecx, %ecx
je 0x647a
cmpl $0x22, %ecx
jne 0x6481
leaq 0x31d28(%rip), %rdi     # 0x38122
callq 0x43f0
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0xca12
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0xca12
leaq 0x50(%rsp), %rdx
leaq 0x30(%rsp), %r9
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %rbx, %rcx
movq (%rsp), %r8
callq 0xb710
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x6473
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x50(%rsp), %rdi
jmp 0x649e
movl (%rsp), %ecx
movl %ecx, (%r12)
leaq 0x70(%rsp), %rdx
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %rbx, %rcx
movq %rax, %r9
callq 0xb172
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x64ae
movq (%r14), %rsi
incq %rsi
callq 0x42a0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64c9
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42a0
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x31c40(%rip), %rdi     # 0x38122
callq 0x41a0
movq %rax, %rbx
jmp 0x652d
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x650b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x650b
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x6566
movq 0x60(%rsp), %rsi
jmp 0x653f
movq %rax, %rbx
cmpl $0x0, (%r12)
jne 0x652d
movl (%rsp), %eax
movl %eax, (%r12)
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x6566
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x6566
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x65b5
movq 0xc0(%rsp), %rsi
jmp 0x65ad
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x65b5
movq 0x20(%rsp), %rsi
jmp 0x65ad
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r14, %rdi
je 0x65b5
movq 0xa0(%rsp), %rsi
jmp 0x65ad
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x65b5
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq %rbx, %rdi
callq 0x44c0
nop