#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 /*<<< orphan*/ grid;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int ERR;
#define KEY_DOWN 131
#define KEY_LEFT 130
#define KEY_RIGHT 129
#define KEY_UP 128
int /*<<< orphan*/ clearblock(int /*<<< orphan*/ **, short, short);
int /*<<< orphan*/ drawblock(int /*<<< orphan*/ **, int, int);
int /*<<< orphan*/ endgraphics();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(short *, short *, int);
int /*<<< orphan*/ memset(int **, int /*<<< orphan*/, int);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                             char *, ...);
int /*<<< orphan*/ newdot(int /*<<< orphan*/ **, int **, int *, int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ randomize();
int /*<<< orphan*/ startgraphics(int /*<<< orphan*/ **);
int /*<<< orphan*/ usleep(int);
int wgetch(int /*<<< orphan*/ *);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  WINDOW *w[3];
  bool grid[((80 - 2) >> 1)][(25 - 4)];
  short int hx[8192];
  short int hy[8192];
  int length = 5;
  int extralength = 0;
  int curx, cury;
  int dir = 2;
  int lastdir = 2;
  int score = 0;
  bool paused = 0;
  int dotx, doty;
  int tick;
  int ch;
  startgraphics(w);
  randomize();
  memset(grid, 0, sizeof(grid));
  curx = (((80 - 2) >> 1) + length) >> 1;
  cury = (25 - 4) >> 1;
  for (tick = 0; tick < length; tick++) {
    hx[tick] = curx - (length - tick) + 1;
    hy[tick] = cury;
    grid[curx - (length - tick) + 1][cury] = 1;
    drawblock(w, curx - (length - tick) + 1, cury);
  }
  newdot(w, grid, &dotx, &doty);
  while (1) {
    lastdir = dir;
    if (paused) {
      ch = wgetch(w[1]);
      while (ch != ERR) {
        switch (ch) {
        case 'p':
          paused = 0;
          mvwprintw(w[2], 0, 80 - 2 - 7, "      ");
          break;
        case 'q':
          endgraphics();
          printf("Quitter! Your score was %d.\n", score);
          exit(0);
          break;
        }
        ch = wgetch(w[1]);
      }
      mvwprintw(w[2], 0, 0, "Score:  %d ", score);
      mvwprintw(w[2], 0, 80 - 2 - 7, "Paused");
      wrefresh(w[2]);
      usleep(100000);
      continue;
    }
    ch = wgetch(w[1]);
    while (ch != ERR) {
      switch (ch) {
      case KEY_LEFT:
      case 'h':
        if ((lastdir == 3) || (lastdir == 4)) {
          dir = 1;
        }
        break;
      case KEY_RIGHT:
      case 'l':
        if ((lastdir == 3) || (lastdir == 4)) {
          dir = 2;
        }
        break;
      case KEY_UP:
      case 'k':
        if ((lastdir == 1) || (lastdir == 2)) {
          dir = 3;
        }
        break;
      case KEY_DOWN:
      case 'j':
        if ((lastdir == 1) || (lastdir == 2)) {
          dir = 4;
        }
        break;
      case 'p':
        paused = 1;
        break;
      case 'q':
        endgraphics();
        printf("Quitter! Your score was %d.\n", score);
        exit(0);
        break;
      }
      ch = wgetch(w[1]);
    }
    switch (dir) {
    case 1:
      curx--;
      break;
    case 2:
      curx++;
      break;
    case 3:
      cury--;
      break;
    case 4:
      cury++;
      break;
    }
    if ((curx < 0) || (curx >= ((80 - 2) >> 1)) || (cury < 0) ||
        (cury >= (25 - 4))) {
      endgraphics();
      printf("You crashed in a wall. Your score was %d.\n", score);
      exit(0);
    }
    if (grid[curx][cury]) {
      endgraphics();
      printf("You crashed with yourself. Your score was %d.\n", score);
      exit(0);
    }
    drawblock(w, curx, cury);
    grid[curx][cury] = 1;
    hx[tick] = curx;
    hy[tick] = cury;
    if ((dotx == curx) && (doty == cury)) {
      score++;
      extralength += 5;
      newdot(w, grid, &dotx, &doty);
    }
    if (extralength > 0) {
      extralength--;
      length++;
    } else {
      clearblock(w, hx[tick - length], hy[tick - length]);
      grid[hx[tick - length]][hy[tick - length]] = 0;
    }
    wrefresh(w[1]);
    mvwprintw(w[2], 0, 0, "Score:  %d", score);
    mvwprintw(w[2], 0, ((80 - 2) >> 1) - 2 - 7, "       ");
    wrefresh(w[2]);
    usleep(100000);
    tick++;
    if (tick == 8192) {
      memcpy(hx, hx + 8192 - length, length * sizeof(short int));
      memcpy(hy, hy + 8192 - length, length * sizeof(short int));
      tick = length;
    }
  }
  endgraphics();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8d50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x8d04(%rbp)
movl   $0x0,-0x8d08(%rbp)
movl   $0x2,-0x8d14(%rbp)
movl   $0x2,-0x8d18(%rbp)
movl   $0x0,-0x8d1c(%rbp)
movl   $0x0,-0x8d20(%rbp)
lea    -0x30(%rbp),%rdi
call   10d0 <startgraphics@plt>
mov    $0x0,%al
call   10c0 <randomize@plt>
lea    -0xd00(%rbp),%rdi
xor    %esi,%esi
mov    $0xccc,%edx
call   1060 <memset@plt>
mov    -0x8d04(%rbp),%eax
add    $0x27,%eax
sar    $0x1,%eax
mov    %eax,-0x8d0c(%rbp)
movl   $0xa,-0x8d10(%rbp)
movl   $0x0,-0x8d2c(%rbp)
mov    -0x8d2c(%rbp),%eax
cmp    -0x8d04(%rbp),%eax
jge    1341 <main+0x161>
mov    -0x8d0c(%rbp),%eax
mov    -0x8d04(%rbp),%ecx
sub    -0x8d2c(%rbp),%ecx
sub    %ecx,%eax
add    $0x1,%eax
mov    %ax,%cx
movslq -0x8d2c(%rbp),%rax
mov    %cx,-0x4d00(%rbp,%rax,2)
ff
mov    -0x8d10(%rbp),%eax
mov    %ax,%cx
movslq -0x8d2c(%rbp),%rax
mov    %cx,-0x8d00(%rbp,%rax,2)
ff
mov    -0x8d0c(%rbp),%eax
mov    -0x8d04(%rbp),%ecx
sub    -0x8d2c(%rbp),%ecx
sub    %ecx,%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    -0xd00(%rbp),%rax
imul   $0x54,%rcx,%rcx
add    %rcx,%rax
movslq -0x8d10(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
lea    -0x30(%rbp),%rdi
mov    -0x8d0c(%rbp),%esi
mov    -0x8d04(%rbp),%eax
sub    -0x8d2c(%rbp),%eax
sub    %eax,%esi
add    $0x1,%esi
mov    -0x8d10(%rbp),%edx
call   1070 <drawblock@plt>
mov    -0x8d2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8d2c(%rbp)
jmp    127e <main+0x9e>
lea    -0x30(%rbp),%rdi
lea    -0xd00(%rbp),%rsi
lea    -0x8d24(%rbp),%rdx
lea    -0x8d28(%rbp),%rcx
call   10f0 <newdot@plt>
mov    -0x8d14(%rbp),%eax
mov    %eax,-0x8d18(%rbp)
cmpl   $0x0,-0x8d20(%rbp)
je     1474 <main+0x294>
mov    -0x28(%rbp),%rdi
call   10a0 <wgetch@plt>
mov    %eax,-0x8d30(%rbp)
mov    -0x8d30(%rbp),%eax
mov    0x2c54(%rip),%rcx
cmp    (%rcx),%eax
je     1426 <main+0x246>
mov    -0x8d30(%rbp),%eax
mov    %eax,-0x8d34(%rbp)
sub    $0x70,%eax
je     13ca <main+0x1ea>
jmp    13b6 <main+0x1d6>
mov    -0x8d34(%rbp),%eax
sub    $0x71,%eax
je     13f2 <main+0x212>
jmp    1412 <main+0x232>
movl   $0x0,-0x8d20(%rbp)
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x47,%edx
lea    0xd30(%rip),%rcx
mov    $0x0,%al
call   10b0 <mvwprintw@plt>
jmp    1412 <main+0x232>
mov    $0x0,%al
call   1030 <endgraphics@plt>
mov    -0x8d1c(%rbp),%esi
lea    0xc7a(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    -0x28(%rbp),%rdi
call   10a0 <wgetch@plt>
mov    %eax,-0x8d30(%rbp)
jmp    1387 <main+0x1a7>
mov    -0x20(%rbp),%rdi
mov    -0x8d1c(%rbp),%r8d
xor    %edx,%edx
lea    0xc63(%rip),%rcx
mov    %edx,%esi
mov    $0x0,%al
call   10b0 <mvwprintw@plt>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x47,%edx
lea    0xc54(%rip),%rcx
mov    $0x0,%al
call   10b0 <mvwprintw@plt>
mov    -0x20(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    $0x186a0,%edi
call   1100 <usleep@plt>
jmp    135f <main+0x17f>
mov    -0x28(%rbp),%rdi
call   10a0 <wgetch@plt>
mov    %eax,-0x8d30(%rbp)
mov    -0x8d30(%rbp),%eax
mov    0x2b58(%rip),%rcx
cmp    (%rcx),%eax
je     15b1 <main+0x3d1>
mov    -0x8d30(%rbp),%eax
add    $0xffffff98,%eax
mov    %eax,%ecx
mov    %rcx,-0x8d40(%rbp)
sub    $0x1b,%eax
ja     159d <main+0x3bd>
mov    -0x8d40(%rbp),%rax
lea    0xb4f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x3,-0x8d18(%rbp)
je     14e4 <main+0x304>
cmpl   $0x4,-0x8d18(%rbp)
jne    14ee <main+0x30e>
movl   $0x1,-0x8d14(%rbp)
jmp    159d <main+0x3bd>
cmpl   $0x3,-0x8d18(%rbp)
je     150d <main+0x32d>
cmpl   $0x4,-0x8d18(%rbp)
jne    1517 <main+0x337>
movl   $0x2,-0x8d14(%rbp)
jmp    159d <main+0x3bd>
cmpl   $0x1,-0x8d18(%rbp)
je     1536 <main+0x356>
cmpl   $0x2,-0x8d18(%rbp)
jne    1540 <main+0x360>
movl   $0x3,-0x8d14(%rbp)
jmp    159d <main+0x3bd>
cmpl   $0x1,-0x8d18(%rbp)
je     155f <main+0x37f>
cmpl   $0x2,-0x8d18(%rbp)
jne    1569 <main+0x389>
movl   $0x4,-0x8d14(%rbp)
jmp    159d <main+0x3bd>
movl   $0x1,-0x8d20(%rbp)
jmp    159d <main+0x3bd>
mov    $0x0,%al
call   1030 <endgraphics@plt>
mov    -0x8d1c(%rbp),%esi
lea    0xaef(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    -0x28(%rbp),%rdi
call   10a0 <wgetch@plt>
mov    %eax,-0x8d30(%rbp)
jmp    1483 <main+0x2a3>
mov    -0x8d14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x8d48(%rbp)
sub    $0x3,%eax
ja     162e <main+0x44e>
mov    -0x8d48(%rbp),%rax
lea    0xa26(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8d0c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8d0c(%rbp)
jmp    162e <main+0x44e>
mov    -0x8d0c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8d0c(%rbp)
jmp    162e <main+0x44e>
mov    -0x8d10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8d10(%rbp)
jmp    162e <main+0x44e>
mov    -0x8d10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8d10(%rbp)
cmpl   $0x0,-0x8d0c(%rbp)
jl     1662 <main+0x482>
cmpl   $0x27,-0x8d0c(%rbp)
jge    1662 <main+0x482>
cmpl   $0x0,-0x8d10(%rbp)
jl     1662 <main+0x482>
cmpl   $0x15,-0x8d10(%rbp)
jl     1682 <main+0x4a2>
mov    $0x0,%al
call   1030 <endgraphics@plt>
mov    -0x8d1c(%rbp),%esi
lea    0xa3a(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
movslq -0x8d0c(%rbp),%rcx
lea    -0xd00(%rbp),%rax
imul   $0x54,%rcx,%rcx
add    %rcx,%rax
movslq -0x8d10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     16c8 <main+0x4e8>
mov    $0x0,%al
call   1030 <endgraphics@plt>
mov    -0x8d1c(%rbp),%esi
lea    0xa1f(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8d0c(%rbp),%esi
mov    -0x8d10(%rbp),%edx
call   1070 <drawblock@plt>
movslq -0x8d0c(%rbp),%rcx
lea    -0xd00(%rbp),%rax
imul   $0x54,%rcx,%rcx
add    %rcx,%rax
movslq -0x8d10(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x8d0c(%rbp),%eax
mov    %ax,%cx
movslq -0x8d2c(%rbp),%rax
mov    %cx,-0x4d00(%rbp,%rax,2)
ff
mov    -0x8d10(%rbp),%eax
mov    %ax,%cx
movslq -0x8d2c(%rbp),%rax
mov    %cx,-0x8d00(%rbp,%rax,2)
ff
mov    -0x8d24(%rbp),%eax
cmp    -0x8d0c(%rbp),%eax
jne    1790 <main+0x5b0>
mov    -0x8d28(%rbp),%eax
cmp    -0x8d10(%rbp),%eax
jne    1790 <main+0x5b0>
mov    -0x8d1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8d1c(%rbp)
mov    -0x8d08(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x8d08(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0xd00(%rbp),%rsi
lea    -0x8d24(%rbp),%rdx
lea    -0x8d28(%rbp),%rcx
call   10f0 <newdot@plt>
cmpl   $0x0,-0x8d08(%rbp)
jle    17c0 <main+0x5e0>
mov    -0x8d08(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8d08(%rbp)
mov    -0x8d04(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8d04(%rbp)
jmp    183c <main+0x65c>
lea    -0x30(%rbp),%rdi
mov    -0x8d2c(%rbp),%eax
sub    -0x8d04(%rbp),%eax
cltq
mov    -0x4d00(%rbp,%rax,2),%cx
ff
mov    -0x8d2c(%rbp),%eax
sub    -0x8d04(%rbp),%eax
cltq
movswl %cx,%esi
movswl -0x8d00(%rbp,%rax,2),%edx
ff
call   1090 <clearblock@plt>
mov    -0x8d2c(%rbp),%eax
sub    -0x8d04(%rbp),%eax
cltq
movswq -0x4d00(%rbp,%rax,2),%rcx
ff ff
lea    -0xd00(%rbp),%rax
imul   $0x54,%rcx,%rcx
add    %rcx,%rax
mov    -0x8d2c(%rbp),%ecx
sub    -0x8d04(%rbp),%ecx
movslq %ecx,%rcx
movswq -0x8d00(%rbp,%rcx,2),%rcx
ff ff
movl   $0x0,(%rax,%rcx,4)
mov    -0x28(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8d1c(%rbp),%r8d
xor    %edx,%edx
lea    0x8b1(%rip),%rcx
mov    %edx,%esi
mov    $0x0,%al
call   10b0 <mvwprintw@plt>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x1e,%edx
lea    0x8a1(%rip),%rcx
mov    $0x0,%al
call   10b0 <mvwprintw@plt>
mov    -0x20(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    $0x186a0,%edi
call   1100 <usleep@plt>
mov    -0x8d2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8d2c(%rbp)
cmpl   $0x2000,-0x8d2c(%rbp)
jne    192d <main+0x74d>
lea    -0x4d00(%rbp),%rdi
lea    -0x4d00(%rbp),%rsi
add    $0x4000,%rsi
movslq -0x8d04(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
shl    $0x1,%rax
add    %rax,%rsi
movslq -0x8d04(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%edx
call   1080 <memcpy@plt>
lea    -0x8d00(%rbp),%rdi
lea    -0x8d00(%rbp),%rsi
add    $0x4000,%rsi
movslq -0x8d04(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
shl    $0x1,%rax
add    %rax,%rsi
movslq -0x8d04(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%edx
call   1080 <memcpy@plt>
mov    -0x8d04(%rbp),%eax
mov    %eax,-0x8d2c(%rbp)
jmp    135f <main+0x17f>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x8d28,%rsp
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   10d0 <startgraphics@plt>
xor    %eax,%eax
call   10c0 <randomize@plt>
lea    0x50(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0xccc,%edx
call   1060 <memset@plt>
movw   $0x12,0x4d20(%rsp)
movw   $0xa,0xd20(%rsp)
movl   $0x1,0x660(%rsp)
movl   $0xa,0xc(%rsp)
mov    %rbx,%rdi
mov    $0x12,%esi
mov    $0xa,%edx
call   1070 <drawblock@plt>
movw   $0x13,0x4d22(%rsp)
movw   $0xa,0xd22(%rsp)
movl   $0x1,0x6b4(%rsp)
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0xa,%edx
call   1070 <drawblock@plt>
movw   $0x14,0x4d24(%rsp)
movw   $0xa,0xd24(%rsp)
movl   $0x1,0x708(%rsp)
mov    %rbx,%rdi
mov    $0x14,%esi
mov    $0xa,%edx
call   1070 <drawblock@plt>
movw   $0x15,0x4d26(%rsp)
movw   $0xa,0xd26(%rsp)
movl   $0x1,0x75c(%rsp)
mov    %rbx,%rdi
mov    $0x15,%esi
mov    $0xa,%edx
call   1070 <drawblock@plt>
movw   $0x16,0x4d28(%rsp)
movw   $0xa,0xd28(%rsp)
movl   $0x1,0x7b0(%rsp)
movl   $0x16,0x8(%rsp)
mov    %rbx,%rdi
mov    $0x16,%esi
mov    $0xa,%edx
call   1070 <drawblock@plt>
lea    0x2c(%rsp),%rdx
lea    0x28(%rsp),%rcx
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10f0 <newdot@plt>
movl   $0x5,0x20(%rsp)
mov    0x2ca6(%rip),%rbp
lea    0xd54(%rip),%r13
lea    0xdc6(%rip),%r15
movl   $0x0,0x10(%rsp)
mov    $0x2,%r14d
xor    %r12d,%r12d
movl   $0x0,0x14(%rsp)
mov    $0x5,%ebx
xchg   %ax,%ax
mov    %ebx,0x24(%rsp)
cmpl   $0x0,0x14(%rsp)
jne    142c <main+0x24c>
mov    0x38(%rsp),%rdi
call   10a0 <wgetch@plt>
cmp    0x0(%rbp),%eax
mov    %r12d,0x18(%rsp)
jne    1490 <main+0x2b0>
movl   $0x0,0x14(%rsp)
mov    0xc(%rsp),%ebx
lea    -0x1(%r14),%eax
cmp    $0x3,%eax
ja     1509 <main+0x329>
lea    0xcb9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
mov    %ebx,%edx
mov    0x18(%rsp),%r12d
mov    0x8(%rsp),%esi
lea    0xccd(%rip),%r13
jmp    *%rax
add    $0xffffffff,%esi
jmp    1530 <main+0x350>
nopw   0x0(%rax,%rax,1)
mov    0x40(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    %r13,%rcx
mov    %r12d,%r8d
xor    %eax,%eax
call   10b0 <mvwprintw@plt>
mov    0x40(%rsp),%rdi
xor    %esi,%esi
mov    $0x47,%edx
lea    0xca0(%rip),%rcx
xor    %eax,%eax
call   10b0 <mvwprintw@plt>
mov    0x40(%rsp),%rdi
call   1040 <wrefresh@plt>
mov    $0x186a0,%edi
call   1100 <usleep@plt>
test   %ebx,%ebx
je     137f <main+0x19f>
mov    0x38(%rsp),%rdi
call   10a0 <wgetch@plt>
mov    $0x1,%ebx
cmp    0x0(%rbp),%eax
je     13e0 <main+0x200>
mov    $0x1,%ebx
jmp    147b <main+0x29b>
nopw   0x0(%rax,%rax,1)
mov    0x40(%rsp),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0x47,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   10b0 <mvwprintw@plt>
mov    0x38(%rsp),%rdi
call   10a0 <wgetch@plt>
cmp    0x0(%rbp),%eax
je     13e0 <main+0x200>
cmp    $0x70,%eax
je     1450 <main+0x270>
cmp    $0x71,%eax
jne    1468 <main+0x288>
jmp    170f <main+0x52f>
nopw   0x0(%rax,%rax,1)
mov    0xc(%rsp),%ebx
lea    -0x1(%r14),%r12d
lea    -0x3(%r14),%r13d
movl   $0x0,0x14(%rsp)
jmp    14c6 <main+0x2e6>
cmp    $0x2,%r13d
mov    $0x1,%eax
cmovb  %eax,%r14d
mov    0x38(%rsp),%rdi
call   10a0 <wgetch@plt>
cmp    0x0(%rbp),%eax
je     13a3 <main+0x1c3>
add    $0xffffff98,%eax
cmp    $0x1b,%eax
ja     14b3 <main+0x2d3>
lea    0xb2b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmp    $0x2,%r12d
mov    $0x4,%eax
jmp    14af <main+0x2cf>
cmp    $0x2,%r12d
mov    $0x3,%eax
jmp    14af <main+0x2cf>
cmp    $0x2,%r13d
mov    $0x2,%eax
jmp    14af <main+0x2cf>
movl   $0x1,0x14(%rsp)
jmp    14b3 <main+0x2d3>
mov    %ebx,%edx
mov    0x18(%rsp),%r12d
mov    0x8(%rsp),%esi
lea    0xb82(%rip),%r13
jmp    1530 <main+0x350>
add    $0x1,%esi
jmp    1530 <main+0x350>
add    $0xffffffff,%edx
jmp    1530 <main+0x350>
add    $0x1,%edx
nopw   0x0(%rax,%rax,1)
cmp    $0x26,%esi
ja     1740 <main+0x560>
test   %edx,%edx
js     1740 <main+0x560>
cmp    $0x15,%edx
jge    1740 <main+0x560>
mov    %esi,%ecx
mov    %edx,%eax
imul   $0x54,%rcx,%rcx
add    %rsp,%rcx
add    $0x50,%rcx
cmpl   $0x0,(%rcx,%rax,4)
jne    1750 <main+0x570>
lea    (%rcx,%rax,4),%rbx
lea    0x30(%rsp),%rdi
mov    %esi,0x8(%rsp)
mov    0x8(%rsp),%esi
mov    %edx,0xc(%rsp)
mov    0xc(%rsp),%edx
call   1070 <drawblock@plt>
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
movl   $0x1,(%rbx)
movslq 0x24(%rsp),%rax
mov    %dx,0x4d20(%rsp,%rax,2)
mov    %cx,0xd20(%rsp,%rax,2)
cmp    %edx,0x2c(%rsp)
jne    15f0 <main+0x410>
cmp    %ecx,0x28(%rsp)
mov    0x10(%rsp),%ebx
jne    15d4 <main+0x3f4>
add    $0x1,%r12d
add    $0x5,%ebx
lea    0x30(%rsp),%rdi
lea    0x50(%rsp),%rsi
lea    0x2c(%rsp),%rdx
lea    0x28(%rsp),%rcx
call   10f0 <newdot@plt>
test   %ebx,%ebx
jle    15f8 <main+0x418>
add    $0xffffffff,%ebx
mov    %ebx,0x10(%rsp)
addl   $0x1,0x20(%rsp)
mov    0x24(%rsp),%ebx
jmp    1650 <main+0x470>
nopw   0x0(%rax,%rax,1)
mov    0x10(%rsp),%ebx
test   %ebx,%ebx
jg     15d8 <main+0x3f8>
mov    %ebx,0x10(%rsp)
mov    0x24(%rsp),%ebx
mov    %ebx,%eax
sub    0x20(%rsp),%eax
cltq
mov    %rax,0x18(%rsp)
movswl 0x4d20(%rsp,%rax,2),%esi
movswl 0xd20(%rsp,%rax,2),%edx
lea    0x30(%rsp),%rdi
call   1090 <clearblock@plt>
mov    0x18(%rsp),%rcx
movswq 0x4d20(%rsp,%rcx,2),%rax
movswq 0xd20(%rsp,%rcx,2),%rcx
imul   $0x54,%rax,%rax
add    %rsp,%rax
add    $0x50,%rax
movl   $0x0,(%rax,%rcx,4)
mov    0x38(%rsp),%rdi
call   1040 <wrefresh@plt>
mov    0x40(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
lea    0xaa0(%rip),%rcx
mov    %r12d,%r8d
xor    %eax,%eax
call   10b0 <mvwprintw@plt>
mov    0x40(%rsp),%rdi
xor    %esi,%esi
mov    $0x1e,%edx
lea    0xa8e(%rip),%rcx
xor    %eax,%eax
call   10b0 <mvwprintw@plt>
mov    0x40(%rsp),%rdi
call   1040 <wrefresh@plt>
mov    $0x186a0,%edi
call   1100 <usleep@plt>
add    $0x1,%ebx
cmp    $0x2000,%ebx
jne    1370 <main+0x190>
mov    %r12d,0x18(%rsp)
mov    0x20(%rsp),%r13d
movslq %r13d,%r12
lea    (%r12,%r12,1),%rbx
lea    0x8d20(%rsp),%rsi
sub    %rbx,%rsi
add    %r12d,%r12d
lea    0x4d20(%rsp),%rdi
mov    %r12d,%edx
call   1080 <memcpy@plt>
lea    0x4d20(%rsp),%rsi
sub    %rbx,%rsi
lea    0xd20(%rsp),%rdi
mov    %r12d,%edx
mov    0x18(%rsp),%r12d
call   1080 <memcpy@plt>
mov    %r13d,%ebx
lea    0x993(%rip),%r13
jmp    1370 <main+0x190>
xor    %eax,%eax
call   1030 <endgraphics@plt>
lea    0x963(%rip),%rdi
mov    %r12d,%esi
call   1050 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
xor    %eax,%eax
call   1030 <endgraphics@plt>
lea    0x946(%rip),%rdi
mov    0x18(%rsp),%esi
jmp    1720 <main+0x540>
xor    %eax,%eax
call   1030 <endgraphics@plt>
lea    0x962(%rip),%rdi
jmp    171d <main+0x53d>
xor    %eax,%eax
call   1030 <endgraphics@plt>
lea    0x97d(%rip),%rdi
jmp    171d <main+0x53d>

LLVM IR (-O0):
@ERR = global i32 0
@.str = [7 x i8] c" \00"
@.str.1 = [29 x i8] c"Quitter! Your score was %d.\0A\00"
@.str.2 = [12 x i8] c"Score: %d \00"
@.str.3 = [7 x i8] c"Paused\00"
@.str.4 = [43 x i8] c"You crashed in a wall. Your score was %d.\0A\00"
@.str.5 = [47 x i8] c"You crashed with yourself. Your score was %d.\0A\00"
@.str.6 = [11 x i8] c"Score: %d\00"
@.str.7 = [8 x i8] c" \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i32*]
%7 = alloca [39 x [21 x i32]]
%8 = alloca [8192 x i16]
%9 = alloca [8192 x i16]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %10
store i32 0, i32* %11
store i32 2, i32* %14
store i32 2, i32* %15
store i32 0, i32* %16
store i32 0, i32* %17
%22 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 0
%23 = call i32 @startgraphics(i32** %22)
%24 = call i32 (...) @randomize()
%25 = getelementptr inbounds [39 x [21 x i32]], [39 x [21 x i32]]* %7, i64 0, i64 0
%26 = bitcast [21 x i32]* %25 to i32**
%27 = call i32 @memset(i32** %26, i32 0, i32 3276)
%28 = load i32, i32* %10
%29 = add nsw i32 39, %28
%30 = ashr i32 %29, 1
store i32 %30, i32* %12
store i32 10, i32* %13
store i32 0, i32* %20
br label %31
31: ; preds = %71, %2
%32 = load i32, i32* %20
%33 = load i32, i32* %10
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %74
35: ; preds = %31
%36 = load i32, i32* %12
%37 = load i32, i32* %10
%38 = load i32, i32* %20
%39 = sub nsw i32 %37, %38
%40 = sub nsw i32 %36, %39
%41 = add nsw i32 %40, 1
%42 = trunc i32 %41 to i16
%43 = load i32, i32* %20
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [8192 x i16], [8192 x i16]* %8, i64 0, i64 %44
store i16 %42, i16* %45
%46 = load i32, i32* %13
%47 = trunc i32 %46 to i16
%48 = load i32, i32* %20
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [8192 x i16], [8192 x i16]* %9, i64 0, i64 %49
store i16 %47, i16* %50
%51 = load i32, i32* %12
%52 = load i32, i32* %10
%53 = load i32, i32* %20
%54 = sub nsw i32 %52, %53
%55 = sub nsw i32 %51, %54
%56 = add nsw i32 %55, 1
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [39 x [21 x i32]], [39 x [21 x i32]]* %7, i64 0, i64 %57
%59 = load i32, i32* %13
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [21 x i32], [21 x i32]* %58, i64 0, i64 %60
store i32 1, i32* %61
%62 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 0
%63 = load i32, i32* %12
%64 = load i32, i32* %10
%65 = load i32, i32* %20
%66 = sub nsw i32 %64, %65
%67 = sub nsw i32 %63, %66
%68 = add nsw i32 %67, 1
%69 = load i32, i32* %13
%70 = call i32 @drawblock(i32** %62, i32 %68, i32 %69)
br label %71
71: ; preds = %35
%72 = load i32, i32* %20
%73 = add nsw i32 %72, 1
store i32 %73, i32* %20
br label %31
74: ; preds = %31
%75 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 0
%76 = getelementptr inbounds [39 x [21 x i32]], [39 x [21 x i32]]* %7, i64 0, i64 0
%77 = bitcast [21 x i32]* %76 to i32**
%78 = call i32 @newdot(i32** %75, i32** %77, i32* %18, i32* %19)
br label %79
79: ; preds = %74, %106, %336
%80 = load i32, i32* %14
store i32 %80, i32* %15
%81 = load i32, i32* %17
%82 = icmp ne i32 %81, 0
br i1 %82, label %83, label %118
83: ; preds = %79
%84 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 1
%85 = load i32*, i32** %84
%86 = call i32 @wgetch(i32* %85)
store i32 %86, i32* %21
br label %87
87: ; preds = %102, %83
%88 = load i32, i32* %21
%89 = load i32, i32* @ERR
%90 = icmp ne i32 %88, %89
br i1 %90, label %91, label %106
91: ; preds = %87
%92 = load i32, i32* %21
switch i32 %92, label %102 [
i32 112, label %93
i32 113, label %97
]
93: ; preds = %91
store i32 0, i32* %17
%94 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 2
%95 = load i32*, i32** %94
%96 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %95, i32 0, i32 71, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %102
97: ; preds = %91
%98 = call i32 (...) @endgraphics()
%99 = load i32, i32* %16
%100 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %99)
%101 = call i32 @exit(i32 0)
unreachable
102: ; preds = %91, %93
%103 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 1
%104 = load i32*, i32** %103
%105 = call i32 @wgetch(i32* %104)
store i32 %105, i32* %21
br label %87
106: ; preds = %87
%107 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 2
%108 = load i32*, i32** %107
%109 = load i32, i32* %16
%110 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %108, i32 0, i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %109)
%111 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 2
%112 = load i32*, i32** %111
%113 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %112, i32 0, i32 71, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%114 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 2
%115 = load i32*, i32** %114
%116 = call i32 @wrefresh(i32* %115)
%117 = call i32 @usleep(i32 100000)
br label %79
118: ; preds = %79
%119 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 1
%120 = load i32*, i32** %119
%121 = call i32 @wgetch(i32* %120)
store i32 %121, i32* %21
br label %122
122: ; preds = %166, %118
%123 = load i32, i32* %21
%124 = load i32, i32* @ERR
%125 = icmp ne i32 %123, %124
br i1 %125, label %126, label %170
126: ; preds = %122
%127 = load i32, i32* %21
switch i32 %127, label %166 [
i32 130, label %128
i32 104, label %128
i32 129, label %136
i32 108, label %136
i32 128, label %144
i32 107, label %144
i32 131, label %152
i32 106, label %152
i32 112, label %160
i32 113, label %161
]
128: ; preds = %126, %126
%129 = load i32, i32* %15
%130 = icmp eq i32 %129, 3
br i1 %130, label %134, label %131
131: ; preds = %128
%132 = load i32, i32* %15
%133 = icmp eq i32 %132, 4
br i1 %133, label %134, label %135
134: ; preds = %131, %128
store i32 1, i32* %14
br label %135
135: ; preds = %134, %131
br label %166
136: ; preds = %126, %126
%137 = load i32, i32* %15
%138 = icmp eq i32 %137, 3
br i1 %138, label %142, label %139
139: ; preds = %136
%140 = load i32, i32* %15
%141 = icmp eq i32 %140, 4
br i1 %141, label %142, label %143
142: ; preds = %139, %136
store i32 2, i32* %14
br label %143
143: ; preds = %142, %139
br label %166
144: ; preds = %126, %126
%145 = load i32, i32* %15
%146 = icmp eq i32 %145, 1
br i1 %146, label %150, label %147
147: ; preds = %144
%148 = load i32, i32* %15
%149 = icmp eq i32 %148, 2
br i1 %149, label %150, label %151
150: ; preds = %147, %144
store i32 3, i32* %14
br label %151
151: ; preds = %150, %147
br label %166
152: ; preds = %126, %126
%153 = load i32, i32* %15
%154 = icmp eq i32 %153, 1
br i1 %154, label %158, label %155
155: ; preds = %152
%156 = load i32, i32* %15
%157 = icmp eq i32 %156, 2
br i1 %157, label %158, label %159
158: ; preds = %155, %152
store i32 4, i32* %14
br label %159
159: ; preds = %158, %155
br label %166
160: ; preds = %126
store i32 1, i32* %17
br label %166
161: ; preds = %126
%162 = call i32 (...) @endgraphics()
%163 = load i32, i32* %16
%164 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %163)
%165 = call i32 @exit(i32 0)
unreachable
166: ; preds = %126, %160, %159, %151, %143, %135
%167 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 1
%168 = load i32*, i32** %167
%169 = call i32 @wgetch(i32* %168)
store i32 %169, i32* %21
br label %122
170: ; preds = %122
%171 = load i32, i32* %14
switch i32 %171, label %184 [
i32 1, label %172
i32 2, label %175
i32 3, label %178
i32 4, label %181
]
172: ; preds = %170
%173 = load i32, i32* %12
%174 = add nsw i32 %173, -1
store i32 %174, i32* %12
br label %184
175: ; preds = %170
%176 = load i32, i32* %12
%177 = add nsw i32 %176, 1
store i32 %177, i32* %12
br label %184
178: ; preds = %170
%179 = load i32, i32* %13
%180 = add nsw i32 %179, -1
store i32 %180, i32* %13
br label %184
181: ; preds = %170
%182 = load i32, i32* %13
%183 = add nsw i32 %182, 1
store i32 %183, i32* %13
br label %184
184: ; preds = %170, %181, %178, %175, %172
%185 = load i32, i32* %12
%186 = icmp slt i32 %185, 0
br i1 %186, label %196, label %187
187: ; preds = %184
%188 = load i32, i32* %12
%189 = icmp sge i32 %188, 39
br i1 %189, label %196, label %190
190: ; preds = %187
%191 = load i32, i32* %13
%192 = icmp slt i32 %191, 0
br i1 %192, label %196, label %193
193: ; preds = %190
%194 = load i32, i32* %13
%195 = icmp sge i32 %194, 21
br i1 %195, label %196, label %201
196: ; preds = %193, %190, %187, %184
%197 = call i32 (...) @endgraphics()
%198 = load i32, i32* %16
%199 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0), i32 %198)
%200 = call i32 @exit(i32 0)
unreachable
201: ; preds = %193
%202 = load i32, i32* %12
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds [39 x [21 x i32]], [39 x [21 x i32]]* %7, i64 0, i64 %203
%205 = load i32, i32* %13
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds [21 x i32], [21 x i32]* %204, i64 0, i64 %206
%208 = load i32, i32* %207
%209 = icmp ne i32 %208, 0
br i1 %209, label %210, label %215
210: ; preds = %201
%211 = call i32 (...) @endgraphics()
%212 = load i32, i32* %16
%213 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i32 %212)
%214 = call i32 @exit(i32 0)
unreachable
215: ; preds = %201
%216 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 0
%217 = load i32, i32* %12
%218 = load i32, i32* %13
%219 = call i32 @drawblock(i32** %216, i32 %217, i32 %218)
%220 = load i32, i32* %12
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds [39 x [21 x i32]], [39 x [21 x i32]]* %7, i64 0, i64 %221
%223 = load i32, i32* %13
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds [21 x i32], [21 x i32]* %222, i64 0, i64 %224
store i32 1, i32* %225
%226 = load i32, i32* %12
%227 = trunc i32 %226 to i16
%228 = load i32, i32* %20
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds [8192 x i16], [8192 x i16]* %8, i64 0, i64 %229
store i16 %227, i16* %230
%231 = load i32, i32* %13
%232 = trunc i32 %231 to i16
%233 = load i32, i32* %20
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds [8192 x i16], [8192 x i16]* %9, i64 0, i64 %234
store i16 %232, i16* %235
%236 = load i32, i32* %18
%237 = load i32, i32* %12
%238 = icmp eq i32 %236, %237
br i1 %238, label %239, label %252
239: ; preds = %215
%240 = load i32, i32* %19
%241 = load i32, i32* %13
%242 = icmp eq i32 %240, %241
br i1 %242, label %243, label %252
243: ; preds = %239
%244 = load i32, i32* %16
%245 = add nsw i32 %244, 1
store i32 %245, i32* %16
%246 = load i32, i32* %11
%247 = add nsw i32 %246, 5
store i32 %247, i32* %11
%248 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 0
%249 = getelementptr inbounds [39 x [21 x i32]], [39 x [21 x i32]]* %7, i64 0, i64 0
%250 = bitcast [21 x i32]* %249 to i32**
%251 = call i32 @newdot(i32** %248, i32** %250, i32* %18, i32* %19)
br label %252
252: ; preds = %243, %239, %215
%253 = load i32, i32* %11
%254 = icmp sgt i32 %253, 0
br i1 %254, label %255, label %260
255: ; preds = %252
%256 = load i32, i32* %11
%257 = add nsw i32 %256, -1
store i32 %257, i32* %11
%258 = load i32, i32* %10
%259 = add nsw i32 %258, 1
store i32 %259, i32* %10
br label %291
260: ; preds = %252
%261 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 0
%262 = load i32, i32* %20
%263 = load i32, i32* %10
%264 = sub nsw i32 %262, %263
%265 = sext i32 %264 to i64
%266 = getelementptr inbounds [8192 x i16], [8192 x i16]* %8, i64 0, i64 %265
%267 = load i16, i16* %266
%268 = load i32, i32* %20
%269 = load i32, i32* %10
%270 = sub nsw i32 %268, %269
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds [8192 x i16], [8192 x i16]* %9, i64 0, i64 %271
%273 = load i16, i16* %272
%274 = call i32 @clearblock(i32** %261, i16 signext %267, i16 signext %273)
%275 = load i32, i32* %20
%276 = load i32, i32* %10
%277 = sub nsw i32 %275, %276
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds [8192 x i16], [8192 x i16]* %8, i64 0, i64 %278
%280 = load i16, i16* %279
%281 = sext i16 %280 to i64
%282 = getelementptr inbounds [39 x [21 x i32]], [39 x [21 x i32]]* %7, i64 0, i64 %281
%283 = load i32, i32* %20
%284 = load i32, i32* %10
%285 = sub nsw i32 %283, %284
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds [8192 x i16], [8192 x i16]* %9, i64 0, i64 %286
%288 = load i16, i16* %287
%289 = sext i16 %288 to i64
%290 = getelementptr inbounds [21 x i32], [21 x i32]* %282, i64 0, i64 %289
store i32 0, i32* %290
br label %291
291: ; preds = %260, %255
%292 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 1
%293 = load i32*, i32** %292
%294 = call i32 @wrefresh(i32* %293)
%295 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 2
%296 = load i32*, i32** %295
%297 = load i32, i32* %16
%298 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %296, i32 0, i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %297)
%299 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 2
%300 = load i32*, i32** %299
%301 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %300, i32 0, i32 30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%302 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 2
%303 = load i32*, i32** %302
%304 = call i32 @wrefresh(i32* %303)
%305 = call i32 @usleep(i32 100000)
%306 = load i32, i32* %20
%307 = add nsw i32 %306, 1
store i32 %307, i32* %20
%308 = load i32, i32* %20
%309 = icmp eq i32 %308, 8192
br i1 %309, label %310, label %336
310: ; preds = %291
%311 = getelementptr inbounds [8192 x i16], [8192 x i16]* %8, i64 0, i64 0
%312 = getelementptr inbounds [8192 x i16], [8192 x i16]* %8, i64 0, i64 0
%313 = getelementptr inbounds i16, i16* %312, i64 8192
%314 = load i32, i32* %10
%315 = sext i32 %314 to i64
%316 = sub i64 0, %315
%317 = getelementptr inbounds i16, i16* %313, i64 %316
%318 = load i32, i32* %10
%319 = sext i32 %318 to i64
%320 = mul i64 %319, 2
%321 = trunc i64 %320 to i32
%322 = call i32 @memcpy(i16* %311, i16* %317, i32 %321)
%323 = getelementptr inbounds [8192 x i16], [8192 x i16]* %9, i64 0, i64 0
%324 = getelementptr inbounds [8192 x i16], [8192 x i16]* %9, i64 0, i64 0
%325 = getelementptr inbounds i16, i16* %324, i64 8192
%326 = load i32, i32* %10
%327 = sext i32 %326 to i64
%328 = sub i64 0, %327
%329 = getelementptr inbounds i16, i16* %325, i64 %328
%330 = load i32, i32* %10
%331 = sext i32 %330 to i64
%332 = mul i64 %331, 2
%333 = trunc i64 %332 to i32
%334 = call i32 @memcpy(i16* %323, i16* %329, i32 %333)
%335 = load i32, i32* %10
store i32 %335, i32* %20
br label %336
336: ; preds = %310, %291
br label %79
}

LLVM IR (-O2):
@ERR = global i32 0
@.str = [7 x i8] c" \00"
@.str.1 = [29 x i8] c"Quitter! Your score was %d.\0A\00"
@.str.2 = [12 x i8] c"Score: %d \00"
@.str.3 = [7 x i8] c"Paused\00"
@.str.4 = [43 x i8] c"You crashed in a wall. Your score was %d.\0A\00"
@.str.5 = [47 x i8] c"You crashed with yourself. Your score was %d.\0A\00"
@.str.6 = [11 x i8] c"Score: %d\00"
@.str.7 = [8 x i8] c" \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i32*]
%4 = alloca [39 x [21 x i32]]
%5 = alloca [8192 x i16]
%6 = alloca [8192 x i16]
%7 = alloca i32
%8 = alloca i32
%9 = bitcast [3 x i32*]* %3 to i8*
%10 = bitcast [39 x [21 x i32]]* %4 to i8*
%11 = bitcast [8192 x i16]* %5 to i8*
%12 = bitcast [8192 x i16]* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = bitcast i32* %8 to i8*
%15 = getelementptr inbounds [3 x i32*], [3 x i32*]* %3, i64 0, i64 0
%16 = call i32 @startgraphics(i32** %15)
%17 = call i32 (...) @randomize()
%18 = bitcast [39 x [21 x i32]]* %4 to i32**
%19 = call i32 @memset(i32** %18, i32 0, i32 3276)
%20 = getelementptr inbounds [8192 x i16], [8192 x i16]* %5, i64 0, i64 0
store i16 18, i16* %20
%21 = getelementptr inbounds [8192 x i16], [8192 x i16]* %6, i64 0, i64 0
store i16 10, i16* %21
%22 = getelementptr inbounds [39 x [21 x i32]], [39 x [21 x i32]]* %4, i64 0, i64 18, i64 10
store i32 1, i32* %22
%23 = call i32 @drawblock(i32** %15, i32 18, i32 10)
%24 = getelementptr inbounds [8192 x i16], [8192 x i16]* %5, i64 0, i64 1
store i16 19, i16* %24
%25 = getelementptr inbounds [8192 x i16], [8192 x i16]* %6, i64 0, i64 1
store i16 10, i16* %25
%26 = getelementptr inbounds [39 x [21 x i32]], [39 x [21 x i32]]* %4, i64 0, i64 19, i64 10
store i32 1, i32* %26
%27 = call i32 @drawblock(i32** %15, i32 19, i32 10)
%28 = getelementptr inbounds [8192 x i16], [8192 x i16]* %5, i64 0, i64 2
store i16 20, i16* %28
%29 = getelementptr inbounds [8192 x i16], [8192 x i16]* %6, i64 0, i64 2
store i16 10, i16* %29
%30 = getelementptr inbounds [39 x [21 x i32]], [39 x [21 x i32]]* %4, i64 0, i64 20, i64 10
store i32 1, i32* %30
%31 = call i32 @drawblock(i32** %15, i32 20, i32 10)
%32 = getelementptr inbounds [8192 x i16], [8192 x i16]* %5, i64 0, i64 3
store i16 21, i16* %32
%33 = getelementptr inbounds [8192 x i16], [8192 x i16]* %6, i64 0, i64 3
store i16 10, i16* %33
%34 = getelementptr inbounds [39 x [21 x i32]], [39 x [21 x i32]]* %4, i64 0, i64 21, i64 10
store i32 1, i32* %34
%35 = call i32 @drawblock(i32** %15, i32 21, i32 10)
%36 = getelementptr inbounds [8192 x i16], [8192 x i16]* %5, i64 0, i64 4
store i16 22, i16* %36
%37 = getelementptr inbounds [8192 x i16], [8192 x i16]* %6, i64 0, i64 4
store i16 10, i16* %37
%38 = getelementptr inbounds [39 x [21 x i32]], [39 x [21 x i32]]* %4, i64 0, i64 22, i64 10
store i32 1, i32* %38
%39 = call i32 @drawblock(i32** %15, i32 22, i32 10)
%40 = call i32 @newdot(i32** %15, i32** %18, i32* %7, i32* %8)
%41 = getelementptr inbounds [3 x i32*], [3 x i32*]* %3, i64 0, i64 1
%42 = getelementptr inbounds [3 x i32*], [3 x i32*]* %3, i64 0, i64 2
%43 = getelementptr inbounds [8192 x i16], [8192 x i16]* %5, i64 0, i64 8192
%44 = getelementptr inbounds [8192 x i16], [8192 x i16]* %6, i64 0, i64 8192
br label %45
45: ; preds = %211, %2
%46 = phi i32 [ 5, %2 ], [ %190, %211 ]
%47 = phi i32 [ 0, %2 ], [ %191, %211 ]
%48 = phi i32 [ 22, %2 ], [ %132, %211 ]
%49 = phi i32 [ 10, %2 ], [ %133, %211 ]
%50 = phi i32 [ 2, %2 ], [ %121, %211 ]
%51 = phi i32 [ 0, %2 ], [ %171, %211 ]
%52 = phi i32 [ 0, %2 ], [ %122, %211 ]
%53 = phi i32 [ 5, %2 ], [ %212, %211 ]
%54 = icmp eq i32 %52, 0
br i1 %54, label %86, label %55
55: ; preds = %45, %76
%56 = load i32*, i32** %41
%57 = call i32 @wgetch(i32* %56)
%58 = load i32, i32* @ERR
%59 = icmp eq i32 %57, %58
br i1 %59, label %76, label %60
60: ; preds = %55, %70
%61 = phi i32 [ %73, %70 ], [ %57, %55 ]
%62 = phi i32 [ %71, %70 ], [ 1, %55 ]
switch i32 %61, label %70 [
i32 112, label %63
i32 113, label %66
]
63: ; preds = %60
%64 = load i32*, i32** %42
%65 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %64, i32 0, i32 71, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %70
66: ; preds = %60
%67 = call i32 (...) @endgraphics()
%68 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %51)
%69 = call i32 @exit(i32 0)
unreachable
70: ; preds = %60, %63
%71 = phi i32 [ %62, %60 ], [ 0, %63 ]
%72 = load i32*, i32** %41
%73 = call i32 @wgetch(i32* %72)
%74 = load i32, i32* @ERR
%75 = icmp eq i32 %73, %74
br i1 %75, label %76, label %60
76: ; preds = %70, %55
%77 = phi i32 [ 1, %55 ], [ %71, %70 ]
%78 = load i32*, i32** %42
%79 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %78, i32 0, i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %51)
%80 = load i32*, i32** %42
%81 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %80, i32 0, i32 71, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%82 = load i32*, i32** %42
%83 = call i32 @wrefresh(i32* %82)
%84 = call i32 @usleep(i32 100000)
%85 = icmp eq i32 %77, 0
br i1 %85, label %86, label %55
86: ; preds = %76, %45
%87 = load i32*, i32** %41
%88 = call i32 @wgetch(i32* %87)
%89 = load i32, i32* @ERR
%90 = icmp eq i32 %88, %89
br i1 %90, label %120, label %91
91: ; preds = %86
%92 = add i32 %50, -1
%93 = icmp ult i32 %92, 2
%94 = add i32 %50, -3
%95 = icmp ult i32 %94, 2
br label %96
96: ; preds = %91, %113
%97 = phi i32 [ %88, %91 ], [ %117, %113 ]
%98 = phi i32 [ 0, %91 ], [ %115, %113 ]
%99 = phi i32 [ %50, %91 ], [ %114, %113 ]
switch i32 %97, label %113 [
i32 130, label %100
i32 104, label %100
i32 129, label %102
i32 108, label %102
i32 128, label %104
i32 107, label %104
i32 131, label %106
i32 106, label %106
i32 112, label %108
i32 113, label %109
]
100: ; preds = %96, %96
%101 = select i1 %95, i32 1, i32 %99
br label %113
102: ; preds = %96, %96
%103 = select i1 %95, i32 2, i32 %99
br label %113
104: ; preds = %96, %96
%105 = select i1 %93, i32 3, i32 %99
br label %113
106: ; preds = %96, %96
%107 = select i1 %93, i32 4, i32 %99
br label %113
108: ; preds = %96
br label %113
109: ; preds = %96
%110 = call i32 (...) @endgraphics()
%111 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %51)
%112 = call i32 @exit(i32 0)
unreachable
113: ; preds = %106, %104, %102, %100, %96, %108
%114 = phi i32 [ %99, %96 ], [ %99, %108 ], [ %101, %100 ], [ %103, %102 ], [ %105, %104 ], [ %107, %106 ]
%115 = phi i32 [ %98, %96 ], [ 1, %108 ], [ %98, %100 ], [ %98, %102 ], [ %98, %104 ], [ %98, %106 ]
%116 = load i32*, i32** %41
%117 = call i32 @wgetch(i32* %116)
%118 = load i32, i32* @ERR
%119 = icmp eq i32 %117, %118
br i1 %119, label %120, label %96
120: ; preds = %113, %86
%121 = phi i32 [ %50, %86 ], [ %114, %113 ]
%122 = phi i32 [ 0, %86 ], [ %115, %113 ]
switch i32 %121, label %131 [
i32 1, label %123
i32 2, label %125
i32 3, label %127
i32 4, label %129
]
123: ; preds = %120
%124 = add nsw i32 %48, -1
br label %131
125: ; preds = %120
%126 = add nsw i32 %48, 1
br label %131
127: ; preds = %120
%128 = add nsw i32 %49, -1
br label %131
129: ; preds = %120
%130 = add nsw i32 %49, 1
br label %131
131: ; preds = %120, %129, %127, %125, %123
%132 = phi i32 [ %48, %120 ], [ %48, %129 ], [ %48, %127 ], [ %126, %125 ], [ %124, %123 ]
%133 = phi i32 [ %49, %120 ], [ %130, %129 ], [ %128, %127 ], [ %49, %125 ], [ %49, %123 ]
%134 = icmp ugt i32 %132, 38
%135 = icmp slt i32 %133, 0
%136 = select i1 %134, i1 true, i1 %135
%137 = icmp sgt i32 %133, 20
%138 = select i1 %136, i1 true, i1 %137
br i1 %138, label %139, label %143
139: ; preds = %131
%140 = call i32 (...) @endgraphics()
%141 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0), i32 %51)
%142 = call i32 @exit(i32 0)
unreachable
143: ; preds = %131
%144 = zext i32 %132 to i64
%145 = zext i32 %133 to i64
%146 = getelementptr inbounds [39 x [21 x i32]], [39 x [21 x i32]]* %4, i64 0, i64 %144, i64 %145
%147 = load i32, i32* %146
%148 = icmp eq i32 %147, 0
br i1 %148, label %153, label %149
149: ; preds = %143
%150 = call i32 (...) @endgraphics()
%151 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i32 %51)
%152 = call i32 @exit(i32 0)
unreachable
153: ; preds = %143
%154 = call i32 @drawblock(i32** %15, i32 %132, i32 %133)
store i32 1, i32* %146
%155 = trunc i32 %132 to i16
%156 = sext i32 %53 to i64
%157 = getelementptr inbounds [8192 x i16], [8192 x i16]* %5, i64 0, i64 %156
store i16 %155, i16* %157
%158 = trunc i32 %133 to i16
%159 = getelementptr inbounds [8192 x i16], [8192 x i16]* %6, i64 0, i64 %156
store i16 %158, i16* %159
%160 = load i32, i32* %7
%161 = icmp eq i32 %160, %132
%162 = load i32, i32* %8
%163 = icmp eq i32 %162, %133
%164 = select i1 %161, i1 %163, i1 false
br i1 %164, label %165, label %169
165: ; preds = %153
%166 = add nsw i32 %51, 1
%167 = add nsw i32 %47, 5
%168 = call i32 @newdot(i32** %15, i32** %18, i32* %7, i32* %8)
br label %169
169: ; preds = %165, %153
%170 = phi i32 [ %167, %165 ], [ %47, %153 ]
%171 = phi i32 [ %166, %165 ], [ %51, %153 ]
%172 = icmp sgt i32 %170, 0
br i1 %172, label %173, label %176
173: ; preds = %169
%174 = add nsw i32 %170, -1
%175 = add nsw i32 %46, 1
br label %189
176: ; preds = %169
%177 = sub nsw i32 %53, %46
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds [8192 x i16], [8192 x i16]* %5, i64 0, i64 %178
%180 = load i16, i16* %179
%181 = getelementptr inbounds [8192 x i16], [8192 x i16]* %6, i64 0, i64 %178
%182 = load i16, i16* %181
%183 = call i32 @clearblock(i32** %15, i16 signext %180, i16 signext %182)
%184 = load i16, i16* %179
%185 = sext i16 %184 to i64
%186 = load i16, i16* %181
%187 = sext i16 %186 to i64
%188 = getelementptr inbounds [39 x [21 x i32]], [39 x [21 x i32]]* %4, i64 0, i64 %185, i64 %187
store i32 0, i32* %188
br label %189
189: ; preds = %176, %173
%190 = phi i32 [ %175, %173 ], [ %46, %176 ]
%191 = phi i32 [ %174, %173 ], [ %170, %176 ]
%192 = load i32*, i32** %41
%193 = call i32 @wrefresh(i32* %192)
%194 = load i32*, i32** %42
%195 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %194, i32 0, i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %171)
%196 = load i32*, i32** %42
%197 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %196, i32 0, i32 30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%198 = load i32*, i32** %42
%199 = call i32 @wrefresh(i32* %198)
%200 = call i32 @usleep(i32 100000)
%201 = add nsw i32 %53, 1
%202 = icmp eq i32 %201, 8192
br i1 %202, label %203, label %211
203: ; preds = %189
%204 = sext i32 %190 to i64
%205 = sub nsw i64 0, %204
%206 = getelementptr inbounds i16, i16* %43, i64 %205
%207 = shl i32 %190, 1
%208 = call i32 @memcpy(i16* %20, i16* %206, i32 %207)
%209 = getelementptr inbounds i16, i16* %44, i64 %205
%210 = call i32 @memcpy(i16* %21, i16* %209, i32 %207)
br label %211
211: ; preds = %203, %189
%212 = phi i32 [ %190, %203 ], [ %201, %189 ]
br label %45
}