// File: fondoger[P]C0-Compiler/src/midcode.cpp
// Function: convertFormat[abi:cxx11](_FourTuple const&)
static std::string convertFormat(const FourTuple &ft)
{
    std::stringstream ss;
    switch(ft.op) {
        case ASSIGN:    
            ss << ft.res << " = " << ft.a; 
            break;
        case ADD:       
            ss << ft.res << " = " << ft.a << " + " << ft.b; 
            break;
        case SUB:
            ss << ft.res << " = " << ft.a << " - " << ft.b;
            break;
        case MUL:
            ss << ft.res << " = " << ft.a << " * " << ft.b;
            break;
        case DIV:
            ss << ft.res << " = " << ft.a << " / " << ft.b;
            break;
        case WARRAY:    
            ss << ft.a << "[" << ft.b << "]" << " = " << ft.res;
            break;
        case RARRAY:
            ss << ft.res << " = " << ft.a << "[" << ft.b << "]";
            break;
        case COMPARE:
            ss << ft.a << " " << ft.b << " " << ft.res;
            break;
        case FUNC:  ss << ft.a << " " << ft.b << "()"; break;
        case PARA:  ss << "para " << ft.a << " " << ft.b; break;
        case GVAR:
        case VAR:   ss << "var " << ft.a << " " << ft.b
                       << " " << ft.res; break;
        case PUSH:  ss << "push " << ft.a << " " << ft.b; break;
        case CALL:  ss << "call " << ft.a; break;
        case RET:   ss << "ret " << ft.a; break;
        case GETRET:ss << "getret " << ft.res; break;
        case WRITE: ss << "printf " << ft.a << " " << ft.b; break;
        case READ:  ss << "scanf " << ft.a << " " << ft.b; break;
        case END:   ss << "end"; break;
        case LABEL: ss << "label " << ft.a; break;
        case GOTO:  ss << "goto " << ft.a; break;
        case BZ:    ss << "bz " << ft.a << " " << ft.b 
                       << " " << ft.res; 
                    break;
        case BNZ:   ss << "bnz " << ft.a << " " << ft.b 
                       << " " << ft.res; 
                    break;
        case TEMP:  ss << "temp " << ft.a << " " << ft.b; break;
        default:    std::cout << "FUCK: unknown!" << std::endl;
    }
    return ss.str();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x400, %rsp            # imm = 0x400
movq %rdi, -0x1c0(%rbp)
movq %rdi, %rax
movq %rax, -0x1b8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x3270
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x1b0(%rbp)
subq $0x17, %rax
ja 0x26fbd
movq -0x1b0(%rbp), %rax
leaq 0xf827(%rip), %rcx      # 0x35d8c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x188(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x32c0
movq %rax, -0x1c8(%rbp)
jmp 0x2658b
movq -0x1c8(%rbp), %rdi
leaq 0xf901(%rip), %rsi      # 0x35e9a
callq 0x3300
movq %rax, -0x1d0(%rbp)
jmp 0x265a7
movq -0x1d0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
jmp 0x265bd
jmp 0x26ff0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x35f0
jmp 0x27021
leaq -0x188(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x32c0
movq %rax, -0x1d8(%rbp)
jmp 0x26602
movq -0x1d8(%rbp), %rdi
leaq 0xf88a(%rip), %rsi      # 0x35e9a
callq 0x3300
movq %rax, -0x1e0(%rbp)
jmp 0x2661e
movq -0x1e0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x1e8(%rbp)
jmp 0x2663b
movq -0x1e8(%rbp), %rdi
leaq 0xf855(%rip), %rsi      # 0x35e9e
callq 0x3300
movq %rax, -0x1f0(%rbp)
jmp 0x26657
movq -0x1f0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
jmp 0x2666d
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x32c0
movq %rax, -0x1f8(%rbp)
jmp 0x2668f
movq -0x1f8(%rbp), %rdi
leaq 0xf7fd(%rip), %rsi      # 0x35e9a
callq 0x3300
movq %rax, -0x200(%rbp)
jmp 0x266ab
movq -0x200(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x208(%rbp)
jmp 0x266c8
movq -0x208(%rbp), %rdi
leaq 0xf7cc(%rip), %rsi      # 0x35ea2
callq 0x3300
movq %rax, -0x210(%rbp)
jmp 0x266e4
movq -0x210(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
jmp 0x266fa
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x32c0
movq %rax, -0x218(%rbp)
jmp 0x2671c
movq -0x218(%rbp), %rdi
leaq 0xf770(%rip), %rsi      # 0x35e9a
callq 0x3300
movq %rax, -0x220(%rbp)
jmp 0x26738
movq -0x220(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x228(%rbp)
jmp 0x26755
movq -0x228(%rbp), %rdi
leaq 0xf743(%rip), %rsi      # 0x35ea6
callq 0x3300
movq %rax, -0x230(%rbp)
jmp 0x26771
movq -0x230(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
jmp 0x26787
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x32c0
movq %rax, -0x238(%rbp)
jmp 0x267a9
movq -0x238(%rbp), %rdi
leaq 0xf6e3(%rip), %rsi      # 0x35e9a
callq 0x3300
movq %rax, -0x240(%rbp)
jmp 0x267c5
movq -0x240(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x248(%rbp)
jmp 0x267e2
movq -0x248(%rbp), %rdi
leaq 0xf6ba(%rip), %rsi      # 0x35eaa
callq 0x3300
movq %rax, -0x250(%rbp)
jmp 0x267fe
movq -0x250(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
jmp 0x26814
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x258(%rbp)
jmp 0x26836
movq -0x258(%rbp), %rdi
leaq 0xf66a(%rip), %rsi      # 0x35eae
callq 0x3300
movq %rax, -0x260(%rbp)
jmp 0x26852
movq -0x260(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
movq %rax, -0x268(%rbp)
jmp 0x2686f
movq -0x268(%rbp), %rdi
leaq 0xf633(%rip), %rsi      # 0x35eb0
callq 0x3300
movq %rax, -0x270(%rbp)
jmp 0x2688b
movq -0x270(%rbp), %rdi
leaq 0xf601(%rip), %rsi      # 0x35e9a
callq 0x3300
movq %rax, -0x278(%rbp)
jmp 0x268a7
movq -0x278(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x32c0
jmp 0x268bd
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x32c0
movq %rax, -0x280(%rbp)
jmp 0x268df
movq -0x280(%rbp), %rdi
leaq 0xf5ad(%rip), %rsi      # 0x35e9a
callq 0x3300
movq %rax, -0x288(%rbp)
jmp 0x268fb
movq -0x288(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x290(%rbp)
jmp 0x26918
movq -0x290(%rbp), %rdi
leaq 0xf588(%rip), %rsi      # 0x35eae
callq 0x3300
movq %rax, -0x298(%rbp)
jmp 0x26934
movq -0x298(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
movq %rax, -0x2a0(%rbp)
jmp 0x26951
movq -0x2a0(%rbp), %rdi
leaq 0xf551(%rip), %rsi      # 0x35eb0
callq 0x3300
jmp 0x26966
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x2a8(%rbp)
jmp 0x26988
movq -0x2a8(%rbp), %rdi
leaq 0xf512(%rip), %rsi      # 0x35ea8
callq 0x3300
movq %rax, -0x2b0(%rbp)
jmp 0x269a4
movq -0x2b0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
movq %rax, -0x2b8(%rbp)
jmp 0x269c1
movq -0x2b8(%rbp), %rdi
leaq 0xf4d9(%rip), %rsi      # 0x35ea8
callq 0x3300
movq %rax, -0x2c0(%rbp)
jmp 0x269dd
movq -0x2c0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x32c0
jmp 0x269f3
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x2c8(%rbp)
jmp 0x26a15
movq -0x2c8(%rbp), %rdi
leaq 0xf485(%rip), %rsi      # 0x35ea8
callq 0x3300
movq %rax, -0x2d0(%rbp)
jmp 0x26a31
movq -0x2d0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
movq %rax, -0x2d8(%rbp)
jmp 0x26a4e
movq -0x2d8(%rbp), %rdi
leaq 0xf8a0(%rip), %rsi      # 0x362fc
callq 0x3300
jmp 0x26a63
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
leaq 0xf43c(%rip), %rsi      # 0x35eb2
callq 0x3300
movq %rax, -0x2e0(%rbp)
jmp 0x26a84
movq -0x2e0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x2e8(%rbp)
jmp 0x26aa1
movq -0x2e8(%rbp), %rdi
leaq 0xf3f9(%rip), %rsi      # 0x35ea8
callq 0x3300
movq %rax, -0x2f0(%rbp)
jmp 0x26abd
movq -0x2f0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
jmp 0x26ad3
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
leaq 0xf3d2(%rip), %rsi      # 0x35eb8
callq 0x3300
movq %rax, -0x2f8(%rbp)
jmp 0x26af4
movq -0x2f8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x300(%rbp)
jmp 0x26b11
movq -0x300(%rbp), %rdi
leaq 0xf389(%rip), %rsi      # 0x35ea8
callq 0x3300
movq %rax, -0x308(%rbp)
jmp 0x26b2d
movq -0x308(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
movq %rax, -0x310(%rbp)
jmp 0x26b4a
movq -0x310(%rbp), %rdi
leaq 0xf350(%rip), %rsi      # 0x35ea8
callq 0x3300
movq %rax, -0x318(%rbp)
jmp 0x26b66
movq -0x318(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x32c0
jmp 0x26b7c
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
leaq 0xf32e(%rip), %rsi      # 0x35ebd
callq 0x3300
movq %rax, -0x320(%rbp)
jmp 0x26b9d
movq -0x320(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x328(%rbp)
jmp 0x26bba
movq -0x328(%rbp), %rdi
leaq 0xf2e0(%rip), %rsi      # 0x35ea8
callq 0x3300
movq %rax, -0x330(%rbp)
jmp 0x26bd6
movq -0x330(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
jmp 0x26bec
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
leaq 0xf2c4(%rip), %rsi      # 0x35ec3
callq 0x3300
movq %rax, -0x338(%rbp)
jmp 0x26c0d
movq -0x338(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
jmp 0x26c23
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
leaq 0xf296(%rip), %rsi      # 0x35ecc
callq 0x3300
movq %rax, -0x340(%rbp)
jmp 0x26c44
movq -0x340(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
jmp 0x26c5a
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
leaq 0xf25c(%rip), %rsi      # 0x35ec9
callq 0x3300
movq %rax, -0x348(%rbp)
jmp 0x26c7b
movq -0x348(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x32c0
jmp 0x26c91
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
leaq 0xf22d(%rip), %rsi      # 0x35ed1
callq 0x3300
movq %rax, -0x350(%rbp)
jmp 0x26cb2
movq -0x350(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x358(%rbp)
jmp 0x26ccf
movq -0x358(%rbp), %rdi
leaq 0xf1cb(%rip), %rsi      # 0x35ea8
callq 0x3300
movq %rax, -0x360(%rbp)
jmp 0x26ceb
movq -0x360(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
jmp 0x26d01
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
leaq 0xf1c5(%rip), %rsi      # 0x35ed9
callq 0x3300
movq %rax, -0x368(%rbp)
jmp 0x26d22
movq -0x368(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x370(%rbp)
jmp 0x26d3f
movq -0x370(%rbp), %rdi
leaq 0xf15b(%rip), %rsi      # 0x35ea8
callq 0x3300
movq %rax, -0x378(%rbp)
jmp 0x26d5b
movq -0x378(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
jmp 0x26d71
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
leaq 0xf15c(%rip), %rsi      # 0x35ee0
callq 0x3300
jmp 0x26d8b
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
leaq 0xf146(%rip), %rsi      # 0x35ee4
callq 0x3300
movq %rax, -0x380(%rbp)
jmp 0x26dac
movq -0x380(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
jmp 0x26dc2
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
leaq 0xf116(%rip), %rsi      # 0x35eeb
callq 0x3300
movq %rax, -0x388(%rbp)
jmp 0x26de3
movq -0x388(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
jmp 0x26df9
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
leaq 0xf0e5(%rip), %rsi      # 0x35ef1
callq 0x3300
movq %rax, -0x390(%rbp)
jmp 0x26e1a
movq -0x390(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x398(%rbp)
jmp 0x26e37
movq -0x398(%rbp), %rdi
leaq 0xf063(%rip), %rsi      # 0x35ea8
callq 0x3300
movq %rax, -0x3a0(%rbp)
jmp 0x26e53
movq -0x3a0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
movq %rax, -0x3a8(%rbp)
jmp 0x26e70
movq -0x3a8(%rbp), %rdi
leaq 0xf02a(%rip), %rsi      # 0x35ea8
callq 0x3300
movq %rax, -0x3b0(%rbp)
jmp 0x26e8c
movq -0x3b0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x32c0
jmp 0x26ea2
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
leaq 0xf040(%rip), %rsi      # 0x35ef5
callq 0x3300
movq %rax, -0x3b8(%rbp)
jmp 0x26ec3
movq -0x3b8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x3c0(%rbp)
jmp 0x26ee0
movq -0x3c0(%rbp), %rdi
leaq 0xefba(%rip), %rsi      # 0x35ea8
callq 0x3300
movq %rax, -0x3c8(%rbp)
jmp 0x26efc
movq -0x3c8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
movq %rax, -0x3d0(%rbp)
jmp 0x26f19
movq -0x3d0(%rbp), %rdi
leaq 0xef81(%rip), %rsi      # 0x35ea8
callq 0x3300
movq %rax, -0x3d8(%rbp)
jmp 0x26f35
movq -0x3d8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x32c0
jmp 0x26f4b
jmp 0x26ff0
leaq -0x188(%rbp), %rdi
leaq 0xef9c(%rip), %rsi      # 0x35efa
callq 0x3300
movq %rax, -0x3e0(%rbp)
jmp 0x26f6c
movq -0x3e0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x32c0
movq %rax, -0x3e8(%rbp)
jmp 0x26f89
movq -0x3e8(%rbp), %rdi
leaq 0xef11(%rip), %rsi      # 0x35ea8
callq 0x3300
movq %rax, -0x3f0(%rbp)
jmp 0x26fa5
movq -0x3f0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x32c0
jmp 0x26fbb
jmp 0x26ff0
movq 0x1e004(%rip), %rdi     # 0x44fc8
leaq 0xef35(%rip), %rsi      # 0x35f00
callq 0x3300
movq %rax, -0x3f8(%rbp)
jmp 0x26fd9
movq -0x3f8(%rbp), %rdi
movq 0x1dfc1(%rip), %rsi     # 0x44fa8
callq 0x3360
jmp 0x26fee
jmp 0x26ff0
movq -0x1c0(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x32f0
jmp 0x27005
leaq -0x198(%rbp), %rdi
callq 0x35f0
movq -0x1b8(%rbp), %rax
addq $0x400, %rsp            # imm = 0x400
popq %rbp
retq
movq -0x1a0(%rbp), %rdi
callq 0x3560
nopl (%rax)