// File: Merulo[P]CompilerJFTT/src/IRs/ThirdIR.cpp
// Function: ThirdIR::legalizeEquality(Block&)
void ThirdIR::legalizeEquality(Block& b)
{
    if (checkZeroJump(b))
    {
        legalizeZeroJump(b);
        return;
    }
    b.lines.insert(b.lines.begin() + b.lines.size() - 1, {"#DO NOT REMOVE CONST"});
    Line lastLine = b.lines.back();
    legalizeJLS(b, true);
    b.lines.back().one = lastLine.one;
    b.lines.back().two = lastLine.two;
    legalizeJMR(b, true);
}

// Assembly:
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, 0x1d0(%rsp)
movq %rsi, 0x1c8(%rsp)
movq 0x1d0(%rsp), %rdi
movq %rdi, 0x40(%rsp)
movq 0x1c8(%rsp), %rsi
callq 0x41850
testb $0x1, %al
jne 0x41097
jmp 0x410ae
movq 0x40(%rsp), %rdi
movq 0x1c8(%rsp), %rsi
callq 0x42570
jmp 0x41314
movq 0x1c8(%rsp), %rdi
addq $0x20, %rdi
movq %rdi, 0x30(%rsp)
callq 0xe3f0
movq %rax, 0x1a8(%rsp)
movq 0x1c8(%rsp), %rdi
addq $0x20, %rdi
callq 0xfbf0
movq %rax, %rsi
leaq 0x1a8(%rsp), %rdi
callq 0xe510
movq %rax, 0x1b0(%rsp)
leaq 0x1b0(%rsp), %rdi
movl $0x1, %esi
callq 0x118b0
movq %rax, 0x1b8(%rsp)
leaq 0x1c0(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0xe3b0
leaq 0x11f(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x4600
movq 0x38(%rsp), %rdx
leaq 0x10411(%rip), %rsi     # 0x51553
leaq 0x120(%rsp), %rdi
callq 0x4f10
jmp 0x41151
leaq 0xe7(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x4600
movq 0x28(%rsp), %rdx
leaq 0xffac(%rip), %rsi      # 0x5111b
leaq 0xe8(%rsp), %rdi
callq 0x4f10
jmp 0x4117e
leaq 0xbf(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x4600
movq 0x20(%rsp), %rdx
leaq 0xff7f(%rip), %rsi      # 0x5111b
leaq 0xc0(%rsp), %rdi
callq 0x4f10
jmp 0x411ab
leaq 0x140(%rsp), %rdi
leaq 0x120(%rsp), %rsi
leaq 0xe8(%rsp), %rdx
leaq 0xc0(%rsp), %rcx
callq 0xd3b0
jmp 0x411d2
movq 0x30(%rsp), %rdi
movq 0x1c0(%rsp), %rsi
leaq 0x140(%rsp), %rdx
callq 0x42860
movq %rax, 0x18(%rsp)
jmp 0x411f3
movq 0x18(%rsp), %rax
movq %rax, 0xb0(%rsp)
leaq 0x140(%rsp), %rdi
callq 0xd490
leaq 0xc0(%rsp), %rdi
callq 0x46e8
leaq 0xbf(%rsp), %rdi
callq 0x43b0
leaq 0xe8(%rsp), %rdi
callq 0x46e8
leaq 0xe7(%rsp), %rdi
callq 0x43b0
leaq 0x120(%rsp), %rdi
callq 0x46e8
leaq 0x11f(%rsp), %rdi
callq 0x43b0
movq 0x1c8(%rsp), %rdi
addq $0x20, %rdi
callq 0x11660
movq %rax, %rsi
leaq 0x48(%rsp), %rdi
callq 0xfb20
movq 0x40(%rsp), %rdi
movq 0x1c8(%rsp), %rsi
movl $0x1, %edx
callq 0x40b70
jmp 0x41292
leaq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x1c8(%rsp), %rdi
addq $0x20, %rdi
callq 0x11660
movq 0x10(%rsp), %rsi
movq %rax, %rdi
addq $0x20, %rdi
callq 0x4050
jmp 0x412c0
leaq 0x88(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x1c8(%rsp), %rdi
addq $0x20, %rdi
callq 0x11660
movq 0x8(%rsp), %rsi
movq %rax, %rdi
addq $0x40, %rdi
callq 0x4050
jmp 0x412f1
movq 0x40(%rsp), %rdi
movq 0x1c8(%rsp), %rsi
movl $0x1, %edx
callq 0x40e20
jmp 0x4130a
leaq 0x48(%rsp), %rdi
callq 0xd490
addq $0x1d8, %rsp            # imm = 0x1D8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0x413d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0x413bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0x413a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0x41398
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
leaq 0x140(%rsp), %rdi
callq 0xd490
leaq 0xc0(%rsp), %rdi
callq 0x46e8
leaq 0xbf(%rsp), %rdi
callq 0x43b0
leaq 0xe8(%rsp), %rdi
callq 0x46e8
leaq 0xe7(%rsp), %rdi
callq 0x43b0
leaq 0x120(%rsp), %rdi
callq 0x46e8
leaq 0x11f(%rsp), %rdi
callq 0x43b0
jmp 0x41406
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
leaq 0x48(%rsp), %rdi
callq 0xd490
movq 0x110(%rsp), %rdi
callq 0x45f0
nopw %cs:(%rax,%rax)