#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int debug_instruction_size(unsigned char);
char *debug_register_description(unsigned char);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int /*<<< orphan*/ stdout;
void disassemble(unsigned char *bin, int bin_size) {
  int ip, i;
  int instruction_size;
  int constant;
  char tmp[32];
  ip = 0;
  while (ip < bin_size) {
    printf("%08x  ", ip);
    instruction_size = debug_instruction_size(bin[ip]);
    if (instruction_size < 1) {
      printf("%02x\n", bin[ip]);
      ip += 1;
    } else {
      for (i = instruction_size; i < 8; i++) {
        printf("  ");
      }
      for (i = 0; i < instruction_size; i++) {
        printf("%02x", bin[ip + i]);
      }
      printf("  ");
      switch (bin[ip]) {
      case 0x01:
      case 0x06:
        printf("ADD  ");
        break;
      case 0x02:
        printf("SUB  ");
        break;
      case 0x03:
      case 0x0D:
        printf("MUL  ");
        break;
      case 0x04:
      case 0x0E:
        printf("DIV  ");
        break;
      case 0x05:
      case 0x0F:
        printf("MOD  ");
        break;
      case 0x07:
      case 0x08:
        printf("AND  ");
        break;
      case 0x09:
      case 0x0A:
        printf("OR  ");
        break;
      case 0x0B:
      case 0x0C:
        printf("XOR  ");
        break;
      case 0x10:
      case 0x11:
      case 0x12:
      case 0x13:
      case 0x14:
      case 0x15:
        printf("MOV  ");
        break;
      case 0x20:
        printf("JMP  ");
        break;
      case 0x21:
        printf("JZ   ");
        break;
      case 0x22:
        printf("JE   ");
        break;
      case 0x23:
        printf("JG   ");
        break;
      case 0x30:
        printf("CALL ");
        break;
      case 0x31:
        printf("RET  ");
        break;
      case 0x32:
      case 0x34:
        printf("PUSH ");
        break;
      case 0x33:
        printf("POP  ");
        break;
      case 0x40:
      case 0x41:
        printf("CMP  ");
        break;
      case 0x80:
        printf("HLT  ");
        break;
      case 0x90:
        printf("NOP  ");
        break;
      }
      switch (bin[ip]) {
      case 0x01:
      case 0x11:
      case 0x02:
      case 0x03:
      case 0x04:
      case 0x05:
      case 0x40:
      case 0x07:
      case 0x09:
      case 0x0B:
        printf("%s, ", debug_register_description(bin[ip + 1]));
        printf("%s", debug_register_description(bin[ip + 2]));
        break;
      case 0x06:
      case 0x0D:
      case 0x0E:
      case 0x0F:
      case 0x10:
      case 0x41:
      case 0x08:
      case 0x0A:
      case 0x0C:
        printf("%s, ", debug_register_description(bin[ip + 1]));
        constant = ((int)bin[ip + 2]) << 24;
        constant |= ((int)bin[ip + 3]) << 16;
        constant |= ((int)bin[ip + 4]) << 8;
        constant |= ((int)bin[ip + 5]);
        sprintf(tmp, "%d (%08x)", constant, ip + constant);
        printf("%s", tmp);
        break;
      case 0x32:
      case 0x33:
        printf("%s", debug_register_description(bin[ip + 1]));
        break;
      case 0x12:
        printf("%s, ", debug_register_description(bin[ip + 1]));
        printf("[%s]", debug_register_description(bin[ip + 2]));
        break;
      case 0x13:
        printf("[%s], ", debug_register_description(bin[ip + 1]));
        printf("%s", debug_register_description(bin[ip + 2]));
        break;
      case 0x14:
        printf("%s, BYTE [", debug_register_description(bin[ip + 1]));
        printf("%s]", debug_register_description(bin[ip + 2]));
        break;
      case 0x15:
        printf("%s, BYTE [", debug_register_description(bin[ip + 1]));
        printf("%s]", debug_register_description(bin[ip + 2]));
        break;
      case 0x20:
      case 0x21:
      case 0x22:
      case 0x23:
      case 0x30:
      case 0x34:
        constant = ((int)bin[ip + 1]) << 24;
        constant |= ((int)bin[ip + 2]) << 16;
        constant |= ((int)bin[ip + 3]) << 8;
        constant |= ((int)bin[ip + 4]);
        sprintf(tmp, "%d (%08x)", constant, ip + constant + 5);
        printf("%s", tmp);
        break;
      }
      printf("\n");
      fflush(stdout);
      ip += instruction_size;
    }
  }
}


x86 assembly (clang, -O0):
<disassemble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    175e <disassemble+0x60e>
mov    -0x10(%rbp),%esi
lea    0x11c8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1050 <debug_instruction_size@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jge    11c9 <disassemble+0x79>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0x1197(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1759 <disassemble+0x609>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    11f5 <disassemble+0xa5>
lea    0x11b5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11cf <disassemble+0x7f>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1235 <disassemble+0xe5>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%esi
lea    0x1131(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11fc <disassemble+0xac>
lea    0x1159(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x8f,%eax
ja     13ee <disassemble+0x29e>
mov    -0x48(%rbp),%rax
lea    0xd92(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x10d8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x10cb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x10be(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x10b1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x10a4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x1097(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x108b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x1077(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x106a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x105d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x1050(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x1043(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x1036(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x1029(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x101c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x100f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0x1002(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0xff5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0xfe8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <disassemble+0x29e>
lea    0xfdb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x50(%rbp)
sub    $0x40,%eax
ja     1734 <disassemble+0x5e4>
mov    -0x50(%rbp),%rax
lea    0xe29(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <debug_register_description@plt>
mov    %rax,%rsi
lea    0xf88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <debug_register_description@plt>
mov    %rax,%rsi
lea    0xf66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1734 <disassemble+0x5e4>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <debug_register_description@plt>
mov    %rax,%rsi
lea    0xf35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x18,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x10,%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x8,%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%ecx
add    -0x1c(%rbp),%ecx
lea    0xec0(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x40(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1734 <disassemble+0x5e4>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <debug_register_description@plt>
mov    %rax,%rsi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1734 <disassemble+0x5e4>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <debug_register_description@plt>
mov    %rax,%rsi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <debug_register_description@plt>
mov    %rax,%rsi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1734 <disassemble+0x5e4>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <debug_register_description@plt>
mov    %rax,%rsi
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <debug_register_description@plt>
mov    %rax,%rsi
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1734 <disassemble+0x5e4>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <debug_register_description@plt>
mov    %rax,%rsi
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <debug_register_description@plt>
mov    %rax,%rsi
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1734 <disassemble+0x5e4>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <debug_register_description@plt>
mov    %rax,%rsi
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <debug_register_description@plt>
mov    %rax,%rsi
lea    0xd43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1734 <disassemble+0x5e4>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x18,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x10,%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x8,%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%ecx
add    -0x1c(%rbp),%ecx
add    $0x5,%ecx
lea    0xcb3(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x40(%rbp),%rsi
lea    0xca0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc14(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2897(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    -0x18(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1166 <disassemble+0x16>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disassemble>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %esi,0xc(%rsp)
test   %esi,%esi
jle    14d8 <disassemble+0x378>
mov    %rdi,%r13
lea    0x1295(%rip),%r12
xor    %ebp,%ebp
mov    %rdi,0x10(%rsp)
jmp    11b5 <disassemble+0x55>
nopl   (%rax)
movzbl 0x0(%r13,%rbx,1),%esi
lea    0x1276(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
mov    %ebp,%r15d
cmp    0xc(%rsp),%r15d
jge    14d8 <disassemble+0x378>
lea    0x1250(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movslq %ebp,%rbx
movzbl 0x0(%r13,%rbx,1),%edi
call   1060 <debug_instruction_size@plt>
test   %eax,%eax
jle    1190 <disassemble+0x30>
mov    %eax,%r15d
mov    %rbx,0x18(%rsp)
mov    %ebp,0x8(%rsp)
cmp    $0x7,%eax
ja     1217 <disassemble+0xb7>
mov    $0x8,%ebp
lea    0x1269(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffff,%ebp
cmp    %ebp,%r15d
jne    1200 <disassemble+0xa0>
test   %r15d,%r15d
jle    1248 <disassemble+0xe8>
mov    %r15d,%r13d
mov    0x18(%rsp),%rax
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,1),%r14
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movzbl (%r14,%rbp,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1230 <disassemble+0xd0>
lea    0x120e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%r13
mov    0x18(%rsp),%rbp
mov    0x0(%r13,%rbp,1),%al
lea    -0x80(%rax),%ecx
cmp    $0xc1,%cl
ja     14cf <disassemble+0x36f>
movzbl %cl,%ecx
lea    0xd85(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
lea    0x1195(%rip),%rdi
mov    0x8(%rsp),%ebx
jmp    *%rcx
lea    0x11b2(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x1188(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x1182(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x117c(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x1176(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x1171(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x1167(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x118e(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x1191(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x118e(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x118b(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x111c(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x113d(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x113a(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x1137(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x1134(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x1131(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x112e(%rip),%rdi
jmp    1350 <disassemble+0x1f0>
lea    0x1131(%rip),%rdi
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%r13,%rbp,1),%al
add    $0xff,%al
cmp    $0x40,%al
ja     1416 <disassemble+0x2b6>
movzbl %al,%eax
lea    0xf98(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movzbl 0x1(%rbp,%r13,1),%edi
call   1040 <debug_register_description@plt>
lea    0x1105(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x2(%rbp,%r13,1),%edi
call   1040 <debug_register_description@plt>
lea    0x10ee(%rip),%rdi
mov    %rax,%rsi
jmp    140f <disassemble+0x2af>
movzbl 0x1(%rbp,%r13,1),%edi
call   1040 <debug_register_description@plt>
lea    0x10d2(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2(%rbp,%r13,1),%edx
bswap  %edx
add    %edx,%ebp
lea    0x20(%rsp),%r14
mov    %r14,%rdi
lea    0x10b8(%rip),%rsi
mov    %ebp,%ecx
jmp    1400 <disassemble+0x2a0>
mov    0x1(%rbp,%r13,1),%edx
bswap  %edx
lea    (%rdx,%rbp,1),%ecx
add    $0x5,%ecx
lea    0x20(%rsp),%r14
mov    %r14,%rdi
lea    0x1098(%rip),%rsi
call   1080 <sprintf@plt>
lea    0x1089(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2bb9(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
add    %ebx,%r15d
mov    %r15d,%ebp
cmp    0xc(%rsp),%r15d
jl     11b5 <disassemble+0x55>
jmp    14d8 <disassemble+0x378>
movzbl 0x1(%rbp,%r13,1),%edi
call   1040 <debug_register_description@plt>
lea    0x1058(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x2(%rbp,%r13,1),%edi
call   1040 <debug_register_description@plt>
lea    0x1031(%rip),%rdi
mov    %rax,%rsi
jmp    140f <disassemble+0x2af>
movzbl 0x1(%rbp,%r13,1),%edi
jmp    139b <disassemble+0x23b>
movzbl 0x1(%rbp,%r13,1),%edi
call   1040 <debug_register_description@plt>
lea    0xffc(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x2(%rbp,%r13,1),%edi
call   1040 <debug_register_description@plt>
lea    0xff2(%rip),%rdi
mov    %rax,%rsi
jmp    140f <disassemble+0x2af>
movzbl 0x1(%rbp,%r13,1),%edi
call   1040 <debug_register_description@plt>
lea    0xfdd(%rip),%rdi
jmp    138b <disassemble+0x22b>
mov    0x8(%rsp),%ebx
jmp    135c <disassemble+0x1fc>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%08x \00"
@.str.1 = [6 x i8] c"%02x\0A\00"
@.str.2 = [3 x i8] c" \00"
@.str.3 = [5 x i8] c"%02x\00"
@.str.4 = [6 x i8] c"ADD \00"
@.str.5 = [6 x i8] c"SUB \00"
@.str.6 = [6 x i8] c"MUL \00"
@.str.7 = [6 x i8] c"DIV \00"
@.str.8 = [6 x i8] c"MOD \00"
@.str.9 = [6 x i8] c"AND \00"
@.str.10 = [5 x i8] c"OR \00"
@.str.11 = [6 x i8] c"XOR \00"
@.str.12 = [6 x i8] c"MOV \00"
@.str.13 = [6 x i8] c"JMP \00"
@.str.14 = [6 x i8] c"JZ \00"
@.str.15 = [6 x i8] c"JE \00"
@.str.16 = [6 x i8] c"JG \00"
@.str.17 = [6 x i8] c"CALL \00"
@.str.18 = [6 x i8] c"RET \00"
@.str.19 = [6 x i8] c"PUSH \00"
@.str.20 = [6 x i8] c"POP \00"
@.str.21 = [6 x i8] c"CMP \00"
@.str.22 = [6 x i8] c"HLT \00"
@.str.23 = [6 x i8] c"NOP \00"
@.str.24 = [5 x i8] c"%s, \00"
@.str.25 = [3 x i8] c"%s\00"
@.str.26 = [10 x i8] c"%d (%08x)\00"
@.str.27 = [5 x i8] c"[%s]\00"
@.str.28 = [7 x i8] c"[%s], \00"
@.str.29 = [11 x i8] c"%s, BYTE [\00"
@.str.30 = [4 x i8] c"%s]\00"
@.str.31 = [2 x i8] c"\0A\00"
@stdout = global i32 0
define void @disassemble(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [32 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %10
10: ; preds = %320, %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %321
14: ; preds = %10
%15 = load i32, i32* %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = call i32 @debug_instruction_size(i8 zeroext %21)
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = icmp slt i32 %23, 1
br i1 %24, label %25, label %35
25: ; preds = %14
%26 = load i8*, i8** %3
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
br label %320
35: ; preds = %14
%36 = load i32, i32* %7
store i32 %36, i32* %6
br label %37
37: ; preds = %42, %35
%38 = load i32, i32* %6
%39 = icmp slt i32 %38, 8
br i1 %39, label %40, label %45
40: ; preds = %37
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %42
42: ; preds = %40
%43 = load i32, i32* %6
%44 = add nsw i32 %43, 1
store i32 %44, i32* %6
br label %37
45: ; preds = %37
store i32 0, i32* %6
br label %46
46: ; preds = %60, %45
%47 = load i32, i32* %6
%48 = load i32, i32* %7
%49 = icmp slt i32 %47, %48
br i1 %49, label %50, label %63
50: ; preds = %46
%51 = load i8*, i8** %3
%52 = load i32, i32* %5
%53 = load i32, i32* %6
%54 = add nsw i32 %52, %53
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %51, i64 %55
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %50
%61 = load i32, i32* %6
%62 = add nsw i32 %61, 1
store i32 %62, i32* %6
br label %46
63: ; preds = %46
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%65 = load i8*, i8** %3
%66 = load i32, i32* %5
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8, i8* %65, i64 %67
%69 = load i8, i8* %68
%70 = zext i8 %69 to i32
switch i32 %70, label %111 [
i32 1, label %71
i32 6, label %71
i32 2, label %73
i32 3, label %75
i32 13, label %75
i32 4, label %77
i32 14, label %77
i32 5, label %79
i32 15, label %79
i32 7, label %81
i32 8, label %81
i32 9, label %83
i32 10, label %83
i32 11, label %85
i32 12, label %85
i32 16, label %87
i32 17, label %87
i32 18, label %87
i32 19, label %87
i32 20, label %87
i32 21, label %87
i32 32, label %89
i32 33, label %91
i32 34, label %93
i32 35, label %95
i32 48, label %97
i32 49, label %99
i32 50, label %101
i32 52, label %101
i32 51, label %103
i32 64, label %105
i32 65, label %105
i32 128, label %107
i32 144, label %109
]
71: ; preds = %63, %63
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %111
73: ; preds = %63
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %111
75: ; preds = %63, %63
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %111
77: ; preds = %63, %63
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %111
79: ; preds = %63, %63
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
br label %111
81: ; preds = %63, %63
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %111
83: ; preds = %63, %63
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
br label %111
85: ; preds = %63, %63
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
br label %111
87: ; preds = %63, %63, %63, %63, %63, %63
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
br label %111
89: ; preds = %63
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
br label %111
91: ; preds = %63
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
br label %111
93: ; preds = %63
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
br label %111
95: ; preds = %63
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
br label %111
97: ; preds = %63
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0))
br label %111
99: ; preds = %63
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
br label %111
101: ; preds = %63, %63
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0))
br label %111
103: ; preds = %63
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0))
br label %111
105: ; preds = %63, %63
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0))
br label %111
107: ; preds = %63
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
br label %111
109: ; preds = %63
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
br label %111
111: ; preds = %63, %109, %107, %105, %103, %101, %99, %97, %95, %93, %91, %89, %87, %85, %83, %81, %79, %77, %75, %73, %71
%112 = load i8*, i8** %3
%113 = load i32, i32* %5
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i8, i8* %112, i64 %114
%116 = load i8, i8* %115
%117 = zext i8 %116 to i32
switch i32 %117, label %313 [
i32 1, label %118
i32 17, label %118
i32 2, label %118
i32 3, label %118
i32 4, label %118
i32 5, label %118
i32 64, label %118
i32 7, label %118
i32 9, label %118
i32 11, label %118
i32 6, label %135
i32 13, label %135
i32 14, label %135
i32 15, label %135
i32 16, label %135
i32 65, label %135
i32 8, label %135
i32 10, label %135
i32 12, label %135
i32 50, label %189
i32 51, label %189
i32 18, label %198
i32 19, label %215
i32 20, label %232
i32 21, label %249
i32 32, label %266
i32 33, label %266
i32 34, label %266
i32 35, label %266
i32 48, label %266
i32 52, label %266
]
118: ; preds = %111, %111, %111, %111, %111, %111, %111, %111, %111, %111
%119 = load i8*, i8** %3
%120 = load i32, i32* %5
%121 = add nsw i32 %120, 1
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds i8, i8* %119, i64 %122
%124 = load i8, i8* %123
%125 = call i8* @debug_register_description(i8 zeroext %124)
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i8* %125)
%127 = load i8*, i8** %3
%128 = load i32, i32* %5
%129 = add nsw i32 %128, 2
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i8, i8* %127, i64 %130
%132 = load i8, i8* %131
%133 = call i8* @debug_register_description(i8 zeroext %132)
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i8* %133)
br label %313
135: ; preds = %111, %111, %111, %111, %111, %111, %111, %111, %111
%136 = load i8*, i8** %3
%137 = load i32, i32* %5
%138 = add nsw i32 %137, 1
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i8, i8* %136, i64 %139
%141 = load i8, i8* %140
%142 = call i8* @debug_register_description(i8 zeroext %141)
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i8* %142)
%144 = load i8*, i8** %3
%145 = load i32, i32* %5
%146 = add nsw i32 %145, 2
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i8, i8* %144, i64 %147
%149 = load i8, i8* %148
%150 = zext i8 %149 to i32
%151 = shl i32 %150, 24
store i32 %151, i32* %8
%152 = load i8*, i8** %3
%153 = load i32, i32* %5
%154 = add nsw i32 %153, 3
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i8, i8* %152, i64 %155
%157 = load i8, i8* %156
%158 = zext i8 %157 to i32
%159 = shl i32 %158, 16
%160 = load i32, i32* %8
%161 = or i32 %160, %159
store i32 %161, i32* %8
%162 = load i8*, i8** %3
%163 = load i32, i32* %5
%164 = add nsw i32 %163, 4
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds i8, i8* %162, i64 %165
%167 = load i8, i8* %166
%168 = zext i8 %167 to i32
%169 = shl i32 %168, 8
%170 = load i32, i32* %8
%171 = or i32 %170, %169
store i32 %171, i32* %8
%172 = load i8*, i8** %3
%173 = load i32, i32* %5
%174 = add nsw i32 %173, 5
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds i8, i8* %172, i64 %175
%177 = load i8, i8* %176
%178 = zext i8 %177 to i32
%179 = load i32, i32* %8
%180 = or i32 %179, %178
store i32 %180, i32* %8
%181 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%182 = load i32, i32* %8
%183 = load i32, i32* %5
%184 = load i32, i32* %8
%185 = add nsw i32 %183, %184
%186 = call i32 @sprintf(i8* %181, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.26, i64 0, i64 0), i32 %182, i32 %185)
%187 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i8* %187)
br label %313
189: ; preds = %111, %111
%190 = load i8*, i8** %3
%191 = load i32, i32* %5
%192 = add nsw i32 %191, 1
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds i8, i8* %190, i64 %193
%195 = load i8, i8* %194
%196 = call i8* @debug_register_description(i8 zeroext %195)
%197 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i8* %196)
br label %313
198: ; preds = %111
%199 = load i8*, i8** %3
%200 = load i32, i32* %5
%201 = add nsw i32 %200, 1
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds i8, i8* %199, i64 %202
%204 = load i8, i8* %203
%205 = call i8* @debug_register_description(i8 zeroext %204)
%206 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i8* %205)
%207 = load i8*, i8** %3
%208 = load i32, i32* %5
%209 = add nsw i32 %208, 2
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds i8, i8* %207, i64 %210
%212 = load i8, i8* %211
%213 = call i8* @debug_register_description(i8 zeroext %212)
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0), i8* %213)
br label %313
215: ; preds = %111
%216 = load i8*, i8** %3
%217 = load i32, i32* %5
%218 = add nsw i32 %217, 1
%219 = sext i32 %218 to i64
%220 = getelementptr inbounds i8, i8* %216, i64 %219
%221 = load i8, i8* %220
%222 = call i8* @debug_register_description(i8 zeroext %221)
%223 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.28, i64 0, i64 0), i8* %222)
%224 = load i8*, i8** %3
%225 = load i32, i32* %5
%226 = add nsw i32 %225, 2
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds i8, i8* %224, i64 %227
%229 = load i8, i8* %228
%230 = call i8* @debug_register_description(i8 zeroext %229)
%231 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i8* %230)
br label %313
232: ; preds = %111
%233 = load i8*, i8** %3
%234 = load i32, i32* %5
%235 = add nsw i32 %234, 1
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds i8, i8* %233, i64 %236
%238 = load i8, i8* %237
%239 = call i8* @debug_register_description(i8 zeroext %238)
%240 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.29, i64 0, i64 0), i8* %239)
%241 = load i8*, i8** %3
%242 = load i32, i32* %5
%243 = add nsw i32 %242, 2
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds i8, i8* %241, i64 %244
%246 = load i8, i8* %245
%247 = call i8* @debug_register_description(i8 zeroext %246)
%248 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i64 0, i64 0), i8* %247)
br label %313
249: ; preds = %111
%250 = load i8*, i8** %3
%251 = load i32, i32* %5
%252 = add nsw i32 %251, 1
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds i8, i8* %250, i64 %253
%255 = load i8, i8* %254
%256 = call i8* @debug_register_description(i8 zeroext %255)
%257 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.29, i64 0, i64 0), i8* %256)
%258 = load i8*, i8** %3
%259 = load i32, i32* %5
%260 = add nsw i32 %259, 2
%261 = sext i32 %260 to i64
%262 = getelementptr inbounds i8, i8* %258, i64 %261
%263 = load i8, i8* %262
%264 = call i8* @debug_register_description(i8 zeroext %263)
%265 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i64 0, i64 0), i8* %264)
br label %313
266: ; preds = %111, %111, %111, %111, %111, %111
%267 = load i8*, i8** %3
%268 = load i32, i32* %5
%269 = add nsw i32 %268, 1
%270 = sext i32 %269 to i64
%271 = getelementptr inbounds i8, i8* %267, i64 %270
%272 = load i8, i8* %271
%273 = zext i8 %272 to i32
%274 = shl i32 %273, 24
store i32 %274, i32* %8
%275 = load i8*, i8** %3
%276 = load i32, i32* %5
%277 = add nsw i32 %276, 2
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds i8, i8* %275, i64 %278
%280 = load i8, i8* %279
%281 = zext i8 %280 to i32
%282 = shl i32 %281, 16
%283 = load i32, i32* %8
%284 = or i32 %283, %282
store i32 %284, i32* %8
%285 = load i8*, i8** %3
%286 = load i32, i32* %5
%287 = add nsw i32 %286, 3
%288 = sext i32 %287 to i64
%289 = getelementptr inbounds i8, i8* %285, i64 %288
%290 = load i8, i8* %289
%291 = zext i8 %290 to i32
%292 = shl i32 %291, 8
%293 = load i32, i32* %8
%294 = or i32 %293, %292
store i32 %294, i32* %8
%295 = load i8*, i8** %3
%296 = load i32, i32* %5
%297 = add nsw i32 %296, 4
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds i8, i8* %295, i64 %298
%300 = load i8, i8* %299
%301 = zext i8 %300 to i32
%302 = load i32, i32* %8
%303 = or i32 %302, %301
store i32 %303, i32* %8
%304 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%305 = load i32, i32* %8
%306 = load i32, i32* %5
%307 = load i32, i32* %8
%308 = add nsw i32 %306, %307
%309 = add nsw i32 %308, 5
%310 = call i32 @sprintf(i8* %304, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.26, i64 0, i64 0), i32 %305, i32 %309)
%311 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%312 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i8* %311)
br label %313
313: ; preds = %111, %266, %249, %232, %215, %198, %189, %135, %118
%314 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.31, i64 0, i64 0))
%315 = load i32, i32* @stdout
%316 = call i32 @fflush(i32 %315)
%317 = load i32, i32* %7
%318 = load i32, i32* %5
%319 = add nsw i32 %318, %317
store i32 %319, i32* %5
br label %320
320: ; preds = %313, %25
br label %10
321: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%08x \00"
@.str.1 = [6 x i8] c"%02x\0A\00"
@.str.2 = [3 x i8] c" \00"
@.str.3 = [5 x i8] c"%02x\00"
@.str.4 = [6 x i8] c"ADD \00"
@.str.5 = [6 x i8] c"SUB \00"
@.str.6 = [6 x i8] c"MUL \00"
@.str.7 = [6 x i8] c"DIV \00"
@.str.8 = [6 x i8] c"MOD \00"
@.str.9 = [6 x i8] c"AND \00"
@.str.10 = [5 x i8] c"OR \00"
@.str.11 = [6 x i8] c"XOR \00"
@.str.12 = [6 x i8] c"MOV \00"
@.str.13 = [6 x i8] c"JMP \00"
@.str.14 = [6 x i8] c"JZ \00"
@.str.15 = [6 x i8] c"JE \00"
@.str.16 = [6 x i8] c"JG \00"
@.str.17 = [6 x i8] c"CALL \00"
@.str.18 = [6 x i8] c"RET \00"
@.str.19 = [6 x i8] c"PUSH \00"
@.str.20 = [6 x i8] c"POP \00"
@.str.21 = [6 x i8] c"CMP \00"
@.str.22 = [6 x i8] c"HLT \00"
@.str.23 = [6 x i8] c"NOP \00"
@.str.24 = [5 x i8] c"%s, \00"
@.str.25 = [3 x i8] c"%s\00"
@.str.26 = [10 x i8] c"%d (%08x)\00"
@.str.27 = [5 x i8] c"[%s]\00"
@.str.28 = [7 x i8] c"[%s], \00"
@.str.29 = [11 x i8] c"%s, BYTE [\00"
@.str.30 = [4 x i8] c"%s]\00"
@stdout = global i32 0
define void @disassemble(i8* %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %214
6: ; preds = %2, %211
%7 = phi i32 [ %212, %211 ], [ 0, %2 ]
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = call i32 @debug_instruction_size(i8 zeroext %11)
%13 = icmp slt i32 %12, 1
br i1 %13, label %16, label %14
14: ; preds = %6
%15 = icmp ult i32 %12, 8
br i1 %15, label %25, label %23
16: ; preds = %6
%17 = load i8, i8* %10
%18 = zext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = add nsw i32 %7, 1
br label %211
21: ; preds = %25
%22 = icmp sgt i32 %12, 0
br i1 %22, label %23, label %39
23: ; preds = %14, %21
%24 = zext i32 %12 to i64
br label %30
25: ; preds = %14, %25
%26 = phi i32 [ %28, %25 ], [ %12, %14 ]
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%28 = add i32 %26, 1
%29 = icmp eq i32 %28, 8
br i1 %29, label %21, label %25
30: ; preds = %23, %30
%31 = phi i64 [ 0, %23 ], [ %37, %30 ]
%32 = add nsw i64 %31, %9
%33 = getelementptr inbounds i8, i8* %0, i64 %32
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = add nuw nsw i64 %31, 1
%38 = icmp eq i64 %37, %24
br i1 %38, label %39, label %30
39: ; preds = %30, %21
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%41 = load i8, i8* %10
switch i8 %41, label %65 [
i8 1, label %61
i8 6, label %61
i8 2, label %42
i8 3, label %43
i8 13, label %43
i8 4, label %44
i8 14, label %44
i8 5, label %45
i8 15, label %45
i8 7, label %46
i8 8, label %46
i8 9, label %47
i8 10, label %47
i8 11, label %48
i8 12, label %48
i8 16, label %49
i8 17, label %49
i8 18, label %49
i8 19, label %49
i8 20, label %49
i8 21, label %49
i8 32, label %50
i8 33, label %51
i8 34, label %52
i8 35, label %53
i8 48, label %54
i8 49, label %55
i8 50, label %56
i8 52, label %56
i8 51, label %57
i8 64, label %58
i8 65, label %58
i8 -128, label %59
i8 -112, label %60
]
42: ; preds = %39
br label %61
43: ; preds = %39, %39
br label %61
44: ; preds = %39, %39
br label %61
45: ; preds = %39, %39
br label %61
46: ; preds = %39, %39
br label %61
47: ; preds = %39, %39
br label %61
48: ; preds = %39, %39
br label %61
49: ; preds = %39, %39, %39, %39, %39, %39
br label %61
50: ; preds = %39
br label %61
51: ; preds = %39
br label %61
52: ; preds = %39
br label %61
53: ; preds = %39
br label %61
54: ; preds = %39
br label %61
55: ; preds = %39
br label %61
56: ; preds = %39, %39
br label %61
57: ; preds = %39
br label %61
58: ; preds = %39, %39
br label %61
59: ; preds = %39
br label %61
60: ; preds = %39
br label %61
61: ; preds = %39, %39, %42, %43, %44, %45, %46, %47, %48, %49, %50, %51, %52, %53, %54, %55, %56, %57, %58, %59, %60
%62 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), %42 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), %43 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), %44 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), %45 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), %46 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), %47 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), %48 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), %49 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), %50 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), %51 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), %52 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), %53 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0), %54 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), %55 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), %56 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), %57 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0), %58 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0), %59 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0), %60 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %39 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %39 ]
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %62)
%64 = load i8, i8* %10
br label %65
65: ; preds = %61, %39
%66 = phi i8 [ %64, %61 ], [ %41, %39 ]
switch i8 %66, label %206 [
i8 1, label %67
i8 17, label %67
i8 2, label %67
i8 3, label %67
i8 4, label %67
i8 5, label %67
i8 64, label %67
i8 7, label %67
i8 9, label %67
i8 11, label %67
i8 6, label %80
i8 13, label %80
i8 14, label %80
i8 15, label %80
i8 16, label %80
i8 65, label %80
i8 8, label %80
i8 10, label %80
i8 12, label %80
i8 50, label %116
i8 51, label %116
i8 18, label %123
i8 19, label %136
i8 20, label %149
i8 21, label %162
i8 32, label %175
i8 33, label %175
i8 34, label %175
i8 35, label %175
i8 48, label %175
i8 52, label %175
]
67: ; preds = %65, %65, %65, %65, %65, %65, %65, %65, %65, %65
%68 = add nsw i32 %7, 1
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8, i8* %0, i64 %69
%71 = load i8, i8* %70
%72 = call i8* @debug_register_description(i8 zeroext %71)
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i8* %72)
%74 = add nsw i32 %7, 2
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8, i8* %0, i64 %75
%77 = load i8, i8* %76
%78 = call i8* @debug_register_description(i8 zeroext %77)
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i8* %78)
br label %206
80: ; preds = %65, %65, %65, %65, %65, %65, %65, %65, %65
%81 = add nsw i32 %7, 1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8, i8* %0, i64 %82
%84 = load i8, i8* %83
%85 = call i8* @debug_register_description(i8 zeroext %84)
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i8* %85)
%87 = add nsw i32 %7, 2
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8, i8* %0, i64 %88
%90 = load i8, i8* %89
%91 = zext i8 %90 to i32
%92 = shl nuw i32 %91, 24
%93 = add nsw i32 %7, 3
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i8, i8* %0, i64 %94
%96 = load i8, i8* %95
%97 = zext i8 %96 to i32
%98 = shl nuw nsw i32 %97, 16
%99 = or i32 %98, %92
%100 = add nsw i32 %7, 4
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i8, i8* %0, i64 %101
%103 = load i8, i8* %102
%104 = zext i8 %103 to i32
%105 = shl nuw nsw i32 %104, 8
%106 = or i32 %99, %105
%107 = add nsw i32 %7, 5
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i8, i8* %0, i64 %108
%110 = load i8, i8* %109
%111 = zext i8 %110 to i32
%112 = or i32 %106, %111
%113 = add nsw i32 %112, %7
%114 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.26, i64 0, i64 0), i32 %112, i32 %113)
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i8* %4)
br label %206
116: ; preds = %65, %65
%117 = add nsw i32 %7, 1
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8, i8* %0, i64 %118
%120 = load i8, i8* %119
%121 = call i8* @debug_register_description(i8 zeroext %120)
%122 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i8* %121)
br label %206
123: ; preds = %65
%124 = add nsw i32 %7, 1
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds i8, i8* %0, i64 %125
%127 = load i8, i8* %126
%128 = call i8* @debug_register_description(i8 zeroext %127)
%129 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i8* %128)
%130 = add nsw i32 %7, 2
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i8, i8* %0, i64 %131
%133 = load i8, i8* %132
%134 = call i8* @debug_register_description(i8 zeroext %133)
%135 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0), i8* %134)
br label %206
136: ; preds = %65
%137 = add nsw i32 %7, 1
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds i8, i8* %0, i64 %138
%140 = load i8, i8* %139
%141 = call i8* @debug_register_description(i8 zeroext %140)
%142 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.28, i64 0, i64 0), i8* %141)
%143 = add nsw i32 %7, 2
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds i8, i8* %0, i64 %144
%146 = load i8, i8* %145
%147 = call i8* @debug_register_description(i8 zeroext %146)
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i8* %147)
br label %206
149: ; preds = %65
%150 = add nsw i32 %7, 1
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds i8, i8* %0, i64 %151
%153 = load i8, i8* %152
%154 = call i8* @debug_register_description(i8 zeroext %153)
%155 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.29, i64 0, i64 0), i8* %154)
%156 = add nsw i32 %7, 2
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds i8, i8* %0, i64 %157
%159 = load i8, i8* %158
%160 = call i8* @debug_register_description(i8 zeroext %159)
%161 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i64 0, i64 0), i8* %160)
br label %206
162: ; preds = %65
%163 = add nsw i32 %7, 1
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds i8, i8* %0, i64 %164
%166 = load i8, i8* %165
%167 = call i8* @debug_register_description(i8 zeroext %166)
%168 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.29, i64 0, i64 0), i8* %167)
%169 = add nsw i32 %7, 2
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds i8, i8* %0, i64 %170
%172 = load i8, i8* %171
%173 = call i8* @debug_register_description(i8 zeroext %172)
%174 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i64 0, i64 0), i8* %173)
br label %206
175: ; preds = %65, %65, %65, %65, %65, %65
%176 = add nsw i32 %7, 1
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds i8, i8* %0, i64 %177
%179 = load i8, i8* %178
%180 = zext i8 %179 to i32
%181 = shl nuw i32 %180, 24
%182 = add nsw i32 %7, 2
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds i8, i8* %0, i64 %183
%185 = load i8, i8* %184
%186 = zext i8 %185 to i32
%187 = shl nuw nsw i32 %186, 16
%188 = or i32 %187, %181
%189 = add nsw i32 %7, 3
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds i8, i8* %0, i64 %190
%192 = load i8, i8* %191
%193 = zext i8 %192 to i32
%194 = shl nuw nsw i32 %193, 8
%195 = or i32 %188, %194
%196 = add nsw i32 %7, 4
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds i8, i8* %0, i64 %197
%199 = load i8, i8* %198
%200 = zext i8 %199 to i32
%201 = or i32 %195, %200
%202 = add i32 %7, 5
%203 = add i32 %202, %201
%204 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.26, i64 0, i64 0), i32 %201, i32 %203)
%205 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i8* %4)
br label %206
206: ; preds = %65, %175, %162, %149, %136, %123, %116, %80, %67
%207 = call i32 @putchar(i32 10)
%208 = load i32, i32* @stdout
%209 = call i32 @fflush(i32 %208)
%210 = add nsw i32 %12, %7
br label %211
211: ; preds = %206, %16
%212 = phi i32 [ %20, %16 ], [ %210, %206 ]
%213 = icmp slt i32 %212, %1
br i1 %213, label %6, label %214
214: ; preds = %211, %2
ret void
}