// File: /workspace/github_c_makefile_star2_O2/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
imulq $0xc, %rax, %rax
leaq 0x4cc3(%rip), %rcx      # 0x70f0
leaq (%rcx,%rax), %r15
movl (%rax,%rcx), %eax
cmpq $0x8, %rax
ja 0x2492
leaq 0x1bc3(%rip), %rcx      # 0x4004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1ce0(%rip), %rdi      # 0x4131
jmp 0x2505
leaq 0x1ce4(%rip), %rdi      # 0x4141
jmp 0x24c3
leaq 0x1cd3(%rip), %rdi      # 0x4139
jmp 0x24c3
leaq 0x1cce(%rip), %rdi      # 0x413d
jmp 0x24c3
leaq 0x1cd5(%rip), %rdi      # 0x414d
jmp 0x2505
leaq 0x1cb1(%rip), %rdi      # 0x4135
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x2170
movl 0x4(%r15), %eax
cmpq $0xe, %rax
ja 0x2528
leaq 0x1b81(%rip), %rcx      # 0x4028
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1d5a(%rip), %rdi      # 0x4211
jmp 0x259f
leaq 0x1c82(%rip), %rdi      # 0x4145
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x2170
movl 0x4(%r15), %edx
leaq 0x1c8b(%rip), %r14      # 0x4167
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2100
movl 0x8(%r15), %edx
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x2521
leaq 0x1c4d(%rip), %rdi      # 0x4149
jmp 0x2505
leaq 0x1c4c(%rip), %rdi      # 0x4151
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x2170
movl 0x4(%r15), %edx
leaq 0x1c49(%rip), %rsi      # 0x4167
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2100
movzbl %bpl, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20c0
leaq 0x1d10(%rip), %rdi      # 0x4255
jmp 0x259f
leaq 0x1cf8(%rip), %rdi      # 0x4246
jmp 0x25b3
leaq 0x1cce(%rip), %rdi      # 0x4225
jmp 0x259f
leaq 0x1cec(%rip), %rdi      # 0x424c
jmp 0x25be
leaq 0x1cd2(%rip), %rdi      # 0x423b
jmp 0x259f
leaq 0x1ca9(%rip), %rdi      # 0x421b
jmp 0x259f
leaq 0x1ca5(%rip), %rdi      # 0x4220
jmp 0x259f
leaq 0x1caf(%rip), %rdi      # 0x4233
jmp 0x25be
leaq 0x1c89(%rip), %rdi      # 0x4216
jmp 0x259f
leaq 0x1c94(%rip), %rdi      # 0x422a
jmp 0x259f
leaq 0x1cb1(%rip), %rdi      # 0x4250
pushq $0x4
jmp 0x25c0
leaq 0x1c85(%rip), %rdi      # 0x422f
jmp 0x25be
leaq 0x1c8d(%rip), %rdi      # 0x4240
pushq $0x5
jmp 0x25c0
leaq 0x1c79(%rip), %rdi      # 0x4237
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x2170
jmp 0x2528