// File: Merulo[P]CompilerJFTT/src/IRs/ThirdIR.cpp
// Function: ThirdIR::searchForTwoTablesWithSameOperation()
void ThirdIR::searchForTwoTablesWithSameOperation()
{
    for(auto& b : _blocks)
    {
        for(auto i = b.lines.begin(); i != b.lines.end(); i++)
        {
            if (checkVariablesAreSameTable(i->one, i->two))
            {
                std::string var = getVariable("NAN");
                i = b.lines.insert(i, {"COPY", var, i->two});
                i++;
                i->two = var;
            }
        }
    }
}

// Assembly:
subq $0x208, %rsp            # imm = 0x208
movq %rdi, 0x200(%rsp)
movq 0x200(%rsp), %rax
movq %rax, 0x40(%rsp)
addq $0x10, %rax
movq %rax, 0x1f8(%rsp)
movq 0x1f8(%rsp), %rdi
callq 0x29fd0
movq %rax, 0x1f0(%rsp)
movq 0x1f8(%rsp), %rdi
callq 0x2a870
movq %rax, 0x1e8(%rsp)
leaq 0x1f0(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x30be0
testb $0x1, %al
jne 0x3fea0
jmp 0x402f1
leaq 0x1f0(%rsp), %rdi
callq 0x2bda0
movq %rax, 0x1e0(%rsp)
movq 0x1e0(%rsp), %rdi
addq $0x20, %rdi
callq 0xe3f0
movq %rax, 0x1d8(%rsp)
movq 0x1e0(%rsp), %rdi
addq $0x20, %rdi
callq 0xe380
movq %rax, 0x1d0(%rsp)
leaq 0x1d8(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0xec10
testb $0x1, %al
jne 0x3ff05
jmp 0x402dd
leaq 0x1d8(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x30d40
movq %rax, %rsi
addq $0x20, %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x4180
movq 0x38(%rsp), %rdi
callq 0x30d40
movq %rax, %rsi
addq $0x40, %rsi
leaq 0x190(%rsp), %rdi
callq 0x4180
jmp 0x3ff4b
movq 0x40(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
leaq 0x190(%rsp), %rdx
callq 0x40a20
movb %al, 0x37(%rsp)
jmp 0x3ff6b
leaq 0x190(%rsp), %rdi
callq 0x46e8
leaq 0x1b0(%rsp), %rdi
callq 0x46e8
movb 0x37(%rsp), %al
testb $0x1, %al
jne 0x3ff92
jmp 0x402c2
leaq 0x13f(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x4600
movq 0x28(%rsp), %rdx
leaq 0x11504(%rip), %rsi     # 0x514b4
leaq 0x140(%rsp), %rdi
callq 0x4f10
jmp 0x3ffbf
movq 0x40(%rsp), %rsi
leaq 0x160(%rsp), %rdi
leaq 0x140(%rsp), %rdx
callq 0x3d2e0
jmp 0x3ffdb
leaq 0x140(%rsp), %rdi
callq 0x46e8
leaq 0x13f(%rsp), %rdi
callq 0x43b0
movq 0x1e0(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x18(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0xe3b0
leaq 0x9f(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x4600
movq 0x20(%rsp), %rdx
leaq 0x110c4(%rip), %rsi     # 0x510fd
leaq 0xa0(%rsp), %rdi
callq 0x4f10
jmp 0x40048
leaq 0x78(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x4180
jmp 0x4005c
leaq 0x1d8(%rsp), %rdi
callq 0x30d40
movq %rax, %rsi
addq $0x40, %rsi
leaq 0x58(%rsp), %rdi
callq 0x4180
jmp 0x4007c
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x78(%rsp), %rdx
leaq 0x58(%rsp), %rcx
callq 0xd3b0
jmp 0x4009d
movq 0x18(%rsp), %rdi
movq 0x128(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x42860
movq %rax, 0x10(%rsp)
jmp 0x400be
movq 0x10(%rsp), %rax
movq %rax, 0x130(%rsp)
movq 0x130(%rsp), %rax
movq %rax, 0x1d8(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0xd490
leaq 0x58(%rsp), %rdi
callq 0x46e8
leaq 0x78(%rsp), %rdi
callq 0x46e8
leaq 0xa0(%rsp), %rdi
callq 0x46e8
leaq 0x9f(%rsp), %rdi
callq 0x43b0
leaq 0x1d8(%rsp), %rdi
movq %rdi, 0x8(%rsp)
xorl %esi, %esi
callq 0x30e00
movq 0x8(%rsp), %rdi
movq %rax, 0x50(%rsp)
callq 0x30d40
movq %rax, %rdi
addq $0x40, %rdi
leaq 0x160(%rsp), %rsi
callq 0x4050
jmp 0x4014f
leaq 0x160(%rsp), %rdi
callq 0x46e8
jmp 0x402c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0x40198
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x46e8
leaq 0x1b0(%rsp), %rdi
callq 0x46e8
jmp 0x402f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0x401e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x46e8
leaq 0x13f(%rsp), %rdi
callq 0x43b0
jmp 0x402f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0x40290
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0x40283
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0x40279
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0x4026f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0xd490
leaq 0x58(%rsp), %rdi
callq 0x46e8
leaq 0x78(%rsp), %rdi
callq 0x46e8
leaq 0xa0(%rsp), %rdi
callq 0x46e8
leaq 0x9f(%rsp), %rdi
callq 0x43b0
jmp 0x402b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x46e8
jmp 0x402f9
jmp 0x402c4
leaq 0x1d8(%rsp), %rdi
xorl %esi, %esi
callq 0x30e00
movq %rax, 0x48(%rsp)
jmp 0x3fece
jmp 0x402df
leaq 0x1f0(%rsp), %rdi
callq 0x30c20
jmp 0x3fe82
addq $0x208, %rsp            # imm = 0x208
retq
movq 0x188(%rsp), %rdi
callq 0x45f0
nopw %cs:(%rax,%rax)