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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int COLORS;
int KEY_DOWN;
int KEY_LEFT;
int KEY_RIGHT;
int KEY_UP;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ endwin();
int getch();
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ init_color(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ init_pair(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ render(short, long double, long double, long double, int,
                          int);
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
int main() {
  long double zoom = 1;
  long double zoom_factor = 1.25;
  long double shift_x = -11;
  long double shift_y = 0;
  int width = 50;
  int height = 20;
  int c = 0;
  short color;
  initscr();
  noecho();
  cbreak();
  keypad(stdscr, TRUE);
  color = COLORS >= 256;
  if (color) {
    start_color();
    init_color(0, 62 * 0, 0, 0);
    init_color(1, 62 * 1, 0, 0);
    init_color(2, 62 * 2, 0, 0);
    init_color(3, 62 * 3, 0, 0);
    init_color(4, 62 * 4, 0, 0);
    init_color(5, 62 * 5, 0, 0);
    init_color(6, 62 * 6, 0, 0);
    init_color(7, 62 * 7, 0, 0);
    init_color(8, 62 * 8, 0, 0);
    init_color(9, 62 * 9, 0, 0);
    init_color(10, 62 * 10, 0, 0);
    init_color(11, 62 * 11, 0, 0);
    init_color(12, 62 * 12, 0, 0);
    init_color(13, 62 * 13, 0, 0);
    init_color(14, 62 * 14, 0, 0);
    init_color(15, 62 * 15, 0, 0);
    init_pair(0, 0, 0);
    init_pair(1, 1, 0);
    init_pair(2, 2, 0);
    init_pair(3, 3, 0);
    init_pair(4, 4, 0);
    init_pair(5, 5, 0);
    init_pair(6, 6, 0);
    init_pair(7, 7, 0);
    init_pair(8, 8, 0);
    init_pair(9, 9, 0);
    init_pair(10, 10, 0);
    init_pair(11, 11, 0);
    init_pair(12, 12, 0);
    init_pair(13, 13, 0);
    init_pair(14, 14, 0);
    init_pair(15, 15, 0);
  }
  do {
    if (c == 'x' || c == 'X' || c == 'q' || c == 'Q') {
      break;
    } else if (c == '+') {
      zoom *= zoom_factor;
      shift_x *= zoom_factor;
      shift_y *= zoom_factor;
    } else if (c == '-') {
      zoom /= zoom_factor;
      shift_x /= zoom_factor;
      shift_y /= zoom_factor;
    } else if (c == KEY_UP) {
      shift_y--;
    } else if (c == KEY_DOWN) {
      shift_y++;
    } else if (c == KEY_LEFT) {
      shift_x--;
    } else if (c == KEY_RIGHT) {
      shift_x++;
    }
    getmaxyx(stdscr, height, width);
    if (zoom < 1)
      zoom = 1;
    render(color, zoom, shift_x, shift_y, width / 2, height / 2);
    refresh();
    c = getch();
  } while (c);
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
fld1
fstpt  -0x20(%rbp)
flds   0xe23(%rip)
fstpt  -0x30(%rbp)
flds   0xe1e(%rip)
fstpt  -0x40(%rbp)
fldz
fstpt  -0x50(%rbp)
movl   $0x32,-0x54(%rbp)
movl   $0x14,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    $0x0,%al
call   1070 <initscr@plt>
mov    $0x0,%al
call   10e0 <noecho@plt>
mov    $0x0,%al
call   1040 <cbreak@plt>
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
mov    0x2da8(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
mov    0x2d8a(%rip),%rax
cmpl   $0x100,(%rax)
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %ax,-0x5e(%rbp)
cmpw   $0x0,-0x5e(%rbp)
je     1461 <main+0x2a1>
mov    $0x0,%al
call   1090 <start_color@plt>
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0x1,%edi
mov    $0x3e,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0x2,%edi
mov    $0x7c,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0x3,%edi
mov    $0xba,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0x4,%edi
mov    $0xf8,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0x5,%edi
mov    $0x136,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0x6,%edi
mov    $0x174,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0x7,%edi
mov    $0x1b2,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0x8,%edi
mov    $0x1f0,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0x9,%edi
mov    $0x22e,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0xa,%edi
mov    $0x26c,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0xb,%edi
mov    $0x2aa,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0xc,%edi
mov    $0x2e8,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0xd,%edi
mov    $0x326,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0xe,%edi
mov    $0x364,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    $0xf,%edi
mov    $0x3a2,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1050 <init_pair@plt>
mov    $0x1,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
mov    $0x2,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
mov    $0x3,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
mov    $0x4,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
mov    $0x5,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
mov    $0x6,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
mov    $0x7,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
mov    $0x8,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
mov    $0x9,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
mov    $0xa,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
mov    $0xb,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
mov    $0xc,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
mov    $0xd,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
mov    $0xe,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
mov    $0xf,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <init_pair@plt>
jmp    1466 <main+0x2a6>
cmpl   $0x78,-0x5c(%rbp)
je     148e <main+0x2ce>
cmpl   $0x58,-0x5c(%rbp)
je     148e <main+0x2ce>
cmpl   $0x71,-0x5c(%rbp)
je     148e <main+0x2ce>
cmpl   $0x51,-0x5c(%rbp)
jne    1493 <main+0x2d3>
jmp    161e <main+0x45e>
cmpl   $0x2b,-0x5c(%rbp)
jne    14c3 <main+0x303>
fldt   -0x30(%rbp)
fldt   -0x20(%rbp)
fmulp  %st,%st(1)
fstpt  -0x20(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fmulp  %st,%st(1)
fstpt  -0x40(%rbp)
fldt   -0x30(%rbp)
fldt   -0x50(%rbp)
fmulp  %st,%st(1)
fstpt  -0x50(%rbp)
jmp    158f <main+0x3cf>
cmpl   $0x2d,-0x5c(%rbp)
jne    14f3 <main+0x333>
fldt   -0x30(%rbp)
fldt   -0x20(%rbp)
fdivp  %st,%st(1)
fstpt  -0x20(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fdivp  %st,%st(1)
fstpt  -0x40(%rbp)
fldt   -0x30(%rbp)
fldt   -0x50(%rbp)
fdivp  %st,%st(1)
fstpt  -0x50(%rbp)
jmp    158a <main+0x3ca>
mov    -0x5c(%rbp),%eax
mov    0x2ae3(%rip),%rcx
cmp    (%rcx),%eax
jne    1516 <main+0x356>
fldt   -0x50(%rbp)
fld1
fchs
faddp  %st,%st(1)
fstpt  -0x50(%rbp)
jmp    1585 <main+0x3c5>
mov    -0x5c(%rbp),%eax
mov    0x2ac8(%rip),%rcx
cmp    (%rcx),%eax
jne    1537 <main+0x377>
fldt   -0x50(%rbp)
fld1
faddp  %st,%st(1)
fstpt  -0x50(%rbp)
jmp    1580 <main+0x3c0>
mov    -0x5c(%rbp),%eax
mov    0x2a6f(%rip),%rcx
cmp    (%rcx),%eax
jne    155a <main+0x39a>
fldt   -0x40(%rbp)
fld1
fchs
faddp  %st,%st(1)
fstpt  -0x40(%rbp)
jmp    157b <main+0x3bb>
mov    -0x5c(%rbp),%eax
mov    0x2a54(%rip),%rcx
cmp    (%rcx),%eax
jne    1576 <main+0x3b6>
fldt   -0x40(%rbp)
fld1
faddp  %st,%st(1)
fstpt  -0x40(%rbp)
jmp    157b <main+0x3bb>
jmp    1580 <main+0x3c0>
jmp    1585 <main+0x3c5>
jmp    158a <main+0x3ca>
jmp    158f <main+0x3cf>
jmp    1594 <main+0x3d4>
mov    0x2a3d(%rip),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%esi
mov    -0x54(%rbp),%edx
call   10a0 <getmaxyx@plt>
fldt   -0x20(%rbp)
fld1
fucomip %st(1),%st
fstp   %st(0)
jbe    15c1 <main+0x401>
jmp    15bc <main+0x3fc>
fld1
fstpt  -0x20(%rbp)
mov    -0x5e(%rbp),%ax
mov    %ax,-0x60(%rbp)
fldt   -0x20(%rbp)
fldt   -0x40(%rbp)
fldt   -0x50(%rbp)
mov    -0x54(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x58(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x60(%rbp),%ax
mov    %rsp,%rcx
fstpt  0x20(%rcx)
fstpt  0x10(%rcx)
fstpt  (%rcx)
movswl %ax,%edi
call   1080 <render@plt>
mov    $0x0,%al
call   10b0 <refresh@plt>
mov    $0x0,%al
call   10c0 <getch@plt>
mov    %eax,-0x5c(%rbp)
cmpl   $0x0,-0x5c(%rbp)
jne    1466 <main+0x2a6>
mov    $0x0,%al
call   10d0 <endwin@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
xor    %eax,%eax
call   1070 <initscr@plt>
xor    %eax,%eax
call   10e0 <noecho@plt>
xor    %eax,%eax
call   1040 <cbreak@plt>
mov    0x2dee(%rip),%r14
mov    (%r14),%edi
mov    0x2ddc(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
mov    0x2dbe(%rip),%rax
xor    %ebx,%ebx
cmpl   $0x100,(%rax)
setge  %bl
jl     144e <main+0x28e>
xor    %eax,%eax
call   1090 <start_color@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0x1,%edi
mov    $0x3e,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0x2,%edi
mov    $0x7c,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0x3,%edi
mov    $0xba,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0x4,%edi
mov    $0xf8,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0x5,%edi
mov    $0x136,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0x6,%edi
mov    $0x174,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0x7,%edi
mov    $0x1b2,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0x8,%edi
mov    $0x1f0,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0x9,%edi
mov    $0x22e,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0xa,%edi
mov    $0x26c,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0xb,%edi
mov    $0x2aa,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0xc,%edi
mov    $0x2e8,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0xd,%edi
mov    $0x326,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0xe,%edi
mov    $0x364,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    $0xf,%edi
mov    $0x3a2,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0x1,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0x2,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0x3,%edi
mov    $0x3,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0x4,%edi
mov    $0x4,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0x5,%edi
mov    $0x5,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0x6,%edi
mov    $0x6,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0x7,%edi
mov    $0x7,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0x8,%edi
mov    $0x8,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0x9,%edi
mov    $0x9,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0xa,%edi
mov    $0xa,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0xb,%edi
mov    $0xb,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0xc,%edi
mov    $0xc,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0xd,%edi
mov    $0xd,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0xe,%edi
mov    $0xe,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
mov    $0xf,%edi
mov    $0xf,%esi
xor    %edx,%edx
call   1050 <init_pair@plt>
fld1
fstpt  0x40(%rsp)
flds   0xba6(%rip)
fstpt  0x4c(%rsp)
fldz
fstpt  0x34(%rsp)
movzwl %bx,%ebx
mov    0x2b72(%rip),%r15
mov    0x2b73(%rip),%r12
mov    0x2b34(%rip),%r13
mov    0x2b35(%rip),%rbp
xor    %eax,%eax
jmp    152b <main+0x36b>
nopw   0x0(%rax,%rax,1)
cmp    $0x2b,%eax
jne    1580 <main+0x3c0>
flds   0xb65(%rip)
fldt   0x40(%rsp)
fmul   %st(1),%st
fstpt  0x40(%rsp)
fldt   0x4c(%rsp)
fmul   %st(1),%st
fstpt  0x4c(%rsp)
fldt   0x34(%rsp)
fmulp  %st,%st(1)
fstpt  0x34(%rsp)
mov    (%r14),%edi
mov    $0x14,%esi
mov    $0x32,%edx
call   10a0 <getmaxyx@plt>
fld1
fldt   0x40(%rsp)
fxch   %st(1)
fucomi %st(1),%st
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
fldt   0x34(%rsp)
fld    %st(0)
fstpt  0x34(%rsp)
fstpt  0x20(%rsp)
fldt   0x4c(%rsp)
fld    %st(0)
fstpt  0x4c(%rsp)
fstpt  0x10(%rsp)
fld    %st(0)
fstpt  0x40(%rsp)
fstpt  (%rsp)
mov    %ebx,%edi
mov    $0x19,%esi
mov    $0xa,%edx
call   1080 <render@plt>
xor    %eax,%eax
call   10b0 <refresh@plt>
xor    %eax,%eax
call   10c0 <getch@plt>
test   %eax,%eax
je     15e6 <main+0x426>
cmp    $0x2c,%eax
jle    1490 <main+0x2d0>
cmp    $0x50,%eax
jg     1563 <main+0x3a3>
cmp    $0x2d,%eax
jne    1580 <main+0x3c0>
flds   0xac0(%rip)
fldt   0x40(%rsp)
fdiv   %st(1),%st
fstpt  0x40(%rsp)
fldt   0x4c(%rsp)
fdiv   %st(1),%st
fstpt  0x4c(%rsp)
fldt   0x34(%rsp)
fdivp  %st,%st(1)
jmp    14b9 <main+0x2f9>
cmp    $0x70,%eax
jg     1574 <main+0x3b4>
cmp    $0x51,%eax
je     15e6 <main+0x426>
cmp    $0x58,%eax
jne    1580 <main+0x3c0>
jmp    15e6 <main+0x426>
cmp    $0x71,%eax
je     15e6 <main+0x426>
cmp    $0x78,%eax
je     15e6 <main+0x426>
xchg   %ax,%ax
cmp    (%r15),%eax
jne    158b <main+0x3cb>
fld1
fchs
jmp    1593 <main+0x3d3>
cmp    (%r12),%eax
jne    15b2 <main+0x3f2>
fld1
fldt   0x34(%rsp)
faddp  %st,%st(1)
fstpt  0x34(%rsp)
fldt   0x40(%rsp)
fstpt  0x40(%rsp)
fldt   0x4c(%rsp)
fstpt  0x4c(%rsp)
jmp    14bd <main+0x2fd>
cmp    0x0(%r13),%eax
fldt   0x4c(%rsp)
jne    15c4 <main+0x404>
fld1
fchs
faddp  %st,%st(1)
jmp    15d1 <main+0x411>
cmp    0x0(%rbp),%eax
fld1
fadd   %st(1),%st
fxch   %st(1)
fcmove %st(1),%st
fstp   %st(1)
fstpt  0x4c(%rsp)
fldt   0x40(%rsp)
fstpt  0x40(%rsp)
fldt   0x34(%rsp)
jmp    14b9 <main+0x2f9>
xor    %eax,%eax
call   10d0 <endwin@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@COLORS = global i32 0
@KEY_UP = global i32 0
@KEY_DOWN = global i32 0
@KEY_LEFT = global i32 0
@KEY_RIGHT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i16
store i32 0, i32* %1
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %2
store x86_fp80 0xK3FFFA000000000000000, x86_fp80* %3
store x86_fp80 0xKC002B000000000000000, x86_fp80* %4
store x86_fp80 0xK00000000000000000000, x86_fp80* %5
store i32 50, i32* %6
store i32 20, i32* %7
store i32 0, i32* %8
%10 = call i32 (...) @initscr()
%11 = call i32 (...) @noecho()
%12 = call i32 (...) @cbreak()
%13 = load i32, i32* @stdscr
%14 = load i32, i32* @TRUE
%15 = call i32 @keypad(i32 %13, i32 %14)
%16 = load i32, i32* @COLORS
%17 = icmp sge i32 %16, 256
%18 = zext i1 %17 to i32
%19 = trunc i32 %18 to i16
store i16 %19, i16* %9
%20 = load i16, i16* %9
%21 = icmp ne i16 %20, 0
br i1 %21, label %22, label %56
22: ; preds = %0
%23 = call i32 (...) @start_color()
%24 = call i32 @init_color(i32 0, i32 0, i32 0, i32 0)
%25 = call i32 @init_color(i32 1, i32 62, i32 0, i32 0)
%26 = call i32 @init_color(i32 2, i32 124, i32 0, i32 0)
%27 = call i32 @init_color(i32 3, i32 186, i32 0, i32 0)
%28 = call i32 @init_color(i32 4, i32 248, i32 0, i32 0)
%29 = call i32 @init_color(i32 5, i32 310, i32 0, i32 0)
%30 = call i32 @init_color(i32 6, i32 372, i32 0, i32 0)
%31 = call i32 @init_color(i32 7, i32 434, i32 0, i32 0)
%32 = call i32 @init_color(i32 8, i32 496, i32 0, i32 0)
%33 = call i32 @init_color(i32 9, i32 558, i32 0, i32 0)
%34 = call i32 @init_color(i32 10, i32 620, i32 0, i32 0)
%35 = call i32 @init_color(i32 11, i32 682, i32 0, i32 0)
%36 = call i32 @init_color(i32 12, i32 744, i32 0, i32 0)
%37 = call i32 @init_color(i32 13, i32 806, i32 0, i32 0)
%38 = call i32 @init_color(i32 14, i32 868, i32 0, i32 0)
%39 = call i32 @init_color(i32 15, i32 930, i32 0, i32 0)
%40 = call i32 @init_pair(i32 0, i32 0, i32 0)
%41 = call i32 @init_pair(i32 1, i32 1, i32 0)
%42 = call i32 @init_pair(i32 2, i32 2, i32 0)
%43 = call i32 @init_pair(i32 3, i32 3, i32 0)
%44 = call i32 @init_pair(i32 4, i32 4, i32 0)
%45 = call i32 @init_pair(i32 5, i32 5, i32 0)
%46 = call i32 @init_pair(i32 6, i32 6, i32 0)
%47 = call i32 @init_pair(i32 7, i32 7, i32 0)
%48 = call i32 @init_pair(i32 8, i32 8, i32 0)
%49 = call i32 @init_pair(i32 9, i32 9, i32 0)
%50 = call i32 @init_pair(i32 10, i32 10, i32 0)
%51 = call i32 @init_pair(i32 11, i32 11, i32 0)
%52 = call i32 @init_pair(i32 12, i32 12, i32 0)
%53 = call i32 @init_pair(i32 13, i32 13, i32 0)
%54 = call i32 @init_pair(i32 14, i32 14, i32 0)
%55 = call i32 @init_pair(i32 15, i32 15, i32 0)
br label %56
56: ; preds = %22, %0
br label %57
57: ; preds = %150, %56
%58 = load i32, i32* %8
%59 = icmp eq i32 %58, 120
br i1 %59, label %69, label %60
60: ; preds = %57
%61 = load i32, i32* %8
%62 = icmp eq i32 %61, 88
br i1 %62, label %69, label %63
63: ; preds = %60
%64 = load i32, i32* %8
%65 = icmp eq i32 %64, 113
br i1 %65, label %69, label %66
66: ; preds = %63
%67 = load i32, i32* %8
%68 = icmp eq i32 %67, 81
br i1 %68, label %69, label %70
69: ; preds = %66, %63, %60, %57
br label %153
70: ; preds = %66
%71 = load i32, i32* %8
%72 = icmp eq i32 %71, 43
br i1 %72, label %73, label %83
73: ; preds = %70
%74 = load x86_fp80, x86_fp80* %3
%75 = load x86_fp80, x86_fp80* %2
%76 = fmul x86_fp80 %75, %74
store x86_fp80 %76, x86_fp80* %2
%77 = load x86_fp80, x86_fp80* %3
%78 = load x86_fp80, x86_fp80* %4
%79 = fmul x86_fp80 %78, %77
store x86_fp80 %79, x86_fp80* %4
%80 = load x86_fp80, x86_fp80* %3
%81 = load x86_fp80, x86_fp80* %5
%82 = fmul x86_fp80 %81, %80
store x86_fp80 %82, x86_fp80* %5
br label %129
83: ; preds = %70
%84 = load i32, i32* %8
%85 = icmp eq i32 %84, 45
br i1 %85, label %86, label %96
86: ; preds = %83
%87 = load x86_fp80, x86_fp80* %3
%88 = load x86_fp80, x86_fp80* %2
%89 = fdiv x86_fp80 %88, %87
store x86_fp80 %89, x86_fp80* %2
%90 = load x86_fp80, x86_fp80* %3
%91 = load x86_fp80, x86_fp80* %4
%92 = fdiv x86_fp80 %91, %90
store x86_fp80 %92, x86_fp80* %4
%93 = load x86_fp80, x86_fp80* %3
%94 = load x86_fp80, x86_fp80* %5
%95 = fdiv x86_fp80 %94, %93
store x86_fp80 %95, x86_fp80* %5
br label %128
96: ; preds = %83
%97 = load i32, i32* %8
%98 = load i32, i32* @KEY_UP
%99 = icmp eq i32 %97, %98
br i1 %99, label %100, label %103
100: ; preds = %96
%101 = load x86_fp80, x86_fp80* %5
%102 = fadd x86_fp80 %101, 0xKBFFF8000000000000000
store x86_fp80 %102, x86_fp80* %5
br label %127
103: ; preds = %96
%104 = load i32, i32* %8
%105 = load i32, i32* @KEY_DOWN
%106 = icmp eq i32 %104, %105
br i1 %106, label %107, label %110
107: ; preds = %103
%108 = load x86_fp80, x86_fp80* %5
%109 = fadd x86_fp80 %108, 0xK3FFF8000000000000000
store x86_fp80 %109, x86_fp80* %5
br label %126
110: ; preds = %103
%111 = load i32, i32* %8
%112 = load i32, i32* @KEY_LEFT
%113 = icmp eq i32 %111, %112
br i1 %113, label %114, label %117
114: ; preds = %110
%115 = load x86_fp80, x86_fp80* %4
%116 = fadd x86_fp80 %115, 0xKBFFF8000000000000000
store x86_fp80 %116, x86_fp80* %4
br label %125
117: ; preds = %110
%118 = load i32, i32* %8
%119 = load i32, i32* @KEY_RIGHT
%120 = icmp eq i32 %118, %119
br i1 %120, label %121, label %124
121: ; preds = %117
%122 = load x86_fp80, x86_fp80* %4
%123 = fadd x86_fp80 %122, 0xK3FFF8000000000000000
store x86_fp80 %123, x86_fp80* %4
br label %124
124: ; preds = %121, %117
br label %125
125: ; preds = %124, %114
br label %126
126: ; preds = %125, %107
br label %127
127: ; preds = %126, %100
br label %128
128: ; preds = %127, %86
br label %129
129: ; preds = %128, %73
br label %130
130: ; preds = %129
%131 = load i32, i32* @stdscr
%132 = load i32, i32* %7
%133 = load i32, i32* %6
%134 = call i32 @getmaxyx(i32 %131, i32 %132, i32 %133)
%135 = load x86_fp80, x86_fp80* %2
%136 = fcmp olt x86_fp80 %135, 0xK3FFF8000000000000000
br i1 %136, label %137, label %138
137: ; preds = %130
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %2
br label %138
138: ; preds = %137, %130
%139 = load i16, i16* %9
%140 = load x86_fp80, x86_fp80* %2
%141 = load x86_fp80, x86_fp80* %4
%142 = load x86_fp80, x86_fp80* %5
%143 = load i32, i32* %6
%144 = sdiv i32 %143, 2
%145 = load i32, i32* %7
%146 = sdiv i32 %145, 2
%147 = call i32 @render(i16 signext %139, x86_fp80 %140, x86_fp80 %141, x86_fp80 %142, i32 %144, i32 %146)
%148 = call i32 (...) @refresh()
%149 = call i32 (...) @getch()
store i32 %149, i32* %8
br label %150
150: ; preds = %138
%151 = load i32, i32* %8
%152 = icmp ne i32 %151, 0
br i1 %152, label %57, label %153
153: ; preds = %150, %69
%154 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@COLORS = global i32 0
@KEY_UP = global i32 0
@KEY_DOWN = global i32 0
@KEY_LEFT = global i32 0
@KEY_RIGHT = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
%3 = tail call i32 (...) @cbreak()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = tail call i32 @keypad(i32 %4, i32 %5)
%7 = load i32, i32* @COLORS
%8 = icmp sgt i32 %7, 255
%9 = zext i1 %8 to i16
br i1 %8, label %10, label %44
10: ; preds = %0
%11 = tail call i32 (...) @start_color()
%12 = tail call i32 @init_color(i32 0, i32 0, i32 0, i32 0)
%13 = tail call i32 @init_color(i32 1, i32 62, i32 0, i32 0)
%14 = tail call i32 @init_color(i32 2, i32 124, i32 0, i32 0)
%15 = tail call i32 @init_color(i32 3, i32 186, i32 0, i32 0)
%16 = tail call i32 @init_color(i32 4, i32 248, i32 0, i32 0)
%17 = tail call i32 @init_color(i32 5, i32 310, i32 0, i32 0)
%18 = tail call i32 @init_color(i32 6, i32 372, i32 0, i32 0)
%19 = tail call i32 @init_color(i32 7, i32 434, i32 0, i32 0)
%20 = tail call i32 @init_color(i32 8, i32 496, i32 0, i32 0)
%21 = tail call i32 @init_color(i32 9, i32 558, i32 0, i32 0)
%22 = tail call i32 @init_color(i32 10, i32 620, i32 0, i32 0)
%23 = tail call i32 @init_color(i32 11, i32 682, i32 0, i32 0)
%24 = tail call i32 @init_color(i32 12, i32 744, i32 0, i32 0)
%25 = tail call i32 @init_color(i32 13, i32 806, i32 0, i32 0)
%26 = tail call i32 @init_color(i32 14, i32 868, i32 0, i32 0)
%27 = tail call i32 @init_color(i32 15, i32 930, i32 0, i32 0)
%28 = tail call i32 @init_pair(i32 0, i32 0, i32 0)
%29 = tail call i32 @init_pair(i32 1, i32 1, i32 0)
%30 = tail call i32 @init_pair(i32 2, i32 2, i32 0)
%31 = tail call i32 @init_pair(i32 3, i32 3, i32 0)
%32 = tail call i32 @init_pair(i32 4, i32 4, i32 0)
%33 = tail call i32 @init_pair(i32 5, i32 5, i32 0)
%34 = tail call i32 @init_pair(i32 6, i32 6, i32 0)
%35 = tail call i32 @init_pair(i32 7, i32 7, i32 0)
%36 = tail call i32 @init_pair(i32 8, i32 8, i32 0)
%37 = tail call i32 @init_pair(i32 9, i32 9, i32 0)
%38 = tail call i32 @init_pair(i32 10, i32 10, i32 0)
%39 = tail call i32 @init_pair(i32 11, i32 11, i32 0)
%40 = tail call i32 @init_pair(i32 12, i32 12, i32 0)
%41 = tail call i32 @init_pair(i32 13, i32 13, i32 0)
%42 = tail call i32 @init_pair(i32 14, i32 14, i32 0)
%43 = tail call i32 @init_pair(i32 15, i32 15, i32 0)
br label %44
44: ; preds = %10, %0
br label %45
45: ; preds = %44, %78
%46 = phi x86_fp80 [ %79, %78 ], [ 0xK00000000000000000000, %44 ]
%47 = phi x86_fp80 [ %80, %78 ], [ 0xKC002B000000000000000, %44 ]
%48 = phi i32 [ %88, %78 ], [ 0, %44 ]
%49 = phi x86_fp80 [ %85, %78 ], [ 0xK3FFF8000000000000000, %44 ]
switch i32 %48, label %58 [
i32 120, label %90
i32 113, label %90
i32 88, label %90
i32 81, label %90
i32 43, label %50
i32 45, label %54
]
50: ; preds = %45
%51 = fmul x86_fp80 %49, 0xK3FFFA000000000000000
%52 = fmul x86_fp80 %47, 0xK3FFFA000000000000000
%53 = fmul x86_fp80 %46, 0xK3FFFA000000000000000
br label %78
54: ; preds = %45
%55 = fdiv x86_fp80 %49, 0xK3FFFA000000000000000
%56 = fdiv x86_fp80 %47, 0xK3FFFA000000000000000
%57 = fdiv x86_fp80 %46, 0xK3FFFA000000000000000
br label %78
58: ; preds = %45
%59 = load i32, i32* @KEY_UP
%60 = icmp eq i32 %48, %59
br i1 %60, label %61, label %63
61: ; preds = %58
%62 = fadd x86_fp80 %46, 0xKBFFF8000000000000000
br label %78
63: ; preds = %58
%64 = load i32, i32* @KEY_DOWN
%65 = icmp eq i32 %48, %64
br i1 %65, label %66, label %68
66: ; preds = %63
%67 = fadd x86_fp80 %46, 0xK3FFF8000000000000000
br label %78
68: ; preds = %63
%69 = load i32, i32* @KEY_LEFT
%70 = icmp eq i32 %48, %69
br i1 %70, label %71, label %73
71: ; preds = %68
%72 = fadd x86_fp80 %47, 0xKBFFF8000000000000000
br label %78
73: ; preds = %68
%74 = load i32, i32* @KEY_RIGHT
%75 = icmp eq i32 %48, %74
%76 = fadd x86_fp80 %47, 0xK3FFF8000000000000000
%77 = select i1 %75, x86_fp80 %76, x86_fp80 %47
br label %78
78: ; preds = %73, %50, %61, %71, %66, %54
%79 = phi x86_fp80 [ %53, %50 ], [ %57, %54 ], [ %62, %61 ], [ %67, %66 ], [ %46, %71 ], [ %46, %73 ]
%80 = phi x86_fp80 [ %52, %50 ], [ %56, %54 ], [ %47, %61 ], [ %47, %66 ], [ %72, %71 ], [ %77, %73 ]
%81 = phi x86_fp80 [ %51, %50 ], [ %55, %54 ], [ %49, %61 ], [ %49, %66 ], [ %49, %71 ], [ %49, %73 ]
%82 = load i32, i32* @stdscr
%83 = tail call i32 @getmaxyx(i32 %82, i32 20, i32 50)
%84 = fcmp olt x86_fp80 %81, 0xK3FFF8000000000000000
%85 = select i1 %84, x86_fp80 0xK3FFF8000000000000000, x86_fp80 %81
%86 = tail call i32 @render(i16 signext %9, x86_fp80 %85, x86_fp80 %80, x86_fp80 %79, i32 25, i32 10)
%87 = tail call i32 (...) @refresh()
%88 = tail call i32 (...) @getch()
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %45
90: ; preds = %45, %45, %45, %45, %78
%91 = tail call i32 (...) @endwin()
ret i32 0
}