// File: /workspace/github_cpp_makefile_star2_O3/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 0xc7aa
movq %rbp, %rdi
movq %r12, %rsi
callq 0x1b192
movl %eax, %ebp
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x6168
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x42a0
testb %bpl, %bpl
je 0x61dc
leaq 0x30f32(%rip), %rsi     # 0x370a6
movq %r13, %rdi
callq 0x40d0
testl %eax, %eax
je 0x63c9
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 0xc7aa
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0xa7ce
movq 0xb0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x63c9
movq 0xc0(%rsp), %rsi
jmp 0x63c1
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 0xc7aa
movq %r12, %rdi
movq %rbp, %rsi
callq 0x1b0dc
movl %eax, %ebp
movq 0x90(%rsp), %rdi
cmpq %r14, %rdi
je 0x6230
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x42a0
testb %bpl, %bpl
je 0x63c9
leaq 0x3237d(%rip), %rsi     # 0x385bd
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 0xbfbc
testb %al, %al
je 0x62ff
leaq 0x80(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xc7aa
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 0x63db
movl (%r12), %ecx
testl %ecx, %ecx
je 0x637a
cmpl $0x22, %ecx
jne 0x6381
leaq 0x30e28(%rip), %rdi     # 0x37122
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 0xc7aa
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0xc7aa
leaq 0x50(%rsp), %rdx
leaq 0x30(%rsp), %r9
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %rbx, %rcx
movq (%rsp), %r8
callq 0xb4a2
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x6373
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x50(%rsp), %rdi
jmp 0x639e
movl (%rsp), %ecx
movl %ecx, (%r12)
leaq 0x70(%rsp), %rdx
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %rbx, %rcx
movq %rax, %r9
callq 0xaf04
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x63ae
movq (%r14), %rsi
incq %rsi
callq 0x42a0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x63c9
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 0x30d40(%rip), %rdi     # 0x37122
callq 0x41a0
movq %rax, %rbx
jmp 0x642d
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x640b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x640b
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x6466
movq 0x60(%rsp), %rsi
jmp 0x643f
movq %rax, %rbx
cmpl $0x0, (%r12)
jne 0x642d
movl (%rsp), %eax
movl %eax, (%r12)
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x6466
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x6466
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x64b5
movq 0xc0(%rsp), %rsi
jmp 0x64ad
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64b5
movq 0x20(%rsp), %rsi
jmp 0x64ad
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r14, %rdi
je 0x64b5
movq 0xa0(%rsp), %rsi
jmp 0x64ad
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x64b5
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq %rbx, %rdi
callq 0x44c0
nop