#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 */
typedef int uint8_t;
typedef int uint32_t;
typedef int uint16_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ _bytecode_read(int, int *, int *, int *, int *, int *,
                                  int *);
int bitfield(int);
int /*<<< orphan*/ printf(char *, ...);
int cpu_execute(uint32_t *instructions, int instructions_size, uint8_t *memory,
                int memory_bytes, int entry_point) {
  uint32_t *end = instructions + instructions_size;
  uint8_t *stack = memory + memory_bytes;
  uint32_t *ip = instructions + entry_point;
  uint32_t registers[4];
  printf("\n");
  printf("%d instructions: %p\n", instructions_size, instructions);
  while (ip != end) {
    uint32_t value;
    uint8_t code, r0, r1, r2;
    uint16_t addr;
    _bytecode_read(*ip, &code, &value, &addr, &r0, &r1, &r2);
    printf("[%d] %8x\n", (int)(ip - instructions), *ip);
    printf("  c: %d r0: %d r1: %d r2: %d addr: %d value: %d\n  ", code, r0, r1,
           r2, addr, value);
    uint8_t *begin = stack;
    int i = 0;
    for (; begin != memory + memory_bytes; i++) {
      printf("%02x ", *begin);
      if ((i % 16) == 15) {
        printf("\n  ");
      }
      begin++;
    }
    printf("\n");
    switch (code) {
    case 0:
      stack -= 4;
      *((uint32_t *)stack) = value;
      break;
    case 1:
      stack -= r1;
      *((uint32_t *)stack) = registers[r0] & bitfield(r1);
      break;
    case 2: {
      registers[r0] = ((*(uint32_t *)(stack)) & bitfield(r1));
      stack += r1;
    } break;
    case 8: {
      registers[r0] = ((*(uint32_t *)(stack)));
      stack += 4;
    } break;
    case 10: {
      stack -= 4;
      *((uint32_t *)stack) = (uint32_t)((ip - instructions));
    } break;
    case 9: {
      ip = instructions + registers[r0];
    } break;
    case 11: {
      stack -= 4;
      *((uint32_t *)stack) = (uint32_t)((ip - instructions));
      ip = instructions + registers[r0];
    } break;
    case 12: {
      ip = (instructions + (*(uint32_t *)(stack)));
      stack += 4;
    } break;
    case 3:
      registers[r0] = (*(uint32_t *)(stack + r1) & bitfield(r2));
      break;
    case 6:
      registers[r0] = *(uint32_t *)(memory + addr);
      break;
    case 7:
      *(uint32_t *)(memory + addr) = registers[r0];
      break;
    case 22: {
      int32_t a = *(int32_t *)&registers[r0];
      int32_t b = *(int32_t *)&registers[r1];
      int32_t res = a + b;
      registers[r2] = *(uint32_t *)&(res);
    } break;
    case 23: {
      int32_t b = *(int32_t *)&registers[r0];
      int32_t a = *(int32_t *)&registers[r1];
      int32_t res = a - b;
      registers[r2] = *(uint32_t *)&(res);
    } break;
    case 24: {
      int32_t a = *(int32_t *)&registers[r0];
      int32_t b = *(int32_t *)&registers[r1];
      int32_t res = a * b;
      registers[r2] = *(uint32_t *)&(res);
    } break;
    case 25: {
      int32_t b = *(int32_t *)&registers[r0];
      int32_t a = *(int32_t *)&registers[r1];
      int32_t res = a / b;
      registers[r2] = *(uint32_t *)&(res);
    } break;
    case 4:
      ip = instructions + addr;
      break;
    case 5:
      return *((int32_t *)&value);
    default:
      printf("Unhandled instruction [%d]: %d", code, *ip);
    }
    ip++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cpu_execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%rax
cmp    -0x30(%rbp),%rax
je     15df <cpu_execute+0x4af>
mov    -0x40(%rbp),%rax
mov    (%rax),%edi
lea    -0x58(%rbp),%rsi
lea    -0x54(%rbp),%rdx
lea    -0x68(%rbp),%rcx
lea    -0x5c(%rbp),%r8
lea    -0x60(%rbp),%r9
lea    -0x64(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <_bytecode_read@plt>
mov    -0x40(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,%esi
mov    -0x40(%rbp),%rax
mov    (%rax),%edx
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x58(%rbp),%esi
mov    -0x5c(%rbp),%edx
mov    -0x60(%rbp),%ecx
mov    -0x64(%rbp),%r8d
mov    -0x68(%rbp),%r9d
mov    -0x54(%rbp),%eax
lea    0xe69(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x70(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x24(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
je     12a3 <cpu_execute+0x173>
mov    -0x70(%rbp),%rax
mov    (%rax),%esi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0xf,%edx
jne    1289 <cpu_execute+0x159>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x70(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x70(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1237 <cpu_execute+0x107>
lea    0xdd1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x58(%rbp),%eax
mov    %rax,-0xb0(%rbp)
sub    $0x19,%rax
ja     15b7 <cpu_execute+0x487>
mov    -0xb0(%rbp),%rax
lea    0xd2d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x38(%rbp),%rax
add    $0xfffffffffffffff0,%rax
mov    %rax,-0x38(%rbp)
mov    -0x54(%rbp),%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
jmp    15ce <cpu_execute+0x49e>
mov    -0x60(%rbp),%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
movslq -0x5c(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
mov    %eax,-0xb4(%rbp)
mov    -0x60(%rbp),%edi
call   1050 <bitfield@plt>
mov    -0xb4(%rbp),%ecx
and    %eax,%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
jmp    15ce <cpu_execute+0x49e>
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xb8(%rbp)
mov    -0x60(%rbp),%edi
call   1050 <bitfield@plt>
mov    -0xb8(%rbp),%ecx
and    %eax,%ecx
movslq -0x5c(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
mov    -0x60(%rbp),%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
jmp    15ce <cpu_execute+0x49e>
mov    -0x38(%rbp),%rax
mov    (%rax),%ecx
movslq -0x5c(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
mov    -0x38(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x38(%rbp)
jmp    15ce <cpu_execute+0x49e>
mov    -0x38(%rbp),%rax
add    $0xfffffffffffffff0,%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
jmp    15ce <cpu_execute+0x49e>
mov    -0x10(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movslq -0x50(%rbp,%rcx,4),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
jmp    15ce <cpu_execute+0x49e>
mov    -0x38(%rbp),%rax
add    $0xfffffffffffffff0,%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movslq -0x50(%rbp,%rcx,4),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
jmp    15ce <cpu_execute+0x49e>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x38(%rbp)
jmp    15ce <cpu_execute+0x49e>
mov    -0x38(%rbp),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xbc(%rbp)
mov    -0x64(%rbp),%edi
call   1050 <bitfield@plt>
mov    -0xbc(%rbp),%ecx
and    %eax,%ecx
movslq -0x5c(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
jmp    15ce <cpu_execute+0x49e>
mov    -0x20(%rbp),%rax
movslq -0x68(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x5c(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
jmp    15ce <cpu_execute+0x49e>
movslq -0x5c(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%edx
mov    -0x20(%rbp),%rax
movslq -0x68(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    15ce <cpu_execute+0x49e>
movslq -0x5c(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
mov    %eax,-0x78(%rbp)
movslq -0x60(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x78(%rbp),%eax
add    -0x7c(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x80(%rbp),%ecx
movslq -0x64(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
jmp    15ce <cpu_execute+0x49e>
movslq -0x5c(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
mov    %eax,-0x84(%rbp)
movslq -0x60(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
mov    %eax,-0x88(%rbp)
mov    -0x88(%rbp),%eax
sub    -0x84(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x8c(%rbp),%ecx
movslq -0x64(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
jmp    15ce <cpu_execute+0x49e>
movslq -0x5c(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
mov    %eax,-0x90(%rbp)
movslq -0x60(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
mov    %eax,-0x94(%rbp)
mov    -0x90(%rbp),%eax
imul   -0x94(%rbp),%eax
mov    %eax,-0x98(%rbp)
mov    -0x98(%rbp),%ecx
movslq -0x64(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
jmp    15ce <cpu_execute+0x49e>
movslq -0x5c(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
mov    %eax,-0x9c(%rbp)
movslq -0x60(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
mov    %eax,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cltd
idivl  -0x9c(%rbp)
mov    %eax,-0xa4(%rbp)
mov    -0xa4(%rbp),%ecx
movslq -0x64(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
jmp    15ce <cpu_execute+0x49e>
mov    -0x10(%rbp),%rax
movslq -0x68(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
jmp    15ce <cpu_execute+0x49e>
mov    -0x54(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15e6 <cpu_execute+0x4b6>
mov    -0x58(%rbp),%esi
mov    -0x40(%rbp),%rax
mov    (%rax),%edx
lea    0xaf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x40(%rbp)
jmp    11a9 <cpu_execute+0x79>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_execute>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r8d,%r15d
mov    %ecx,%r13d
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xefb(%rip),%rdi
xor    %r12d,%r12d
mov    %ebp,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %ebp,%r15d
je     1494 <cpu_execute+0x354>
movslq %ebp,%rax
lea    (%r14,%rax,4),%rax
mov    %rax,0x60(%rsp)
movslq %r13d,%rax
mov    %rbx,0x58(%rsp)
lea    (%rbx,%rax,4),%r12
movslq %r15d,%rax
lea    (%r14,%rax,4),%r15
lea    0xf0f(%rip),%r13
mov    %r12,0x20(%rsp)
mov    %r14,%rbx
mov    %r14,0x18(%rsp)
jmp    11e9 <cpu_execute+0xa9>
movslq 0x10(%rsp),%rax
movslq 0x14(%rsp),%rcx
mov    0x30(%rsp,%rcx,4),%ecx
add    0x30(%rsp,%rax,4),%ecx
movslq 0x2c(%rsp),%rax
mov    %ecx,0x30(%rsp,%rax,4)
mov    0x18(%rsp),%rbx
add    $0x4,%r15
cmp    0x60(%rsp),%r15
je     1491 <cpu_execute+0x351>
mov    (%r15),%edi
lea    0x2c(%rsp),%rax
mov    %rax,(%rsp)
lea    0x54(%rsp),%rsi
lea    0x50(%rsp),%rdx
lea    0x4c(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0x14(%rsp),%r9
call   1050 <_bytecode_read@plt>
mov    %r15,%r14
sub    %rbx,%r14
shr    $0x2,%r14
mov    (%r15),%edx
lea    0xe56(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x54(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0x14(%rsp),%ecx
mov    0x2c(%rsp),%r8d
mov    0x4c(%rsp),%r9d
mov    0x50(%rsp),%eax
mov    %eax,(%rsp)
lea    0xe32(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %r12,0x20(%rsp)
je     12b0 <cpu_execute+0x170>
xor    %ebx,%ebx
mov    0x20(%rsp),%rbp
jmp    127c <cpu_execute+0x13c>
nopl   0x0(%rax)
add    $0x4,%rbp
add    $0x1,%ebx
cmp    %r12,%rbp
je     12b0 <cpu_execute+0x170>
mov    0x0(%rbp),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
not    %eax
test   $0xf,%al
jne    1270 <cpu_execute+0x130>
lea    0xe1e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1270 <cpu_execute+0x130>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x54(%rsp),%esi
cmp    $0x19,%rsi
ja     142b <cpu_execute+0x2eb>
lea    0xd31(%rip),%rcx
movslq (%rcx,%rsi,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x50(%rsp),%eax
mov    0x20(%rsp),%rcx
mov    %eax,-0x10(%rcx)
add    $0xfffffffffffffff0,%rcx
mov    %rcx,0x20(%rsp)
jmp    11d5 <cpu_execute+0x95>
movslq 0x14(%rsp),%rdi
mov    %rdi,%rax
shl    $0x2,%rax
mov    0x20(%rsp),%rbp
sub    %rax,%rbp
movslq 0x10(%rsp),%rax
mov    0x30(%rsp,%rax,4),%ebx
call   1060 <bitfield@plt>
and    %ebx,%eax
mov    %rbp,0x20(%rsp)
mov    %eax,0x0(%rbp)
jmp    11d5 <cpu_execute+0x95>
mov    0x20(%rsp),%rbp
mov    0x0(%rbp),%ebx
mov    0x14(%rsp),%edi
call   1060 <bitfield@plt>
and    %ebx,%eax
movslq 0x10(%rsp),%rcx
mov    %eax,0x30(%rsp,%rcx,4)
movslq 0x14(%rsp),%rax
lea    0x0(%rbp,%rax,4),%rbp
mov    %rbp,0x20(%rsp)
jmp    11d5 <cpu_execute+0x95>
movslq 0x14(%rsp),%rax
mov    0x20(%rsp),%rcx
mov    (%rcx,%rax,4),%ebx
mov    0x2c(%rsp),%edi
call   1060 <bitfield@plt>
and    %ebx,%eax
jmp    1384 <cpu_execute+0x244>
movslq 0x4c(%rsp),%rax
jmp    13fe <cpu_execute+0x2be>
movslq 0x4c(%rsp),%rax
mov    0x58(%rsp),%rcx
mov    (%rcx,%rax,4),%eax
movslq 0x10(%rsp),%rcx
mov    %eax,0x30(%rsp,%rcx,4)
jmp    11d5 <cpu_execute+0x95>
movslq 0x10(%rsp),%rax
mov    0x30(%rsp,%rax,4),%eax
movslq 0x4c(%rsp),%rcx
mov    0x58(%rsp),%rdx
mov    %eax,(%rdx,%rcx,4)
jmp    11d5 <cpu_execute+0x95>
mov    0x20(%rsp),%rdx
mov    (%rdx),%eax
movslq 0x10(%rsp),%rcx
mov    %eax,0x30(%rsp,%rcx,4)
add    $0x10,%rdx
mov    %rdx,0x20(%rsp)
jmp    11d5 <cpu_execute+0x95>
mov    0x20(%rsp),%rax
mov    %r14d,-0x10(%rax)
add    $0xfffffffffffffff0,%rax
mov    %rax,0x20(%rsp)
jmp    11d5 <cpu_execute+0x95>
mov    0x20(%rsp),%rax
mov    %r14d,-0x10(%rax)
add    $0xfffffffffffffff0,%rax
mov    %rax,0x20(%rsp)
movslq 0x10(%rsp),%rax
movslq 0x30(%rsp,%rax,4),%rax
mov    0x18(%rsp),%rbx
lea    (%rbx,%rax,4),%r15
jmp    11da <cpu_execute+0x9a>
mov    0x20(%rsp),%rcx
movslq (%rcx),%rax
mov    0x18(%rsp),%rbx
lea    (%rbx,%rax,4),%r15
add    $0x10,%rcx
mov    %rcx,0x20(%rsp)
jmp    11da <cpu_execute+0x9a>
mov    (%r15),%edx
lea    0xc8b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11d5 <cpu_execute+0x95>
movslq 0x10(%rsp),%rax
movslq 0x14(%rsp),%rcx
mov    0x30(%rsp,%rcx,4),%ecx
sub    0x30(%rsp,%rax,4),%ecx
jmp    11cc <cpu_execute+0x8c>
movslq 0x10(%rsp),%rax
movslq 0x14(%rsp),%rcx
mov    0x30(%rsp,%rcx,4),%ecx
imul   0x30(%rsp,%rax,4),%ecx
jmp    11cc <cpu_execute+0x8c>
movslq 0x10(%rsp),%rcx
movslq 0x14(%rsp),%rax
mov    0x30(%rsp,%rax,4),%eax
cltd
idivl  0x30(%rsp,%rcx,4)
movslq 0x2c(%rsp),%rcx
mov    %eax,0x30(%rsp,%rcx,4)
jmp    11d5 <cpu_execute+0x95>
xor    %r12d,%r12d
mov    %r12d,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x50(%rsp),%r12d
jmp    1494 <cpu_execute+0x354>

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

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