// File: /workspace/github_c_makefile_star2_O3/tyabu12[P]pl0compiler/codegen.c
// Function: printCode
void printCode(FILE *fp, int i, char nl) { /* 命令語の印字 */
    int flag;
    switch (code[i].opCode) {
    case lit: fprintf(fp, "lit"); flag=1; break;
    case opr: fprintf(fp, "opr"); flag=3; break;
    case lod: fprintf(fp, "lod"); flag=2; break;
    case sto: fprintf(fp, "sto"); flag=2; break;
    case cal: fprintf(fp, "cal"); flag=2; break;
    case ret: fprintf(fp, "ret"); flag=2; break;
    case ict: fprintf(fp, "ict"); flag=1; break;
    case jmp: fprintf(fp, "jmp"); flag=1; break;
    case jpc: fprintf(fp, "jpc"); flag=1; break;
    }
    switch (flag) {
    case 1:
        fprintf(fp, ",%d", code[i].u.value);
        break;
    case 2:
        fprintf(fp, ",%d", code[i].u.addr.level);
        fprintf(fp, ",%d", code[i].u.addr.addr);
        break;
    case 3:
        switch (code[i].u.optr) {
        case neg: fprintf(fp, ",neg"); break;
        case add: fprintf(fp, ",add"); break;
        case sub: fprintf(fp, ",sub"); break;
        case mul: fprintf(fp, ",mul"); break;
        case div: fprintf(fp, ",div"); break;
        case odd: fprintf(fp, ",odd"); break;
        case eq: fprintf(fp, ",eq"); break;
        case ls: fprintf(fp, ",ls"); break;
        case gr: fprintf(fp, ",gr"); break;
        case neq: fprintf(fp, ",neq"); break;
        case lseq: fprintf(fp, ",lseq"); break;
        case greq: fprintf(fp, ",greq"); break;
        case rd: fprintf(fp, ",rd"); break;
        case wrt: fprintf(fp, ",wrt"); break;
        case wrl: fprintf(fp, ",wrl"); break;
        }
    }
    fprintf(fp, "%c", nl);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
movslq %esi, %rax
leaq (%rax,%rax,2), %rax
leaq 0x5bf3(%rip), %rcx      # 0x80f0
leaq (%rcx,%rax,4), %r15
movl (%r15), %eax
cmpq $0x8, %rax
ja 0x2566
leaq 0x2af3(%rip), %rcx      # 0x5004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2c10(%rip), %rdi      # 0x5131
jmp 0x25dd
leaq 0x2c14(%rip), %rdi      # 0x5141
jmp 0x2597
leaq 0x2c03(%rip), %rdi      # 0x5139
jmp 0x2597
leaq 0x2bfe(%rip), %rdi      # 0x513d
jmp 0x2597
leaq 0x2c05(%rip), %rdi      # 0x514d
jmp 0x25dd
leaq 0x2be1(%rip), %rdi      # 0x5135
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2180
movl 0x4(%r15), %eax
cmpq $0xe, %rax
ja 0x2604
leaq 0x2aad(%rip), %rcx      # 0x5028
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2c86(%rip), %rdi      # 0x5211
jmp 0x267b
leaq 0x2bae(%rip), %rdi      # 0x5145
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2180
movl 0x4(%r15), %edx
leaq 0x2bb3(%rip), %r14      # 0x5167
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2110
movl 0x8(%r15), %edx
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x25fd
leaq 0x2b75(%rip), %rdi      # 0x5149
jmp 0x25dd
leaq 0x2b74(%rip), %rdi      # 0x5151
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2180
movl 0x4(%r15), %edx
leaq 0x2b6d(%rip), %rsi      # 0x5167
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2110
movzbl %bpl, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20d0
leaq 0x2c34(%rip), %rdi      # 0x5255
jmp 0x267b
leaq 0x2c1c(%rip), %rdi      # 0x5246
jmp 0x2692
leaq 0x2bf2(%rip), %rdi      # 0x5225
jmp 0x267b
leaq 0x2c10(%rip), %rdi      # 0x524c
jmp 0x26a0
leaq 0x2bf6(%rip), %rdi      # 0x523b
jmp 0x267b
leaq 0x2bcd(%rip), %rdi      # 0x521b
jmp 0x267b
leaq 0x2bc9(%rip), %rdi      # 0x5220
jmp 0x267b
leaq 0x2bd3(%rip), %rdi      # 0x5233
jmp 0x26a0
leaq 0x2bad(%rip), %rdi      # 0x5216
jmp 0x267b
leaq 0x2bb8(%rip), %rdi      # 0x522a
jmp 0x267b
leaq 0x2bd5(%rip), %rdi      # 0x5250
movl $0x4, %esi
jmp 0x26a5
leaq 0x2ba6(%rip), %rdi      # 0x522f
jmp 0x26a0
leaq 0x2bae(%rip), %rdi      # 0x5240
movl $0x5, %esi
jmp 0x26a5
leaq 0x2b97(%rip), %rdi      # 0x5237
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2180
jmp 0x2604