// File: Merulo[P]CompilerJFTT/src/IRs/FourthIR.cpp
// Function: FourthIR::handleSimpleOperation(RegisterBlock&, Block&, Line&)
void FourthIR::handleSimpleOperation(RegisterBlock& rb, Block& b, Line& l)
{    
    Register& r = rb.getRegister(l.one, b, {}, true, true);
    if (l.operation == "DEC" || l.operation == "INC" || l.operation == "HALF")
    {
        r.needToSafe = true;
    }

    b.lines.push_back({l.operation, r.name, l.two});     

    updateRegisterState(b, rb, r, l.one);
    r.variableName = l.one;
}

// Assembly:
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rdi, 0x1b0(%rsp)
movq %rsi, 0x1a8(%rsp)
movq %rdx, 0x1a0(%rsp)
movq %rcx, 0x198(%rsp)
movq 0x1b0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x1a8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x198(%rsp), %rsi
addq $0x20, %rsi
leaq 0x170(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x4180
movq 0x1a0(%rsp), %rax
movq %rax, 0x40(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x150(%rsp)
movq $0x0, 0x160(%rsp)
leaq 0x150(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x391c0
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movl $0x1, %r9d
movl %r9d, %r8d
callq 0x7ac0
movq %rax, 0x50(%rsp)
jmp 0x34d4e
leaq 0x150(%rsp), %rdi
callq 0xd9c0
leaq 0x170(%rsp), %rdi
callq 0x46e8
movq 0x50(%rsp), %rax
movq %rax, 0x190(%rsp)
movq 0x198(%rsp), %rdi
leaq 0x1c34e(%rip), %rsi     # 0x510d2
callq 0xdd10
testb $0x1, %al
jne 0x34dbf
movq 0x198(%rsp), %rdi
leaq 0x1c33a(%rip), %rsi     # 0x510d6
callq 0xdd10
testb $0x1, %al
jne 0x34dbf
movq 0x198(%rsp), %rdi
leaq 0x1c40b(%rip), %rsi     # 0x511bf
callq 0xdd10
testb $0x1, %al
jne 0x34dbf
jmp 0x34e00
movq 0x190(%rsp), %rax
movb $0x1, 0x50(%rax)
jmp 0x34e00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x148(%rsp)
movl %eax, 0x144(%rsp)
leaq 0x150(%rsp), %rdi
callq 0xd9c0
leaq 0x170(%rsp), %rdi
callq 0x46e8
jmp 0x34ff8
movq 0x1a0(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x20(%rsp)
movq 0x198(%rsp), %rsi
leaq 0xb8(%rsp), %rdi
callq 0x4180
movq 0x190(%rsp), %rsi
addq $0x10, %rsi
leaq 0x98(%rsp), %rdi
callq 0x4180
jmp 0x34e41
movq 0x198(%rsp), %rsi
addq $0x40, %rsi
leaq 0x78(%rsp), %rdi
callq 0x4180
jmp 0x34e59
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x98(%rsp), %rdx
leaq 0x78(%rsp), %rcx
callq 0xd3b0
jmp 0x34e7d
movq 0x20(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0xd380
jmp 0x34e91
leaq 0xd8(%rsp), %rdi
callq 0xd490
leaq 0x78(%rsp), %rdi
callq 0x46e8
leaq 0x98(%rsp), %rdi
callq 0x46e8
leaq 0xb8(%rsp), %rdi
callq 0x46e8
movq 0x1a0(%rsp), %rax
movq %rax, (%rsp)
movq 0x1a8(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x190(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x198(%rsp), %rsi
addq $0x20, %rsi
leaq 0x58(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x4180
movq 0x28(%rsp), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %r8
callq 0x37870
jmp 0x34f22
leaq 0x58(%rsp), %rdi
callq 0x46e8
movq 0x198(%rsp), %rsi
addq $0x20, %rsi
movq 0x190(%rsp), %rdi
addq $0x30, %rdi
callq 0x4050
addq $0x1b8, %rsp            # imm = 0x1B8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x148(%rsp)
movl %eax, 0x144(%rsp)
jmp 0x34fcb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x148(%rsp)
movl %eax, 0x144(%rsp)
jmp 0x34fbe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x148(%rsp)
movl %eax, 0x144(%rsp)
jmp 0x34fb4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x148(%rsp)
movl %eax, 0x144(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0xd490
leaq 0x78(%rsp), %rdi
callq 0x46e8
leaq 0x98(%rsp), %rdi
callq 0x46e8
leaq 0xb8(%rsp), %rdi
callq 0x46e8
jmp 0x34ff8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x148(%rsp)
movl %eax, 0x144(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x46e8
movq 0x148(%rsp), %rdi
callq 0x45f0
nopw %cs:(%rax,%rax)