#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 /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ err(int, char *, char *);
int /*<<< orphan*/ errx(int, char *, char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
char *index(char *, char);
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int sscanf(char *, char *, int *, ...);
int main(int argc, char **argv) {
  FILE *f;
  int nblock, btype, x, z, width, height;
  char *fname, *levelname;
  char buf[128];
  int i;
  srand(0);
  if (argc != 2)
    errx(1, "Usage: %s levelfile", argv[0]);
  fname = argv[1];
  levelname = fname;
  while (index(levelname, '/'))
    levelname = index(levelname, '/') + 1;
  f = fopen(fname, "r");
  if (!f)
    err(1, "%s", fname);
  printf("uint8_t data_%s[] = {\n", levelname);
  if (!fgets(buf, sizeof(buf), f))
    err(1, "%s: Empty file?", fname);
  if (1 == sscanf(buf, "%d", &nblock)) {
    if (nblock < 1 || nblock > 255)
      errx(1, "%s: Invalid block count", fname);
    printf("\t\t0x%02x,\n", nblock & 255);
    printf("\t\t0x%02x,\n", nblock >> 8);
    for (i = 0; i < nblock; i++) {
      if (!fgets(buf, sizeof(buf), f))
        err(1, "%s: Unexpected EOF", fname);
      if (3 == sscanf(buf, "%d , %d , %d", &btype, &x, &z)) {
        printf("\t\t0x%02x, 0x%02x, 0x%02x, 0x%02x,\n", btype, rand() % 6, x,
               z);
      } else
        errx(1, "%s: Couldn't parse line", fname);
    }
  } else if (2 == sscanf(buf, "ascii %d %d", &width, &height)) {
    uint8_t buffer[65536 * 4];
    nblock = 0;
    for (z = 0; z < height; z++) {
      if (!fgets(buf, sizeof(buf), f))
        err(1, "%s: Unexpected EOF", fname);
      for (x = 0; x < width; x++) {
        if (buf[x] != '.') {
          if (nblock >= 65535)
            errx(1, "%s: Too many blocks", fname);
          switch (buf[x]) {
          case '*':
            buffer[nblock * 4 + 0] = 1;
            buffer[nblock * 4 + 1] = 0;
            break;
          case 'R':
            buffer[nblock * 4 + 0] = 1;
            buffer[nblock * 4 + 1] = rand() % 6;
            break;
          default:
            buffer[nblock * 4 + 0] = 0;
            buffer[nblock * 4 + 1] = buf[x] - '1';
            break;
          }
          buffer[nblock * 4 + 2] = x * 16;
          buffer[nblock * 4 + 3] = (height - 1 - z) * 16;
          nblock++;
        }
      }
    }
    printf("\t\t0x%02x,\n", nblock & 255);
    printf("\t\t0x%02x,\n", nblock >> 8);
    for (i = 0; i < nblock; i++) {
      printf("\t\t0x%02x, 0x%02x, 0x%02x, 0x%02x,\n", buffer[i * 4 + 0],
             buffer[i * 4 + 1], buffer[i * 4 + 2], buffer[i * 4 + 3]);
    }
  } else
    errx(1, "%s: Unsupported high-level format", fname);
  printf("};\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1000e0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1060 <srand@plt>
cmpl   $0x2,-0x8(%rbp)
je     11d2 <main+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    $0x1,%edi
lea    0xe33(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    $0x2f,%esi
call   1050 <index@plt>
cmp    $0x0,%rax
je     1219 <main+0x89>
mov    -0x40(%rbp),%rdi
mov    $0x2f,%esi
call   1050 <index@plt>
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    11e6 <main+0x56>
mov    -0x38(%rbp),%rdi
lea    0xdf0(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    124d <main+0xbd>
mov    -0x38(%rbp),%rdx
mov    $0x1,%edi
lea    0xdce(%rip),%rsi
call   1080 <err@plt>
mov    -0x40(%rbp),%rsi
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xc0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x80,%esi
call   1070 <fgets@plt>
cmp    $0x0,%eax
jne    1292 <main+0x102>
mov    -0x38(%rbp),%rdx
mov    $0x1,%edi
lea    0xda3(%rip),%rsi
call   1080 <err@plt>
lea    -0xc0(%rbp),%rdi
lea    0xde0(%rip),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jne    13f8 <main+0x268>
cmpl   $0x1,-0x1c(%rbp)
jl     12d1 <main+0x141>
cmpl   $0xff,-0x1c(%rbp)
jle    12e6 <main+0x156>
mov    -0x38(%rbp),%rdx
mov    $0x1,%edi
lea    0xd5f(%rip),%rsi
call   1030 <errx@plt>
mov    -0x1c(%rbp),%esi
and    $0xff,%esi
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
sar    $0x8,%esi
lea    0xd4e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc4(%rbp)
mov    -0xc4(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13f3 <main+0x263>
lea    -0xc0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x80,%esi
call   1070 <fgets@plt>
cmp    $0x0,%eax
jne    135d <main+0x1cd>
mov    -0x38(%rbp),%rdx
mov    $0x1,%edi
lea    0xd0b(%rip),%rsi
call   1080 <err@plt>
lea    -0xc0(%rbp),%rdi
lea    0xd0b(%rip),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
lea    -0x28(%rbp),%r8
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
jne    13c5 <main+0x235>
mov    -0x20(%rbp),%eax
mov    %eax,-0x1000d4(%rbp)
mov    $0x0,%al
call   10b0 <rand@plt>
mov    -0x1000d4(%rbp),%esi
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
lea    0xcca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13da <main+0x24a>
mov    -0x38(%rbp),%rdx
mov    $0x1,%edi
lea    0xcd1(%rip),%rsi
call   1030 <errx@plt>
jmp    13df <main+0x24f>
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
jmp    131b <main+0x18b>
jmp    16d2 <main+0x542>
lea    -0xc0(%rbp),%rdi
lea    0xcb8(%rip),%rsi
lea    -0x2c(%rbp),%rdx
lea    -0x30(%rbp),%rcx
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
jne    16b8 <main+0x528>
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    15f8 <main+0x468>
lea    -0xc0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x80,%esi
call   1070 <fgets@plt>
cmp    $0x0,%eax
jne    1471 <main+0x2e1>
mov    -0x38(%rbp),%rdx
mov    $0x1,%edi
lea    0xbf7(%rip),%rsi
call   1080 <err@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    15e5 <main+0x455>
movslq -0x24(%rbp),%rax
movsbl -0xc0(%rbp,%rax,1),%eax
ff
cmp    $0x2e,%eax
je     15d2 <main+0x442>
cmpl   $0xffff,-0x1c(%rbp)
jl     14bb <main+0x32b>
mov    -0x38(%rbp),%rdx
mov    $0x1,%edi
lea    0xc14(%rip),%rsi
call   1030 <errx@plt>
movslq -0x24(%rbp),%rax
movsbl -0xc0(%rbp,%rax,1),%eax
ff
mov    %eax,-0x1000d8(%rbp)
sub    $0x2a,%eax
je     14ef <main+0x35f>
jmp    14db <main+0x34b>
mov    -0x1000d8(%rbp),%eax
sub    $0x52,%eax
je     1520 <main+0x390>
jmp    155c <main+0x3cc>
mov    -0x1c(%rbp),%eax
shl    $0x2,%eax
add    $0x0,%eax
cltq
movl   $0x1,-0x1000d0(%rbp,%rax,4)
mov    -0x1c(%rbp),%eax
shl    $0x2,%eax
add    $0x1,%eax
cltq
movl   $0x0,-0x1000d0(%rbp,%rax,4)
jmp    1593 <main+0x403>
mov    -0x1c(%rbp),%eax
shl    $0x2,%eax
add    $0x0,%eax
cltq
movl   $0x1,-0x1000d0(%rbp,%rax,4)
mov    $0x0,%al
call   10b0 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%eax
shl    $0x2,%eax
add    $0x1,%eax
cltq
mov    %edx,-0x1000d0(%rbp,%rax,4)
jmp    1593 <main+0x403>
mov    -0x1c(%rbp),%eax
shl    $0x2,%eax
add    $0x0,%eax
cltq
movl   $0x0,-0x1000d0(%rbp,%rax,4)
movslq -0x24(%rbp),%rax
movsbl -0xc0(%rbp,%rax,1),%ecx
ff
sub    $0x31,%ecx
mov    -0x1c(%rbp),%eax
shl    $0x2,%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x1000d0(%rbp,%rax,4)
mov    -0x24(%rbp),%ecx
shl    $0x4,%ecx
mov    -0x1c(%rbp),%eax
shl    $0x2,%eax
add    $0x2,%eax
cltq
mov    %ecx,-0x1000d0(%rbp,%rax,4)
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
sub    -0x28(%rbp),%ecx
shl    $0x4,%ecx
mov    -0x1c(%rbp),%eax
shl    $0x2,%eax
add    $0x3,%eax
cltq
mov    %ecx,-0x1000d0(%rbp,%rax,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    15d7 <main+0x447>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1478 <main+0x2e8>
jmp    15ea <main+0x45a>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1432 <main+0x2a2>
mov    -0x1c(%rbp),%esi
and    $0xff,%esi
lea    0xa50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
sar    $0x8,%esi
lea    0xa3c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc4(%rbp)
mov    -0xc4(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    16b3 <main+0x523>
mov    -0xc4(%rbp),%eax
shl    $0x2,%eax
add    $0x0,%eax
cltq
mov    -0x1000d0(%rbp,%rax,4),%esi
mov    -0xc4(%rbp),%eax
shl    $0x2,%eax
add    $0x1,%eax
cltq
mov    -0x1000d0(%rbp,%rax,4),%edx
mov    -0xc4(%rbp),%eax
shl    $0x2,%eax
add    $0x2,%eax
cltq
mov    -0x1000d0(%rbp,%rax,4),%ecx
mov    -0xc4(%rbp),%eax
shl    $0x2,%eax
add    $0x3,%eax
cltq
mov    -0x1000d0(%rbp,%rax,4),%r8d
ff
lea    0x9eb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
jmp    162d <main+0x49d>
jmp    16cd <main+0x53d>
mov    -0x38(%rbp),%rdx
mov    $0x1,%edi
lea    0xa16(%rip),%rsi
call   1030 <errx@plt>
jmp    16d2 <main+0x542>
lea    0xa27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1000e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1000b8,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
call   1070 <srand@plt>
cmp    $0x2,%ebp
je     11d6 <main+0x36>
mov    (%rbx),%rdx
lea    0xe34(%rip),%rsi
mov    $0x1,%edi
call   1040 <errx@plt>
mov    0x8(%rbx),%r12
mov    %r12,%rdi
mov    $0x2f,%esi
call   1060 <index@plt>
mov    %r12,%rbx
test   %rax,%rax
je     1226 <main+0x86>
mov    %r12,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1060 <index@plt>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1060 <index@plt>
test   %rax,%rax
jne    1200 <main+0x60>
lea    0xde7(%rip),%rsi
mov    %r12,%rdi
call   10b0 <fopen@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1251 <main+0xb1>
lea    0xdd2(%rip),%rsi
mov    $0x1,%edi
mov    %r12,%rdx
call   1090 <err@plt>
lea    0xdc1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x30(%rsp),%rdi
mov    $0x80,%esi
mov    %rbp,%rdx
call   1080 <fgets@plt>
test   %eax,%eax
jne    128c <main+0xec>
lea    0xdb1(%rip),%rsi
mov    $0x1,%edi
mov    %r12,%rdx
call   1090 <err@plt>
lea    0xded(%rip),%rsi
lea    0x30(%rsp),%rdi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
jne    13fb <main+0x25b>
mov    0xc(%rsp),%eax
lea    -0x100(%rax),%ecx
cmp    $0xffffff00,%ecx
ja     12d8 <main+0x138>
lea    0xd7a(%rip),%rsi
mov    $0x1,%edi
mov    %r12,%rdx
call   1040 <errx@plt>
movzbl 0xc(%rsp),%eax
movzbl %al,%esi
lea    0xd76(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
sar    $0x8,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1659 <main+0x4b9>
lea    0x30(%rsp),%r15
lea    0xd62(%rip),%r13
lea    0xb0(%rsp),%r14
xor    %ebx,%ebx
mov    %r12,0x28(%rsp)
jmp    1351 <main+0x1b1>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%edi
lea    0xd6a(%rip),%rsi
mov    %r12,%rdx
call   1040 <errx@plt>
add    $0x1,%ebx
cmp    0xc(%rsp),%ebx
jge    1659 <main+0x4b9>
mov    %r15,%rdi
mov    $0x80,%esi
mov    %rbp,%rdx
call   1080 <fgets@plt>
test   %eax,%eax
jne    1379 <main+0x1d9>
mov    $0x1,%edi
lea    0xcf2(%rip),%rsi
mov    %r12,%rdx
call   1090 <err@plt>
mov    %r15,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
lea    0x18(%rsp),%rcx
lea    0x14(%rsp),%r8
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x3,%eax
jne    1330 <main+0x190>
mov    %r15,%r12
mov    %r14,%r15
mov    %r13,%r14
mov    0xb0(%rsp),%r13d
xor    %eax,%eax
call   10c0 <rand@plt>
movslq %eax,%rdx
imul   $0x2aaaaaab,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%edx
mov    0x18(%rsp),%ecx
mov    0x14(%rsp),%r8d
lea    0xca5(%rip),%rdi
mov    %r13d,%esi
mov    %r14,%r13
mov    %r15,%r14
mov    %r12,%r15
mov    0x28(%rsp),%r12
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1344 <main+0x1a4>
lea    0xcbc(%rip),%rsi
xor    %ebx,%ebx
lea    0x30(%rsp),%rdi
lea    0x1c(%rsp),%rdx
lea    0x10(%rsp),%rcx
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x2,%eax
jne    15ca <main+0x42a>
movl   $0x0,0xc(%rsp)
movl   $0x0,0x14(%rsp)
cmpl   $0x0,0x10(%rsp)
jle    15e5 <main+0x445>
mov    %rbp,0x20(%rsp)
lea    0xc80(%rip),%r13
xor    %ebp,%ebp
jmp    1461 <main+0x2c1>
xchg   %ax,%ax
add    $0x1,%ebp
mov    %ebp,0x14(%rsp)
cmp    0x10(%rsp),%ebp
jge    15e0 <main+0x440>
lea    0x30(%rsp),%rdi
mov    $0x80,%esi
mov    0x20(%rsp),%rdx
call   1080 <fgets@plt>
test   %eax,%eax
jne    148d <main+0x2ed>
mov    $0x1,%edi
lea    0xbde(%rip),%rsi
mov    %r12,%rdx
call   1090 <err@plt>
movl   $0x0,0x18(%rsp)
mov    0x1c(%rsp),%eax
test   %eax,%eax
jle    1450 <main+0x2b0>
mov    %ebp,%ebx
not    %ebx
xor    %r14d,%r14d
xor    %r15d,%r15d
jmp    1520 <main+0x380>
movslq 0xc(%rsp),%rcx
lea    0x0(,%rcx,4),%rdx
mov    %rcx,%rsi
shl    $0x4,%rsi
movl   $0x0,0xb0(%rsp,%rsi,1)
add    $0xffffffcf,%eax
mov    %edx,%esi
or     $0x1,%esi
movslq %esi,%rsi
mov    %eax,0xb0(%rsp,%rsi,4)
mov    %edx,%eax
or     $0x2,%eax
cltq
mov    %r14d,0xb0(%rsp,%rax,4)
mov    0x10(%rsp),%eax
add    %ebx,%eax
shl    $0x4,%eax
or     $0x3,%edx
movslq %edx,%rdx
mov    %eax,0xb0(%rsp,%rdx,4)
add    $0x1,%ecx
mov    %ecx,0xc(%rsp)
mov    0x1c(%rsp),%eax
add    $0x1,%r15
mov    %r15d,0x18(%rsp)
add    $0x10,%r14d
cmp    %eax,%r15d
jge    1450 <main+0x2b0>
movzbl 0x30(%rsp,%r15,1),%ecx
cmp    $0x2e,%cl
je     150a <main+0x36a>
cmpl   $0xffff,0xc(%rsp)
jl     154b <main+0x3ab>
mov    $0x1,%edi
mov    %r13,%rsi
mov    %r12,%rdx
call   1040 <errx@plt>
movzbl 0x30(%rsp,%r15,1),%ecx
movsbl %cl,%eax
cmp    $0x52,%eax
je     1582 <main+0x3e2>
cmp    $0x2a,%eax
jne    14a9 <main+0x309>
movslq 0xc(%rsp),%rcx
lea    0x0(,%rcx,4),%rdx
mov    %rcx,%rax
shl    $0x4,%rax
movl   $0x1,0xb0(%rsp,%rax,1)
xor    %eax,%eax
jmp    14cb <main+0x32b>
movslq 0xc(%rsp),%rax
shl    $0x4,%rax
movl   $0x1,0xb0(%rsp,%rax,1)
xor    %eax,%eax
call   10c0 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
mov    0xc(%rsp),%ecx
lea    0x0(,%rcx,4),%edx
jmp    14cb <main+0x32b>
lea    0xb0d(%rip),%rsi
mov    $0x1,%edi
mov    %r12,%rdx
call   1040 <errx@plt>
jmp    1659 <main+0x4b9>
movzbl 0xc(%rsp),%ebx
lea    0xa6c(%rip),%rbp
mov    %rbp,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
sar    $0x8,%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1659 <main+0x4b9>
lea    0xbc(%rsp),%rbp
lea    0xa64(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
mov    0x0(%rbp),%r8d
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
add    $0x10,%rbp
cmp    %rax,%rbx
jl     1630 <main+0x490>
lea    0xaa0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x1000b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Usage: %s levelfile\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [23 x i8] c"uint8_t data_%s[] = {\0A\00"
@.str.4 = [16 x i8] c"%s: Empty file?\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [24 x i8] c"%s: Invalid block count\00"
@.str.7 = [11 x i8] c"\09\090x%02x,\0A\00"
@.str.8 = [19 x i8] c"%s: Unexpected EOF\00"
@.str.9 = [13 x i8] c"%d , %d , %d\00"
@.str.10 = [35 x i8] c"\09\090x%02x, 0x%02x, 0x%02x, 0x%02x,\0A\00"
@.str.11 = [24 x i8] c"%s: Couldn't parse line\00"
@.str.12 = [12 x i8] c"ascii %d %d\00"
@.str.13 = [20 x i8] c"%s: Too many blocks\00"
@.str.14 = [34 x i8] c"%s: Unsupported high-level format\00"
@.str.15 = [4 x i8] c"};\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca [128 x i8]
%16 = alloca i32
%17 = alloca [262144 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = call i32 @srand(i32 0)
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 2
br i1 %20, label %21, label %26
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 @errx(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %24)
br label %26
26: ; preds = %21, %2
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
store i8* %29, i8** %13
%30 = load i8*, i8** %13
store i8* %30, i8** %14
br label %31
31: ; preds = %35, %26
%32 = load i8*, i8** %14
%33 = call i8* @index(i8* %32, i8 signext 47)
%34 = icmp ne i8* %33, null
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = load i8*, i8** %14
%37 = call i8* @index(i8* %36, i8 signext 47)
%38 = getelementptr inbounds i8, i8* %37, i64 1
store i8* %38, i8** %14
br label %31
39: ; preds = %31
%40 = load i8*, i8** %13
%41 = call i32* @fopen(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %41, i32** %6
%42 = load i32*, i32** %6
%43 = icmp ne i32* %42, null
br i1 %43, label %47, label %44
44: ; preds = %39
%45 = load i8*, i8** %13
%46 = call i32 @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %45)
br label %47
47: ; preds = %44, %39
%48 = load i8*, i8** %14
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* %48)
%50 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%51 = load i32*, i32** %6
%52 = call i32 @fgets(i8* %50, i32 128, i32* %51)
%53 = icmp ne i32 %52, 0
br i1 %53, label %57, label %54
54: ; preds = %47
%55 = load i8*, i8** %13
%56 = call i32 @err(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %55)
br label %57
57: ; preds = %54, %47
%58 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%59 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %7)
%60 = icmp eq i32 1, %59
br i1 %60, label %61, label %108
61: ; preds = %57
%62 = load i32, i32* %7
%63 = icmp slt i32 %62, 1
br i1 %63, label %67, label %64
64: ; preds = %61
%65 = load i32, i32* %7
%66 = icmp sgt i32 %65, 255
br i1 %66, label %67, label %70
67: ; preds = %64, %61
%68 = load i8*, i8** %13
%69 = call i32 @errx(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %68)
br label %70
70: ; preds = %67, %64
%71 = load i32, i32* %7
%72 = and i32 %71, 255
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 %72)
%74 = load i32, i32* %7
%75 = ashr i32 %74, 8
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 %75)
store i32 0, i32* %16
br label %77
77: ; preds = %104, %70
%78 = load i32, i32* %16
%79 = load i32, i32* %7
%80 = icmp slt i32 %78, %79
br i1 %80, label %81, label %107
81: ; preds = %77
%82 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%83 = load i32*, i32** %6
%84 = call i32 @fgets(i8* %82, i32 128, i32* %83)
%85 = icmp ne i32 %84, 0
br i1 %85, label %89, label %86
86: ; preds = %81
%87 = load i8*, i8** %13
%88 = call i32 @err(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* %87)
br label %89
89: ; preds = %86, %81
%90 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%91 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %90, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32* %8, i32* %9, i32* %10)
%92 = icmp eq i32 3, %91
br i1 %92, label %93, label %100
93: ; preds = %89
%94 = load i32, i32* %8
%95 = call i32 (...) @rand()
%96 = srem i32 %95, 6
%97 = load i32, i32* %9
%98 = load i32, i32* %10
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i32 %94, i32 %96, i32 %97, i32 %98)
br label %103
100: ; preds = %89
%101 = load i8*, i8** %13
%102 = call i32 @errx(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i8* %101)
br label %103
103: ; preds = %100, %93
br label %104
104: ; preds = %103
%105 = load i32, i32* %16
%106 = add nsw i32 %105, 1
store i32 %106, i32* %16
br label %77
107: ; preds = %77
br label %263
108: ; preds = %57
%109 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%110 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %109, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), i32* %11, i32* %12)
%111 = icmp eq i32 2, %110
br i1 %111, label %112, label %259
112: ; preds = %108
store i32 0, i32* %7
store i32 0, i32* %10
br label %113
113: ; preds = %215, %112
%114 = load i32, i32* %10
%115 = load i32, i32* %12
%116 = icmp slt i32 %114, %115
br i1 %116, label %117, label %218
117: ; preds = %113
%118 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%119 = load i32*, i32** %6
%120 = call i32 @fgets(i8* %118, i32 128, i32* %119)
%121 = icmp ne i32 %120, 0
br i1 %121, label %125, label %122
122: ; preds = %117
%123 = load i8*, i8** %13
%124 = call i32 @err(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* %123)
br label %125
125: ; preds = %122, %117
store i32 0, i32* %9
br label %126
126: ; preds = %211, %125
%127 = load i32, i32* %9
%128 = load i32, i32* %11
%129 = icmp slt i32 %127, %128
br i1 %129, label %130, label %214
130: ; preds = %126
%131 = load i32, i32* %9
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 %132
%134 = load i8, i8* %133
%135 = sext i8 %134 to i32
%136 = icmp ne i32 %135, 46
br i1 %136, label %137, label %210
137: ; preds = %130
%138 = load i32, i32* %7
%139 = icmp sge i32 %138, 65535
br i1 %139, label %140, label %143
140: ; preds = %137
%141 = load i8*, i8** %13
%142 = call i32 @errx(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i8* %141)
br label %143
143: ; preds = %140, %137
%144 = load i32, i32* %9
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 %145
%147 = load i8, i8* %146
%148 = sext i8 %147 to i32
switch i32 %148, label %173 [
i32 42, label %149
i32 82, label %160
]
149: ; preds = %143
%150 = load i32, i32* %7
%151 = mul nsw i32 %150, 4
%152 = add nsw i32 %151, 0
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [262144 x i32], [262144 x i32]* %17, i64 0, i64 %153
store i32 1, i32* %154
%155 = load i32, i32* %7
%156 = mul nsw i32 %155, 4
%157 = add nsw i32 %156, 1
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [262144 x i32], [262144 x i32]* %17, i64 0, i64 %158
store i32 0, i32* %159
br label %190
160: ; preds = %143
%161 = load i32, i32* %7
%162 = mul nsw i32 %161, 4
%163 = add nsw i32 %162, 0
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds [262144 x i32], [262144 x i32]* %17, i64 0, i64 %164
store i32 1, i32* %165
%166 = call i32 (...) @rand()
%167 = srem i32 %166, 6
%168 = load i32, i32* %7
%169 = mul nsw i32 %168, 4
%170 = add nsw i32 %169, 1
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [262144 x i32], [262144 x i32]* %17, i64 0, i64 %171
store i32 %167, i32* %172
br label %190
173: ; preds = %143
%174 = load i32, i32* %7
%175 = mul nsw i32 %174, 4
%176 = add nsw i32 %175, 0
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds [262144 x i32], [262144 x i32]* %17, i64 0, i64 %177
store i32 0, i32* %178
%179 = load i32, i32* %9
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 %180
%182 = load i8, i8* %181
%183 = sext i8 %182 to i32
%184 = sub nsw i32 %183, 49
%185 = load i32, i32* %7
%186 = mul nsw i32 %185, 4
%187 = add nsw i32 %186, 1
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds [262144 x i32], [262144 x i32]* %17, i64 0, i64 %188
store i32 %184, i32* %189
br label %190
190: ; preds = %173, %160, %149
%191 = load i32, i32* %9
%192 = mul nsw i32 %191, 16
%193 = load i32, i32* %7
%194 = mul nsw i32 %193, 4
%195 = add nsw i32 %194, 2
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds [262144 x i32], [262144 x i32]* %17, i64 0, i64 %196
store i32 %192, i32* %197
%198 = load i32, i32* %12
%199 = sub nsw i32 %198, 1
%200 = load i32, i32* %10
%201 = sub nsw i32 %199, %200
%202 = mul nsw i32 %201, 16
%203 = load i32, i32* %7
%204 = mul nsw i32 %203, 4
%205 = add nsw i32 %204, 3
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds [262144 x i32], [262144 x i32]* %17, i64 0, i64 %206
store i32 %202, i32* %207
%208 = load i32, i32* %7
%209 = add nsw i32 %208, 1
store i32 %209, i32* %7
br label %210
210: ; preds = %190, %130
br label %211
211: ; preds = %210
%212 = load i32, i32* %9
%213 = add nsw i32 %212, 1
store i32 %213, i32* %9
br label %126
214: ; preds = %126
br label %215
215: ; preds = %214
%216 = load i32, i32* %10
%217 = add nsw i32 %216, 1
store i32 %217, i32* %10
br label %113
218: ; preds = %113
%219 = load i32, i32* %7
%220 = and i32 %219, 255
%221 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 %220)
%222 = load i32, i32* %7
%223 = ashr i32 %222, 8
%224 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 %223)
store i32 0, i32* %16
br label %225
225: ; preds = %255, %218
%226 = load i32, i32* %16
%227 = load i32, i32* %7
%228 = icmp slt i32 %226, %227
br i1 %228, label %229, label %258
229: ; preds = %225
%230 = load i32, i32* %16
%231 = mul nsw i32 %230, 4
%232 = add nsw i32 %231, 0
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds [262144 x i32], [262144 x i32]* %17, i64 0, i64 %233
%235 = load i32, i32* %234
%236 = load i32, i32* %16
%237 = mul nsw i32 %236, 4
%238 = add nsw i32 %237, 1
%239 = sext i32 %238 to i64
%240 = getelementptr inbounds [262144 x i32], [262144 x i32]* %17, i64 0, i64 %239
%241 = load i32, i32* %240
%242 = load i32, i32* %16
%243 = mul nsw i32 %242, 4
%244 = add nsw i32 %243, 2
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds [262144 x i32], [262144 x i32]* %17, i64 0, i64 %245
%247 = load i32, i32* %246
%248 = load i32, i32* %16
%249 = mul nsw i32 %248, 4
%250 = add nsw i32 %249, 3
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds [262144 x i32], [262144 x i32]* %17, i64 0, i64 %251
%253 = load i32, i32* %252
%254 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i32 %235, i32 %241, i32 %247, i32 %253)
br label %255
255: ; preds = %229
%256 = load i32, i32* %16
%257 = add nsw i32 %256, 1
store i32 %257, i32* %16
br label %225
258: ; preds = %225
br label %262
259: ; preds = %108
%260 = load i8*, i8** %13
%261 = call i32 @errx(i32 1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i8* %260)
br label %262
262: ; preds = %259, %258
br label %263
263: ; preds = %262, %107
%264 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Usage: %s levelfile\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [23 x i8] c"uint8_t data_%s[] = {\0A\00"
@.str.4 = [16 x i8] c"%s: Empty file?\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [24 x i8] c"%s: Invalid block count\00"
@.str.7 = [11 x i8] c"\09\090x%02x,\0A\00"
@.str.8 = [19 x i8] c"%s: Unexpected EOF\00"
@.str.9 = [13 x i8] c"%d , %d , %d\00"
@.str.10 = [35 x i8] c"\09\090x%02x, 0x%02x, 0x%02x, 0x%02x,\0A\00"
@.str.11 = [24 x i8] c"%s: Couldn't parse line\00"
@.str.12 = [12 x i8] c"ascii %d %d\00"
@.str.13 = [20 x i8] c"%s: Too many blocks\00"
@.str.14 = [34 x i8] c"%s: Unsupported high-level format\00"
@str = [3 x i8] c"};\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [128 x i8]
%10 = alloca [262144 x i32]
%11 = bitcast i32* %3 to i8*
%12 = bitcast i32* %4 to i8*
%13 = bitcast i32* %5 to i8*
%14 = bitcast i32* %6 to i8*
%15 = bitcast i32* %7 to i8*
%16 = bitcast i32* %8 to i8*
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%18 = tail call i32 @srand(i32 0)
%19 = icmp eq i32 %0, 2
br i1 %19, label %23, label %20
20: ; preds = %2
%21 = load i8*, i8** %1
%22 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %20, %2
%24 = getelementptr inbounds i8*, i8** %1, i64 1
%25 = load i8*, i8** %24
%26 = tail call i8* @index(i8* %25, i8 signext 47)
%27 = icmp eq i8* %26, null
br i1 %27, label %34, label %28
28: ; preds = %23, %28
%29 = phi i8* [ %31, %28 ], [ %25, %23 ]
%30 = tail call i8* @index(i8* %29, i8 signext 47)
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = tail call i8* @index(i8* %31, i8 signext 47)
%33 = icmp eq i8* %32, null
br i1 %33, label %34, label %28
34: ; preds = %28, %23
%35 = phi i8* [ %25, %23 ], [ %31, %28 ]
%36 = tail call i32* @fopen(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%37 = icmp eq i32* %36, null
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %25)
br label %40
40: ; preds = %38, %34
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* %35)
%42 = call i32 @fgets(i8* %17, i32 128, i32* %36)
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = call i32 @err(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %25)
br label %46
46: ; preds = %44, %40
%47 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%48 = icmp eq i32 %47, 1
br i1 %48, label %49, label %87
49: ; preds = %46
%50 = load i32, i32* %3
%51 = add i32 %50, -256
%52 = icmp ult i32 %51, -255
br i1 %52, label %53, label %56
53: ; preds = %49
%54 = call i32 @errx(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %25)
%55 = load i32, i32* %3
br label %56
56: ; preds = %49, %53
%57 = phi i32 [ %50, %49 ], [ %55, %53 ]
%58 = and i32 %57, 255
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 %58)
%60 = load i32, i32* %3
%61 = ashr i32 %60, 8
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 %61)
%63 = load i32, i32* %3
%64 = icmp sgt i32 %63, 0
br i1 %64, label %65, label %201
65: ; preds = %56, %83
%66 = phi i32 [ %84, %83 ], [ 0, %56 ]
%67 = call i32 @fgets(i8* %17, i32 128, i32* %36)
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %65
%70 = call i32 @err(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* %25)
br label %71
71: ; preds = %69, %65
%72 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %17, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%73 = icmp eq i32 %72, 3
br i1 %73, label %74, label %81
74: ; preds = %71
%75 = load i32, i32* %4
%76 = call i32 (...) @rand()
%77 = srem i32 %76, 6
%78 = load i32, i32* %5
%79 = load i32, i32* %6
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i32 %75, i32 %77, i32 %78, i32 %79)
br label %83
81: ; preds = %71
%82 = call i32 @errx(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i8* %25)
br label %83
83: ; preds = %74, %81
%84 = add nuw nsw i32 %66, 1
%85 = load i32, i32* %3
%86 = icmp slt i32 %84, %85
br i1 %86, label %65, label %201
87: ; preds = %46
%88 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %17, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), i32* %7, i32* %8)
%89 = icmp eq i32 %88, 2
br i1 %89, label %90, label %199
90: ; preds = %87
%91 = bitcast [262144 x i32]* %10 to i8*
store i32 0, i32* %3
store i32 0, i32* %6
%92 = load i32, i32* %8
%93 = icmp sgt i32 %92, 0
br i1 %93, label %94, label %171
94: ; preds = %90, %164
%95 = phi i32 [ %165, %164 ], [ 0, %90 ]
%96 = call i32 @fgets(i8* %17, i32 128, i32* %36)
%97 = icmp eq i32 %96, 0
br i1 %97, label %98, label %100
98: ; preds = %94
%99 = call i32 @err(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* %25)
br label %100
100: ; preds = %98, %94
store i32 0, i32* %5
%101 = load i32, i32* %7
%102 = icmp sgt i32 %101, 0
br i1 %102, label %103, label %164
103: ; preds = %100
%104 = xor i32 %95, -1
br label %105
105: ; preds = %103, %160
%106 = phi i32 [ %161, %160 ], [ %101, %103 ]
%107 = phi i32 [ %162, %160 ], [ 0, %103 ]
%108 = zext i32 %107 to i64
%109 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 %108
%110 = load i8, i8* %109
%111 = icmp eq i8 %110, 46
br i1 %111, label %160, label %112
112: ; preds = %105
%113 = load i32, i32* %3
%114 = icmp sgt i32 %113, 65534
br i1 %114, label %115, label %118
115: ; preds = %112
%116 = call i32 @errx(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i8* %25)
%117 = load i8, i8* %109
br label %118
118: ; preds = %115, %112
%119 = phi i8 [ %117, %115 ], [ %110, %112 ]
%120 = sext i8 %119 to i32
switch i32 %120, label %135 [
i32 42, label %121
i32 82, label %126
]
121: ; preds = %118
%122 = load i32, i32* %3
%123 = shl nsw i32 %122, 2
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [262144 x i32], [262144 x i32]* %10, i64 0, i64 %124
store i32 1, i32* %125
br label %141
126: ; preds = %118
%127 = load i32, i32* %3
%128 = shl nsw i32 %127, 2
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [262144 x i32], [262144 x i32]* %10, i64 0, i64 %129
store i32 1, i32* %130
%131 = call i32 (...) @rand()
%132 = srem i32 %131, 6
%133 = load i32, i32* %3
%134 = shl nsw i32 %133, 2
br label %141
135: ; preds = %118
%136 = load i32, i32* %3
%137 = shl nsw i32 %136, 2
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds [262144 x i32], [262144 x i32]* %10, i64 0, i64 %138
store i32 0, i32* %139
%140 = add nsw i32 %120, -49
br label %141
141: ; preds = %135, %126, %121
%142 = phi i32 [ %137, %135 ], [ %134, %126 ], [ %123, %121 ]
%143 = phi i32 [ %140, %135 ], [ %132, %126 ], [ 0, %121 ]
%144 = phi i32 [ %136, %135 ], [ %133, %126 ], [ %122, %121 ]
%145 = or i32 %142, 1
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [262144 x i32], [262144 x i32]* %10, i64 0, i64 %146
store i32 %143, i32* %147
%148 = shl nsw i32 %107, 4
%149 = or i32 %142, 2
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [262144 x i32], [262144 x i32]* %10, i64 0, i64 %150
store i32 %148, i32* %151
%152 = load i32, i32* %8
%153 = add i32 %152, %104
%154 = shl nsw i32 %153, 4
%155 = or i32 %142, 3
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds [262144 x i32], [262144 x i32]* %10, i64 0, i64 %156
store i32 %154, i32* %157
%158 = add nsw i32 %144, 1
store i32 %158, i32* %3
%159 = load i32, i32* %7
br label %160
160: ; preds = %105, %141
%161 = phi i32 [ %106, %105 ], [ %159, %141 ]
%162 = add nuw nsw i32 %107, 1
store i32 %162, i32* %5
%163 = icmp slt i32 %162, %161
br i1 %163, label %105, label %164
164: ; preds = %160, %100
%165 = add nuw nsw i32 %95, 1
store i32 %165, i32* %6
%166 = load i32, i32* %8
%167 = icmp slt i32 %165, %166
br i1 %167, label %94, label %168
168: ; preds = %164
%169 = load i32, i32* %3
%170 = and i32 %169, 255
br label %171
171: ; preds = %168, %90
%172 = phi i32 [ %170, %168 ], [ 0, %90 ]
%173 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 %172)
%174 = load i32, i32* %3
%175 = ashr i32 %174, 8
%176 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 %175)
%177 = load i32, i32* %3
%178 = icmp sgt i32 %177, 0
br i1 %178, label %179, label %198
179: ; preds = %171, %179
%180 = phi i64 [ %194, %179 ], [ 0, %171 ]
%181 = shl nsw i64 %180, 2
%182 = getelementptr inbounds [262144 x i32], [262144 x i32]* %10, i64 0, i64 %181
%183 = load i32, i32* %182
%184 = or i64 %181, 1
%185 = getelementptr inbounds [262144 x i32], [262144 x i32]* %10, i64 0, i64 %184
%186 = load i32, i32* %185
%187 = or i64 %181, 2
%188 = getelementptr inbounds [262144 x i32], [262144 x i32]* %10, i64 0, i64 %187
%189 = load i32, i32* %188
%190 = or i64 %181, 3
%191 = getelementptr inbounds [262144 x i32], [262144 x i32]* %10, i64 0, i64 %190
%192 = load i32, i32* %191
%193 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i32 %183, i32 %186, i32 %189, i32 %192)
%194 = add nuw nsw i64 %180, 1
%195 = load i32, i32* %3
%196 = sext i32 %195 to i64
%197 = icmp slt i64 %194, %196
br i1 %197, label %179, label %198
198: ; preds = %179, %171
br label %201
199: ; preds = %87
%200 = call i32 @errx(i32 1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i8* %25)
br label %201
201: ; preds = %83, %56, %198, %199
%202 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}