// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
movslq %esi, %rax
leaq (%rax,%rax,2), %r14
leaq 0x5bfa(%rip), %r15      # 0x80f0
movl (%r15,%r14,4), %eax
cmpq $0x8, %rax
ja 0x252b
leaq 0x2bf9(%rip), %rcx      # 0x5100
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
leaq 0x2c0f(%rip), %rcx      # 0x5124
movl (%rcx,%rax,4), %r12d
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2180
leaq (%r15,%r14,4), %r15
cmpl $0x3, %r12d
je 0x2583
cmpl $0x2, %r12d
je 0x2555
cmpl $0x1, %r12d
jne 0x2642
movl 0x4(%r15), %edx
leaq 0x2c3b(%rip), %rsi      # 0x518b
movq %rbx, %rdi
jmp 0x2577
movl 0x4(%r15), %edx
leaq 0x2c2b(%rip), %r14      # 0x518b
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2110
movl 0x8(%r15), %edx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2110
jmp 0x2642
movl 0x4(%r15), %eax
cmpq $0xe, %rax
ja 0x2642
leaq 0x2a6c(%rip), %rcx      # 0x5004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2c8d(%rip), %rdi      # 0x5235
jmp 0x260b
leaq 0x2cc8(%rip), %rdi      # 0x5279
jmp 0x260b
leaq 0x2cb0(%rip), %rdi      # 0x526a
jmp 0x2622
leaq 0x2c86(%rip), %rdi      # 0x5249
jmp 0x260b
leaq 0x2ca4(%rip), %rdi      # 0x5270
jmp 0x2630
leaq 0x2c8a(%rip), %rdi      # 0x525f
jmp 0x260b
leaq 0x2c61(%rip), %rdi      # 0x523f
jmp 0x260b
leaq 0x2c5d(%rip), %rdi      # 0x5244
jmp 0x260b
leaq 0x2c67(%rip), %rdi      # 0x5257
jmp 0x2630
leaq 0x2c41(%rip), %rdi      # 0x523a
jmp 0x260b
leaq 0x2c4c(%rip), %rdi      # 0x524e
jmp 0x260b
leaq 0x2c69(%rip), %rdi      # 0x5274
movl $0x4, %esi
jmp 0x2635
leaq 0x2c3a(%rip), %rdi      # 0x5253
jmp 0x2630
leaq 0x2c42(%rip), %rdi      # 0x5264
movl $0x5, %esi
jmp 0x2635
leaq 0x2c2b(%rip), %rdi      # 0x525b
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2180
movzbl %bpl, %edi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x20d0