// File: /workspace/github_c_makefile_star2_O3/tyabu12[P]pl0compiler/codegen.c
// Function: printMemory
void printMemory(const Mem *m) { /* 目的コード（命令語）の実行メモリの表示 */
    int screenIndex = 0, i;
    printf("\n\nsteps:%d pc:%d top:%d exitCode:%d\n", m->stepCount, m->pc, m->top, m->exitCode);
    printf("----------------------------------------------------------------\n");
    printf("Code:\t\t\tStack:\t\tDisplay:\tScreen:\n");
    for (i = 0;
      i < cIndex
      || (i < MAXMEM && m->stack[i] != -1)
      || (i < MAXLEVEL && m->display[i] != -1)
      || (m->screen[screenIndex] != '\0'); i++) {
      if (i < cIndex) { /* 目的コード（命令語）の表示 */
        printf("%c%3d[", (i == m->breakPoint ? '*' : ' '), i);
        printCode(stdout, i, '\0');
        printf("\t]");
        if (i == m->pc && !m->exitCode) printf("<-");
      } else printf("\t\t");
      if (i < MAXMEM && i <= m->topMax) { /* スタックの表示 */
        if (m->stack[i] != -1)
          printf("\t%4d[%4d]", i, m->stack[i]);
        else
          printf("\t%4d[----]", i);
        if (i == m->top && !m->exitCode) printf("<-");
      } else printf("\t\t");
      if (i < MAXLEVEL && m->display[i] != -1) { /* ディスプレイの表示 */
        printf("\t%3d[%3d]", i, m->display[i]);
      } else printf("\t\t");
      if (m->screen[screenIndex] != '\0') { /* スクリーンの表示 */
        printf("\t  ");
        while (m->screen[screenIndex] != '\0' && m->screen[screenIndex] != '\n') {
          putchar(m->screen[screenIndex++]);
        }
        if (m->screen[screenIndex] == '\n') screenIndex++;
      }
      printf("\n");
    }
    printf("----------------------------------------------------------------\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x1f64(%rdi), %esi
movl 0x1f54(%rdi), %edx
movl 0x1f58(%rdi), %ecx
movl 0x1f60(%rdi), %r8d
leaq 0x27b5(%rip), %rdi      # 0x5181
xorl %eax, %eax
callq 0x2090
leaq 0x28a1(%rip), %rdi      # 0x527b
callq 0x2060
leaq 0x2874(%rip), %rdi      # 0x525a
callq 0x2060
leaq 0x1f68(%rbx), %r14
leaq 0x27ba(%rip), %r12      # 0x51b3
xorl %r13d, %r13d
xorl %r15d, %r15d
movslq 0x56d2(%rip), %rax      # 0x80d8
movslq %r15d, %rbp
cmpq %rax, %r13
jge 0x2a74
movl 0x2168(%rbx), %eax
cmpq %rax, %r13
movl $0x20, %esi
movl $0x2a, %eax
cmovel %eax, %esi
leaq 0x277b(%rip), %rdi      # 0x51a6
movl %r13d, %edx
xorl %eax, %eax
callq 0x2090
movq 0x5584(%rip), %rax      # 0x7fc0
movq (%rax), %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x24e3
leaq 0x275d(%rip), %rdi      # 0x51ad
xorl %eax, %eax
callq 0x2090
movl 0x1f54(%rbx), %eax
cmpq %rax, %r13
jne 0x2ab3
cmpl $0x0, 0x1f60(%rbx)
leaq 0x2740(%rip), %rdi      # 0x51b0
jne 0x2ab3
jmp 0x2aac
cmpq $0x7cf, %r13            # imm = 0x7CF
ja 0x2a9b
cmpl $-0x1, (%rbx,%r13,4)
movq %r12, %rdi
jne 0x2aac
cmpq $0x4, %r13
ja 0x2a9b
cmpl $-0x1, 0x1f40(%rbx,%r13,4)
movq %r12, %rdi
jne 0x2aac
cmpb $0x0, 0x1f68(%rbx,%rbp)
movq %r12, %rdi
je 0x2bb2
xorl %eax, %eax
callq 0x2090
movq %r12, %rdi
cmpq $0x7cf, %r13            # imm = 0x7CF
ja 0x2ad2
movslq 0x1f5c(%rbx), %rax
movq %r12, %rdi
cmpq %rax, %r13
jle 0x2b5d
xorl %eax, %eax
callq 0x2090
cmpq $0x4, %r13
ja 0x2aff
movl 0x1f40(%rbx,%r13,4), %edx
cmpl $-0x1, %edx
je 0x2aff
leaq 0x26d8(%rip), %rdi      # 0x51cb
movl %r13d, %esi
xorl %eax, %eax
callq 0x2090
jmp 0x2b09
movq %r12, %rdi
xorl %eax, %eax
callq 0x2090
cmpb $0x0, 0x1f68(%rbx,%rbp)
je 0x2b4b
leaq 0x26bb(%rip), %rdi      # 0x51d5
xorl %eax, %eax
callq 0x2090
addq %r14, %rbp
movzbl (%rbp), %eax
testl %eax, %eax
je 0x2b41
cmpl $0xa, %eax
je 0x2b41
movsbl %al, %edi
callq 0x2030
incl %r15d
incq %rbp
jmp 0x2b24
xorl %ecx, %ecx
cmpb $0xa, %al
sete %cl
addl %ecx, %r15d
movl $0xa, %edi
callq 0x2030
incq %r13
jmp 0x29ff
movl (%rbx,%r13,4), %edx
cmpl $-0x1, %edx
je 0x2b79
leaq 0x2649(%rip), %rdi      # 0x51b6
movl %r13d, %esi
xorl %eax, %eax
callq 0x2090
jmp 0x2b8a
leaq 0x2640(%rip), %rdi      # 0x51c0
movl %r13d, %esi
xorl %eax, %eax
callq 0x2090
movl 0x1f58(%rbx), %eax
cmpq %rax, %r13
jne 0x2ad9
cmpl $0x0, 0x1f60(%rbx)
leaq 0x2609(%rip), %rdi      # 0x51b0
jne 0x2ad9
jmp 0x2ad2
leaq 0x26c2(%rip), %rdi      # 0x527b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2060