// File: /workspace/github_cpp_makefile_star2_O1/Merulo[P]CompilerJFTT/src/IRs/FourthIR.cpp
// Function: FourthIR::handleDirectTranslation(RegisterBlock&, Block&, Line&)
void FourthIR::handleDirectTranslation(RegisterBlock& rb, Block& b, Line& l)
{   
    Register& regOne = rb.getRegister(l.one, b, {}, true, true);
    updateRegisterState(b, rb, regOne, l.one);
    regOne.variableName = l.one;
    regOne.needToSafe = true;

    if (l.one == l.two && l.operation == "ADD")
    {
        b.lines.push_back({l.operation, regOne.name, regOne.name});
        return;
    }

    Register& regTwo = rb.getRegister(l.two, b, {regOne}, false, true);
    updateRegisterState(b, rb, regTwo, l.two);
    regTwo.variableName = l.two;

    b.lines.push_back({l.operation, regOne.name, regTwo.name});  

    if (_symbolTable->isConst(l.two) && _removeConsts)
    {
        regTwo.variableName = "";
        regTwo.state = RegisterState::UNKNOWN;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, 0x8(%rsp)
leaq 0x1a0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x20(%rcx), %rsi
movq 0x28(%rcx), %rdx
addq %rsi, %rdx
leaq 0x190(%rsp), %rbx
movq %rbx, %rdi
callq 0xca12
xorps %xmm0, %xmm0
leaq 0x130(%rsp), %rcx
movaps %xmm0, (%rcx)
movq $0x0, 0x10(%rcx)
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, 0x10(%rsp)
movq %r15, %rdx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x7d06
movq %rax, %r13
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0x26337
movq 0x140(%rsp), %rsi
subq %rdi, %rsi
callq 0x42a0
movq 0x190(%rsp), %rdi
cmpq %rbp, %rdi
je 0x26354
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x42a0
leaq 0x180(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
leaq 0x170(%rsp), %rbx
movq %rbx, %rdi
callq 0xca12
movq 0x8(%rsp), %rdi
movq %r13, %rcx
movq %rbx, %r8
callq 0x28ed2
leaq 0x20(%r14), %rbp
movq 0x170(%rsp), %rdi
cmpq %r15, %rdi
je 0x263ac
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x42a0
movq %r13, %rdi
addq $0x30, %rdi
movq %rbp, %rsi
callq 0x4170
movb $0x1, 0x50(%r13)
leaq 0x40(%r14), %rbx
movq 0x28(%r14), %rdx
cmpq 0x48(%r14), %rdx
jne 0x263fa
testq %rdx, %rdx
je 0x263e3
movq (%rbx), %rsi
movq (%rbp), %rdi
callq 0x42b0
testl %eax, %eax
jne 0x263fa
leaq 0x11cb8(%rip), %rsi     # 0x380a2
movq %r14, %rdi
callq 0x40d0
testl %eax, %eax
je 0x266e7
leaq 0xc0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x40(%r14), %rsi
movq 0x48(%r14), %rdx
addq %rsi, %rdx
leaq 0xb0(%rsp), %rdi
callq 0xca12
leaq 0x1b0(%rsp), %rsi
movq %r13, (%rsi)
leaq 0x38(%rsp), %rdi
leaq 0x7(%rsp), %rcx
movl $0x1, %edx
callq 0xc2ee
leaq 0xb0(%rsp), %rsi
leaq 0x38(%rsp), %rcx
movq %r12, %rdi
movq 0x10(%rsp), %rdx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x7d06
movq %rax, %r12
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2647a
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x42a0
movq 0xb0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x26497
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x42a0
leaq 0x160(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x40(%r14), %rsi
movq 0x48(%r14), %rdx
addq %rsi, %rdx
leaq 0x150(%rsp), %rbp
movq %rbp, %rdi
callq 0xca12
movq 0x8(%rsp), %rdi
movq %r12, %rcx
movq %rbp, %r8
callq 0x28ed2
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
je 0x264eb
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x42a0
movq %r12, %rbp
addq $0x30, %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x4170
leaq 0xa0(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xca12
leaq 0x80(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xca12
leaq 0x60(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x10(%r12), %rsi
movq 0x18(%r12), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0xca12
leaq 0x1b0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x70(%rsp), %rdx
leaq 0x50(%rsp), %rcx
callq 0xbe58
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
leaq 0x1b0(%rsp), %rsi
callq 0xcf0e
leaq 0x200(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x265b7
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x42a0
leaq 0x1e0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x265d8
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x42a0
leaq 0x1c0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x265f9
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0x26610
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x70(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2662a
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0x26647
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x8(%rsp), %rax
movq (%rax), %rbx
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x40(%r14), %rsi
movq 0x48(%r14), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0xca12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a9b6
testb %al, %al
je 0x266cf
movq 0x8(%rsp), %rax
movb 0xd0(%rax), %bl
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x266a1
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x42a0
testb %bl, %bl
je 0x26848
movq 0x38(%r12), %rdx
leaq 0x11a2e(%rip), %rcx     # 0x380e3
movq %rbp, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x4440
movl $0x0, (%r12)
jmp 0x26848
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x26848
movq 0x28(%rsp), %rsi
jmp 0x26840
leaq 0x120(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x110(%rsp), %rdi
callq 0xca12
leaq 0x100(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
addq %rsi, %rdx
leaq 0xf0(%rsp), %rdi
callq 0xca12
leaq 0xe0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
addq %rsi, %rdx
leaq 0xd0(%rsp), %rdi
callq 0xca12
leaq 0x1b0(%rsp), %rdi
leaq 0x110(%rsp), %rsi
leaq 0xf0(%rsp), %rdx
leaq 0xd0(%rsp), %rcx
callq 0xbe58
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
leaq 0x1b0(%rsp), %rsi
callq 0xcf0e
leaq 0x200(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x267af
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x42a0
leaq 0x1e0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x267d0
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x42a0
leaq 0x1c0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x267f1
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0xd0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2680e
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0xf0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2682b
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x110(%rsp), %rdi
cmpq %r12, %rdi
je 0x26848
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x42a0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x1b0(%rsp), %rdi
callq 0xbf10
jmp 0x2686f
movq %rax, %r14
movq 0xd0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x26891
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x26891
movq %rax, %r14
movq 0xf0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x268b3
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x268b3
movq %rax, %r14
movq 0x110(%rsp), %rdi
cmpq %r12, %rdi
je 0x26a08
movq 0x120(%rsp), %rsi
jmp 0x26a00
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x26a08
movq 0x28(%rsp), %rsi
jmp 0x26a00
movq %rax, %r14
leaq 0x1b0(%rsp), %rdi
callq 0xbf10
jmp 0x26901
movq %rax, %r14
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0x2691d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x2691d
movq %rax, %r14
movq 0x70(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2693c
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x2693c
movq %rax, %r14
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0x26a08
movq 0xa0(%rsp), %rsi
jmp 0x26a00
movq %rax, %r14
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
je 0x26a08
movq 0x160(%rsp), %rsi
jmp 0x26a00
movq %rax, %r14
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2699a
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x42a0
jmp 0x2699a
movq %rax, %r14
movq 0xb0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x26a08
movq 0xc0(%rsp), %rsi
jmp 0x26a00
movq %rax, %r14
movq 0x170(%rsp), %rdi
cmpq %r15, %rdi
je 0x26a08
movq 0x180(%rsp), %rsi
jmp 0x26a00
movq %rax, %r14
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0x269eb
movq 0x140(%rsp), %rsi
subq %rdi, %rsi
callq 0x42a0
movq 0x190(%rsp), %rdi
cmpq %rbp, %rdi
je 0x26a08
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq %r14, %rdi
callq 0x44c0