#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*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ ACS_HLINE;
int /*<<< orphan*/ ACS_VLINE;
int /*<<< orphan*/ A_BOLD;
int /*<<< orphan*/ Continue(int /*<<< orphan*/ *);
int ERR;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ echo();
int /*<<< orphan*/ flash();
int /*<<< orphan*/ flushinp();
int /*<<< orphan*/ getbegyx(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/ *, int, int);
scalar_t__ has_key(int);
scalar_t__ isprint(int);
int keyname(int);
int /*<<< orphan*/ keypad(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ mvwaddch(int /*<<< orphan*/ *, int, int, char const);
int /*<<< orphan*/ mvwaddstr(int /*<<< orphan*/ *, int, int, char *);
int /*<<< orphan*/ mvwin(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int, char *, ...);
int /*<<< orphan*/ mvwscanw(int /*<<< orphan*/ *, int, int, char *, int *,
                            char *);
int /*<<< orphan*/ napms(int);
int /*<<< orphan*/ nocbreak();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ *subwin(int /*<<< orphan*/ *, int, int, int, int);
int unctrl(int);
int /*<<< orphan*/ waddch(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ wbkgd(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ wclear(int /*<<< orphan*/ *);
int /*<<< orphan*/ wclrtoeol(int /*<<< orphan*/ *);
int /*<<< orphan*/ wdelch(int /*<<< orphan*/ *);
int /*<<< orphan*/ werase(int /*<<< orphan*/ *);
int wgetch(int /*<<< orphan*/ *);
int /*<<< orphan*/ wgetnstr(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ wmove(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ wprintw(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
int /*<<< orphan*/ wtimeout(int /*<<< orphan*/ *, int);
void inputTest(WINDOW *win) {
  int w, h, bx, by, sw, sh, i, c, num = 0;
  int line_to_use = 3;
  char buffer[80];
  WINDOW *subWin;
  static const char spinner[4] = "/-\\|";
  int spinner_count = 0;
  wclear(win);
  getmaxyx(win, h, w);
  getbegyx(win, by, bx);
  sw = w / 3;
  sh = h / 3;
  if ((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2)) == NULL)
    return;
  wbkgd(subWin, A_BOLD);
  box(subWin, ACS_VLINE, ACS_HLINE);
  wrefresh(win);
  nocbreak();
  wclear(win);
  mvwaddstr(win, 1, 1, "Press keys (or mouse buttons) to show their names");
  mvwaddstr(win, 2, 1, "Press spacebar to finish");
  wrefresh(win);
  keypad(win, TRUE);
  raw();
  noecho();
  wtimeout(win, 200);
  curs_set(0);
  while (1) {
    while (1) {
      c = wgetch(win);
      if (c == ERR) {
        spinner_count++;
        if (spinner_count == 4)
          spinner_count = 0;
        mvwaddch(win, line_to_use, 3, spinner[spinner_count]);
        wrefresh(win);
      } else
        break;
    }
    mvwaddstr(win, line_to_use, 5, "Key Pressed: ");
    wclrtoeol(win);
    wprintw(win, "(%x) ", c);
    if (has_key(c))
      wprintw(win, "%s", keyname(c));
    else if (isprint(c) || c > 0xff)
      waddch(win, c);
    else
      wprintw(win, "%s", unctrl(c));
    wrefresh(win);
    if (c == ' ')
      break;
    line_to_use++;
    if (line_to_use == 10)
      line_to_use = 3;
  }
  wtimeout(win, -1);
  curs_set(1);
  wclear(win);
  mvwaddstr(win, 2, 1, "Press some keys for 5 seconds");
  mvwaddstr(win, 1, 1, "Pressing ^C should do nothing");
  wrefresh(win);
  werase(subWin);
  box(subWin, ACS_VLINE, ACS_HLINE);
  for (i = 0; i < 5; i++) {
    mvwprintw(subWin, 1, 1, "Time = %d", i);
    wrefresh(subWin);
    napms(1000);
    flushinp();
  }
  delwin(subWin);
  werase(win);
  flash();
  wrefresh(win);
  napms(500);
  flushinp();
  mvwaddstr(win, 2, 1, "Press a key, followed by ENTER");
  wmove(win, 9, 10);
  wrefresh(win);
  echo();
  keypad(win, TRUE);
  raw();
  wgetnstr(win, buffer, 3);
  flushinp();
  wmove(win, 9, 10);
  wdelch(win);
  mvwaddstr(win, 4, 1, "The character should now have been deleted");
  Continue(win);
  refresh();
  wclear(win);
  echo();
  buffer[0] = '\0';
  mvwaddstr(win, 3, 2, "The window should have moved");
  mvwaddstr(win, 4, 2,
            "This text should have appeared without you pressing a key");
  mvwaddstr(win, 6, 2, "Enter a number then a string seperated by space");
  mvwin(win, 2, 1);
  wrefresh(win);
  mvwscanw(win, 7, 6, "%d %s", &num, buffer);
  mvwprintw(win, 8, 6, "String: %s Number: %d", buffer, num);
  Continue(win);
  refresh();
  wclear(win);
  echo();
  mvwaddstr(win, 3, 2, "Enter a 5 character string: ");
  wgetnstr(win, buffer, 5);
  mvwprintw(win, 4, 2, "String: %s", buffer);
  Continue(win);
}


x86 assembly (clang, -O0):
<inputTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x3,-0x30(%rbp)
movl   $0x0,-0x8c(%rbp)
mov    -0x8(%rbp),%rdi
call   1190 <wclear@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   10e0 <getmaxyx@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1110 <getbegyx@plt>
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
add    -0x10(%rbp),%ecx
sub    -0x20(%rbp),%ecx
sub    $0x2,%ecx
mov    -0x14(%rbp),%r8d
add    -0xc(%rbp),%r8d
sub    -0x1c(%rbp),%r8d
sub    $0x2,%r8d
call   10b0 <subwin@plt>
mov    %rax,-0x88(%rbp)
cmp    $0x0,%rax
jne    13fb <inputTest+0xab>
jmp    1946 <inputTest+0x5f6>
mov    -0x88(%rbp),%rdi
mov    0x2bbf(%rip),%rax
mov    (%rax),%esi
call   1070 <wbkgd@plt>
mov    -0x88(%rbp),%rdi
mov    0x2ba2(%rip),%rax
mov    (%rax),%esi
mov    0x2ba9(%rip),%rax
mov    (%rax),%edx
call   1100 <box@plt>
mov    -0x8(%rbp),%rdi
call   1080 <wrefresh@plt>
mov    $0x0,%al
call   11c0 <nocbreak@plt>
mov    -0x8(%rbp),%rdi
call   1190 <wclear@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
lea    0xbad(%rip),%rcx
mov    %edx,%esi
call   1240 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xbc3(%rip),%rcx
call   1240 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1080 <wrefresh@plt>
mov    -0x8(%rbp),%rdi
mov    0x2b54(%rip),%rax
mov    (%rax),%esi
call   1090 <keypad@plt>
mov    $0x0,%al
call   10a0 <raw@plt>
mov    $0x0,%al
call   11d0 <noecho@plt>
mov    -0x8(%rbp),%rdi
mov    $0xc8,%esi
call   10d0 <wtimeout@plt>
xor    %edi,%edi
call   1230 <curs_set@plt>
jmp    14bb <inputTest+0x16b>
mov    -0x8(%rbp),%rdi
call   1180 <wgetch@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    0x2b17(%rip),%rcx
cmp    (%rcx),%eax
jne    1530 <inputTest+0x1e0>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
cmpl   $0x4,-0x8c(%rbp)
jne    14ff <inputTest+0x1af>
movl   $0x0,-0x8c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%esi
movslq -0x8c(%rbp),%rcx
mov    $0x3,%edx
lea    0xae7(%rip),%rax
movsbl (%rax,%rcx,1),%ecx
call   1200 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
call   1080 <wrefresh@plt>
jmp    1535 <inputTest+0x1e5>
jmp    153a <inputTest+0x1ea>
jmp    14bb <inputTest+0x16b>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%esi
mov    $0x5,%edx
lea    0xb02(%rip),%rcx
call   1240 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1060 <wclrtoeol@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%edx
lea    0xaf4(%rip),%rsi
call   1130 <wprintw@plt>
mov    -0x28(%rbp),%edi
call   11b0 <has_key@plt>
cmp    $0x0,%rax
je     15ad <inputTest+0x25d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x28(%rbp),%edi
call   10f0 <keyname@plt>
mov    -0x98(%rbp),%rdi
mov    %eax,%edx
lea    0xc18(%rip),%rsi
call   1130 <wprintw@plt>
jmp    160a <inputTest+0x2ba>
mov    -0x28(%rbp),%edi
call   1170 <isprint@plt>
cmp    $0x0,%rax
jne    15cc <inputTest+0x27c>
cmpl   $0xff,-0x28(%rbp)
jle    15dd <inputTest+0x28d>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%esi
call   1040 <waddch@plt>
jmp    1605 <inputTest+0x2b5>
mov    -0x8(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x28(%rbp),%edi
call   10c0 <unctrl@plt>
mov    -0xa0(%rbp),%rdi
mov    %eax,%edx
lea    0xbbb(%rip),%rsi
call   1130 <wprintw@plt>
jmp    160a <inputTest+0x2ba>
mov    -0x8(%rbp),%rdi
call   1080 <wrefresh@plt>
cmpl   $0x20,-0x28(%rbp)
jne    1622 <inputTest+0x2d2>
jmp    1641 <inputTest+0x2f1>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
cmpl   $0xa,-0x30(%rbp)
jne    163c <inputTest+0x2ec>
movl   $0x3,-0x30(%rbp)
jmp    14b6 <inputTest+0x166>
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
call   10d0 <wtimeout@plt>
mov    $0x1,%edi
call   1230 <curs_set@plt>
mov    -0x8(%rbp),%rdi
call   1190 <wclear@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
lea    0x9ec(%rip),%rcx
call   1240 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
lea    0x9f5(%rip),%rcx
mov    %edx,%esi
call   1240 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1080 <wrefresh@plt>
mov    -0x88(%rbp),%rdi
call   1270 <werase@plt>
mov    -0x88(%rbp),%rdi
mov    0x290a(%rip),%rax
mov    (%rax),%esi
mov    0x2911(%rip),%rax
mov    (%rax),%edx
call   1100 <box@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    1722 <inputTest+0x3d2>
mov    -0x88(%rbp),%rdi
mov    -0x24(%rbp),%r8d
mov    $0x1,%edx
lea    0x9b1(%rip),%rcx
mov    %edx,%esi
mov    $0x0,%al
call   11a0 <mvwprintw@plt>
mov    -0x88(%rbp),%rdi
call   1080 <wrefresh@plt>
mov    $0x3e8,%edi
call   1220 <napms@plt>
mov    $0x0,%al
call   11f0 <flushinp@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    16cd <inputTest+0x37d>
mov    -0x88(%rbp),%rdi
call   1120 <delwin@plt>
mov    -0x8(%rbp),%rdi
call   1270 <werase@plt>
mov    $0x0,%al
call   1150 <flash@plt>
mov    -0x8(%rbp),%rdi
call   1080 <wrefresh@plt>
mov    $0x1f4,%edi
call   1220 <napms@plt>
mov    $0x0,%al
call   11f0 <flushinp@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
lea    0x93c(%rip),%rcx
call   1240 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x9,%esi
mov    $0xa,%edx
call   1210 <wmove@plt>
mov    -0x8(%rbp),%rdi
call   1080 <wrefresh@plt>
mov    $0x0,%al
call   1030 <echo@plt>
mov    -0x8(%rbp),%rdi
mov    0x2840(%rip),%rax
mov    (%rax),%esi
call   1090 <keypad@plt>
mov    $0x0,%al
call   10a0 <raw@plt>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    $0x3,%edx
call   11e0 <wgetnstr@plt>
mov    $0x0,%al
call   11f0 <flushinp@plt>
mov    -0x8(%rbp),%rdi
mov    $0x9,%esi
mov    $0xa,%edx
call   1210 <wmove@plt>
mov    -0x8(%rbp),%rdi
call   1050 <wdelch@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
lea    0x8d0(%rip),%rcx
call   1240 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1260 <Continue@plt>
mov    $0x0,%al
call   1160 <refresh@plt>
mov    -0x8(%rbp),%rdi
call   1190 <wclear@plt>
mov    $0x0,%al
call   1030 <echo@plt>
movb   $0x0,-0x80(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
lea    0x8bd(%rip),%rcx
call   1240 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x2,%edx
lea    0x8c0(%rip),%rcx
call   1240 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
mov    $0x2,%edx
lea    0x8e0(%rip),%rcx
call   1240 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1250 <mvwin@plt>
mov    -0x8(%rbp),%rdi
call   1080 <wrefresh@plt>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%r9
mov    $0x7,%esi
mov    $0x6,%edx
lea    0x8d6(%rip),%rcx
lea    -0x2c(%rbp),%r8
call   1140 <mvwscanw@plt>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%r8
mov    -0x2c(%rbp),%r9d
mov    $0x8,%esi
mov    $0x6,%edx
lea    0x8b6(%rip),%rcx
mov    $0x0,%al
call   11a0 <mvwprintw@plt>
mov    -0x8(%rbp),%rdi
call   1260 <Continue@plt>
mov    $0x0,%al
call   1160 <refresh@plt>
mov    -0x8(%rbp),%rdi
call   1190 <wclear@plt>
mov    $0x0,%al
call   1030 <echo@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
lea    0x890(%rip),%rcx
call   1240 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    $0x5,%edx
call   11e0 <wgetnstr@plt>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%r8
mov    $0x4,%esi
mov    $0x2,%edx
lea    0x87d(%rip),%rcx
mov    $0x0,%al
call   11a0 <mvwprintw@plt>
mov    -0x8(%rbp),%rdi
call   1260 <Continue@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputTest>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rbx
movl   $0x0,0x4(%rsp)
call   1190 <wclear@plt>
mov    %rbx,%rdi
call   10e0 <getmaxyx@plt>
mov    %rbx,%rdi
call   1110 <getbegyx@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10b0 <subwin@plt>
test   %rax,%rax
je     1938 <inputTest+0x5e8>
mov    %rax,%rbp
mov    0x2c2b(%rip),%rax
mov    (%rax),%esi
mov    %rbp,%rdi
call   1070 <wbkgd@plt>
mov    0x2c12(%rip),%rax
mov    (%rax),%esi
mov    0x2c19(%rip),%rax
mov    (%rax),%edx
mov    %rbp,0x8(%rsp)
mov    %rbp,%rdi
call   1100 <box@plt>
mov    %rbx,%rdi
call   1080 <wrefresh@plt>
xor    %eax,%eax
call   11c0 <nocbreak@plt>
mov    %rbx,%rdi
call   1190 <wclear@plt>
lea    0xc20(%rip),%rcx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1240 <mvwaddstr@plt>
lea    0xc39(%rip),%rcx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1240 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1080 <wrefresh@plt>
mov    0x2bc2(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1090 <keypad@plt>
xor    %eax,%eax
call   10a0 <raw@plt>
xor    %eax,%eax
call   11d0 <noecho@plt>
mov    %rbx,%rdi
mov    $0xc8,%esi
call   10d0 <wtimeout@plt>
xor    %edi,%edi
call   1230 <curs_set@plt>
mov    $0x3,%r12d
mov    0x2b91(%rip),%r15
lea    0xbf1(%rip),%rbp
movl   $0x3,(%rsp)
xor    %r13d,%r13d
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1180 <wgetch@plt>
cmp    (%r15),%eax
jne    14f0 <inputTest+0x1a0>
mov    %r15,%rbp
lea    0xb79(%rip),%r15
mov    (%rsp),%r12d
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13d
cmp    $0x4,%r13d
mov    $0x0,%eax
cmove  %eax,%r13d
movslq %r13d,%rax
movsbl (%rax,%r15,1),%ecx
mov    %rbx,%rdi
mov    %r12d,%esi
mov    $0x3,%edx
call   1200 <mvwaddch@plt>
mov    %rbx,%rdi
call   1080 <wrefresh@plt>
mov    %rbx,%rdi
call   1180 <wgetch@plt>
cmp    0x0(%rbp),%eax
je     1490 <inputTest+0x140>
mov    %eax,%r14d
mov    %rbp,%r15
lea    0xb74(%rip),%rbp
mov    %r12d,%esi
mov    $0x3,%r12d
jmp    14f6 <inputTest+0x1a6>
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%r14d
mov    (%rsp),%esi
mov    %rbx,%rdi
mov    $0x5,%edx
mov    %rbp,%rcx
call   1240 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1060 <wclrtoeol@plt>
mov    %rbx,%rdi
lea    0xb45(%rip),%rsi
mov    %r14d,%edx
call   1130 <wprintw@plt>
mov    %r14d,%edi
call   11b0 <has_key@plt>
mov    %r14d,%edi
test   %rax,%rax
je     1540 <inputTest+0x1f0>
call   10f0 <keyname@plt>
jmp    155b <inputTest+0x20b>
nopw   0x0(%rax,%rax,1)
call   1170 <isprint@plt>
test   %rax,%rax
jne    158f <inputTest+0x23f>
cmp    $0x100,%r14d
jge    158f <inputTest+0x23f>
mov    %r14d,%edi
call   10c0 <unctrl@plt>
mov    %rbx,%rdi
lea    0xc56(%rip),%rsi
mov    %eax,%edx
call   1130 <wprintw@plt>
mov    %rbx,%rdi
call   1080 <wrefresh@plt>
cmp    $0x20,%r14d
je     159c <inputTest+0x24c>
mov    (%rsp),%eax
add    $0x1,%eax
cmp    $0xa,%eax
cmove  %r12d,%eax
mov    %eax,(%rsp)
jmp    1470 <inputTest+0x120>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <waddch@plt>
jmp    156c <inputTest+0x21c>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
call   10d0 <wtimeout@plt>
mov    $0x1,%edi
call   1230 <curs_set@plt>
mov    %rbx,%rdi
call   1190 <wclear@plt>
lea    0xaa1(%rip),%rcx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1240 <mvwaddstr@plt>
lea    0xaa6(%rip),%rcx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1240 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1080 <wrefresh@plt>
mov    0x8(%rsp),%rbp
mov    %rbp,%rdi
call   1270 <werase@plt>
mov    0x29b7(%rip),%rax
mov    (%rax),%esi
mov    0x29be(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
call   1100 <box@plt>
lea    0xa7c(%rip),%r14
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   11a0 <mvwprintw@plt>
mov    %rbp,%rdi
call   1080 <wrefresh@plt>
mov    $0x3e8,%edi
call   1220 <napms@plt>
xor    %eax,%eax
call   11f0 <flushinp@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rcx
mov    $0x1,%r8d
xor    %eax,%eax
call   11a0 <mvwprintw@plt>
mov    %rbp,%rdi
call   1080 <wrefresh@plt>
mov    $0x3e8,%edi
call   1220 <napms@plt>
xor    %eax,%eax
call   11f0 <flushinp@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rcx
mov    $0x2,%r8d
xor    %eax,%eax
call   11a0 <mvwprintw@plt>
mov    %rbp,%rdi
call   1080 <wrefresh@plt>
mov    $0x3e8,%edi
call   1220 <napms@plt>
xor    %eax,%eax
call   11f0 <flushinp@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rcx
mov    $0x3,%r8d
xor    %eax,%eax
call   11a0 <mvwprintw@plt>
mov    %rbp,%rdi
call   1080 <wrefresh@plt>
mov    $0x3e8,%edi
call   1220 <napms@plt>
xor    %eax,%eax
call   11f0 <flushinp@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rcx
mov    $0x4,%r8d
xor    %eax,%eax
call   11a0 <mvwprintw@plt>
mov    %rbp,%rdi
call   1080 <wrefresh@plt>
mov    $0x3e8,%edi
call   1220 <napms@plt>
xor    %eax,%eax
call   11f0 <flushinp@plt>
mov    %rbp,%rdi
call   1120 <delwin@plt>
mov    %rbx,%rdi
call   1270 <werase@plt>
xor    %eax,%eax
call   1150 <flash@plt>
mov    %rbx,%rdi
call   1080 <wrefresh@plt>
mov    $0x1f4,%edi
call   1220 <napms@plt>
xor    %eax,%eax
call   11f0 <flushinp@plt>
lea    0x944(%rip),%rcx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1240 <mvwaddstr@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0xa,%edx
call   1210 <wmove@plt>
mov    %rbx,%rdi
call   1080 <wrefresh@plt>
xor    %eax,%eax
call   1030 <echo@plt>
mov    0x2841(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1090 <keypad@plt>
xor    %eax,%eax
call   10a0 <raw@plt>
lea    0x10(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   11e0 <wgetnstr@plt>
xor    %eax,%eax
call   11f0 <flushinp@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0xa,%edx
call   1210 <wmove@plt>
mov    %rbx,%rdi
call   1050 <wdelch@plt>
lea    0x8db(%rip),%rcx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1240 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1260 <Continue@plt>
xor    %eax,%eax
call   1160 <refresh@plt>
mov    %rbx,%rdi
call   1190 <wclear@plt>
xor    %eax,%eax
call   1030 <echo@plt>
movb   $0x0,0x10(%rsp)
lea    0x8ca(%rip),%rcx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1240 <mvwaddstr@plt>
lea    0x8ce(%rip),%rcx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x2,%edx
call   1240 <mvwaddstr@plt>
lea    0x8ef(%rip),%rcx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x2,%edx
call   1240 <mvwaddstr@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1250 <mvwin@plt>
mov    %rbx,%rdi
call   1080 <wrefresh@plt>
lea    0x8ec(%rip),%rcx
lea    0x4(%rsp),%r8
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x6,%edx
mov    %r14,%r9
call   1140 <mvwscanw@plt>
mov    0x4(%rsp),%r9d
lea    0x8cc(%rip),%rcx
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x6,%edx
mov    %r14,%r8
xor    %eax,%eax
call   11a0 <mvwprintw@plt>
mov    %rbx,%rdi
call   1260 <Continue@plt>
xor    %eax,%eax
call   1160 <refresh@plt>
mov    %rbx,%rdi
call   1190 <wclear@plt>
xor    %eax,%eax
call   1030 <echo@plt>
lea    0x8a6(%rip),%rcx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1240 <mvwaddstr@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
call   11e0 <wgetnstr@plt>
lea    0x89a(%rip),%rcx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x2,%edx
mov    %r14,%r8
xor    %eax,%eax
call   11a0 <mvwprintw@plt>
mov    %rbx,%rdi
call   1260 <Continue@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@inputTest.spinner = internal constant [4 x i8] c"/-\\|"
@A_BOLD = global i32 0
@ACS_VLINE = global i32 0
@ACS_HLINE = global i32 0
@.str = [50 x i8] c"Press keys (or mouse buttons) to show their names\00"
@.str.1 = [25 x i8] c"Press spacebar to finish\00"
@TRUE = global i32 0
@ERR = global i32 0
@.str.2 = [14 x i8] c"Key Pressed: \00"
@.str.3 = [6 x i8] c"(%x) \00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [30 x i8] c"Press some keys for 5 seconds\00"
@.str.6 = [30 x i8] c"Pressing ^C should do nothing\00"
@.str.7 = [10 x i8] c"Time = %d\00"
@.str.8 = [31 x i8] c"Press a key, followed by ENTER\00"
@.str.9 = [43 x i8] c"The character should now have been deleted\00"
@.str.10 = [29 x i8] c"The window should have moved\00"
@.str.11 = [58 x i8] c"This text should have appeared without you pressing a key\00"
@.str.12 = [48 x i8] c"Enter a number then a string seperated by space\00"
@.str.13 = [6 x i8] c"%d %s\00"
@.str.14 = [22 x i8] c"String: %s Number: %d\00"
@.str.15 = [29 x i8] c"Enter a 5 character string: \00"
@.str.16 = [11 x i8] c"String: %s\00"
define void @inputTest(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [80 x i8]
%14 = alloca i32*
%15 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %11
store i32 3, i32* %12
store i32 0, i32* %15
%16 = load i32*, i32** %2
%17 = call i32 @wclear(i32* %16)
%18 = load i32*, i32** %2
%19 = load i32, i32* %4
%20 = load i32, i32* %3
%21 = call i32 @getmaxyx(i32* %18, i32 %19, i32 %20)
%22 = load i32*, i32** %2
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = call i32 @getbegyx(i32* %22, i32 %23, i32 %24)
%26 = load i32, i32* %3
%27 = sdiv i32 %26, 3
store i32 %27, i32* %7
%28 = load i32, i32* %4
%29 = sdiv i32 %28, 3
store i32 %29, i32* %8
%30 = load i32*, i32** %2
%31 = load i32, i32* %8
%32 = load i32, i32* %7
%33 = load i32, i32* %6
%34 = load i32, i32* %4
%35 = add nsw i32 %33, %34
%36 = load i32, i32* %8
%37 = sub nsw i32 %35, %36
%38 = sub nsw i32 %37, 2
%39 = load i32, i32* %5
%40 = load i32, i32* %3
%41 = add nsw i32 %39, %40
%42 = load i32, i32* %7
%43 = sub nsw i32 %41, %42
%44 = sub nsw i32 %43, 2
%45 = call i32* @subwin(i32* %30, i32 %31, i32 %32, i32 %38, i32 %44)
store i32* %45, i32** %14
%46 = icmp eq i32* %45, null
br i1 %46, label %47, label %48
47: ; preds = %1
br label %250
48: ; preds = %1
%49 = load i32*, i32** %14
%50 = load i32, i32* @A_BOLD
%51 = call i32 @wbkgd(i32* %49, i32 %50)
%52 = load i32*, i32** %14
%53 = load i32, i32* @ACS_VLINE
%54 = load i32, i32* @ACS_HLINE
%55 = call i32 @box(i32* %52, i32 %53, i32 %54)
%56 = load i32*, i32** %2
%57 = call i32 @wrefresh(i32* %56)
%58 = call i32 (...) @nocbreak()
%59 = load i32*, i32** %2
%60 = call i32 @wclear(i32* %59)
%61 = load i32*, i32** %2
%62 = call i32 @mvwaddstr(i32* %61, i32 1, i32 1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%63 = load i32*, i32** %2
%64 = call i32 @mvwaddstr(i32* %63, i32 2, i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%65 = load i32*, i32** %2
%66 = call i32 @wrefresh(i32* %65)
%67 = load i32*, i32** %2
%68 = load i32, i32* @TRUE
%69 = call i32 @keypad(i32* %67, i32 %68)
%70 = call i32 (...) @raw()
%71 = call i32 (...) @noecho()
%72 = load i32*, i32** %2
%73 = call i32 @wtimeout(i32* %72, i32 200)
%74 = call i32 @curs_set(i32 0)
br label %75
75: ; preds = %48, %146
br label %76
76: ; preds = %75, %99
%77 = load i32*, i32** %2
%78 = call i32 @wgetch(i32* %77)
store i32 %78, i32* %10
%79 = load i32, i32* %10
%80 = load i32, i32* @ERR
%81 = icmp eq i32 %79, %80
br i1 %81, label %82, label %98
82: ; preds = %76
%83 = load i32, i32* %15
%84 = add nsw i32 %83, 1
store i32 %84, i32* %15
%85 = load i32, i32* %15
%86 = icmp eq i32 %85, 4
br i1 %86, label %87, label %88
87: ; preds = %82
store i32 0, i32* %15
br label %88
88: ; preds = %87, %82
%89 = load i32*, i32** %2
%90 = load i32, i32* %12
%91 = load i32, i32* %15
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [4 x i8], [4 x i8]* @inputTest.spinner, i64 0, i64 %92
%94 = load i8, i8* %93
%95 = call i32 @mvwaddch(i32* %89, i32 %90, i32 3, i8 signext %94)
%96 = load i32*, i32** %2
%97 = call i32 @wrefresh(i32* %96)
br label %99
98: ; preds = %76
br label %100
99: ; preds = %88
br label %76
100: ; preds = %98
%101 = load i32*, i32** %2
%102 = load i32, i32* %12
%103 = call i32 @mvwaddstr(i32* %101, i32 %102, i32 5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%104 = load i32*, i32** %2
%105 = call i32 @wclrtoeol(i32* %104)
%106 = load i32*, i32** %2
%107 = load i32, i32* %10
%108 = call i32 @wprintw(i32* %106, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %107)
%109 = load i32, i32* %10
%110 = call i64 @has_key(i32 %109)
%111 = icmp ne i64 %110, 0
br i1 %111, label %112, label %117
112: ; preds = %100
%113 = load i32*, i32** %2
%114 = load i32, i32* %10
%115 = call i32 @keyname(i32 %114)
%116 = call i32 @wprintw(i32* %113, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %115)
br label %134
117: ; preds = %100
%118 = load i32, i32* %10
%119 = call i64 @isprint(i32 %118)
%120 = icmp ne i64 %119, 0
br i1 %120, label %124, label %121
121: ; preds = %117
%122 = load i32, i32* %10
%123 = icmp sgt i32 %122, 255
br i1 %123, label %124, label %128
124: ; preds = %121, %117
%125 = load i32*, i32** %2
%126 = load i32, i32* %10
%127 = call i32 @waddch(i32* %125, i32 %126)
br label %133
128: ; preds = %121
%129 = load i32*, i32** %2
%130 = load i32, i32* %10
%131 = call i32 @unctrl(i32 %130)
%132 = call i32 @wprintw(i32* %129, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %131)
br label %133
133: ; preds = %128, %124
br label %134
134: ; preds = %133, %112
%135 = load i32*, i32** %2
%136 = call i32 @wrefresh(i32* %135)
%137 = load i32, i32* %10
%138 = icmp eq i32 %137, 32
br i1 %138, label %139, label %140
139: ; preds = %134
br label %147
140: ; preds = %134
%141 = load i32, i32* %12
%142 = add nsw i32 %141, 1
store i32 %142, i32* %12
%143 = load i32, i32* %12
%144 = icmp eq i32 %143, 10
br i1 %144, label %145, label %146
145: ; preds = %140
store i32 3, i32* %12
br label %146
146: ; preds = %145, %140
br label %75
147: ; preds = %139
%148 = load i32*, i32** %2
%149 = call i32 @wtimeout(i32* %148, i32 -1)
%150 = call i32 @curs_set(i32 1)
%151 = load i32*, i32** %2
%152 = call i32 @wclear(i32* %151)
%153 = load i32*, i32** %2
%154 = call i32 @mvwaddstr(i32* %153, i32 2, i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%155 = load i32*, i32** %2
%156 = call i32 @mvwaddstr(i32* %155, i32 1, i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%157 = load i32*, i32** %2
%158 = call i32 @wrefresh(i32* %157)
%159 = load i32*, i32** %14
%160 = call i32 @werase(i32* %159)
%161 = load i32*, i32** %14
%162 = load i32, i32* @ACS_VLINE
%163 = load i32, i32* @ACS_HLINE
%164 = call i32 @box(i32* %161, i32 %162, i32 %163)
store i32 0, i32* %9
br label %165
165: ; preds = %176, %147
%166 = load i32, i32* %9
%167 = icmp slt i32 %166, 5
br i1 %167, label %168, label %179
168: ; preds = %165
%169 = load i32*, i32** %14
%170 = load i32, i32* %9
%171 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %169, i32 1, i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %170)
%172 = load i32*, i32** %14
%173 = call i32 @wrefresh(i32* %172)
%174 = call i32 @napms(i32 1000)
%175 = call i32 (...) @flushinp()
br label %176
176: ; preds = %168
%177 = load i32, i32* %9
%178 = add nsw i32 %177, 1
store i32 %178, i32* %9
br label %165
179: ; preds = %165
%180 = load i32*, i32** %14
%181 = call i32 @delwin(i32* %180)
%182 = load i32*, i32** %2
%183 = call i32 @werase(i32* %182)
%184 = call i32 (...) @flash()
%185 = load i32*, i32** %2
%186 = call i32 @wrefresh(i32* %185)
%187 = call i32 @napms(i32 500)
%188 = call i32 (...) @flushinp()
%189 = load i32*, i32** %2
%190 = call i32 @mvwaddstr(i32* %189, i32 2, i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0))
%191 = load i32*, i32** %2
%192 = call i32 @wmove(i32* %191, i32 9, i32 10)
%193 = load i32*, i32** %2
%194 = call i32 @wrefresh(i32* %193)
%195 = call i32 (...) @echo()
%196 = load i32*, i32** %2
%197 = load i32, i32* @TRUE
%198 = call i32 @keypad(i32* %196, i32 %197)
%199 = call i32 (...) @raw()
%200 = load i32*, i32** %2
%201 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%202 = call i32 @wgetnstr(i32* %200, i8* %201, i32 3)
%203 = call i32 (...) @flushinp()
%204 = load i32*, i32** %2
%205 = call i32 @wmove(i32* %204, i32 9, i32 10)
%206 = load i32*, i32** %2
%207 = call i32 @wdelch(i32* %206)
%208 = load i32*, i32** %2
%209 = call i32 @mvwaddstr(i32* %208, i32 4, i32 1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0))
%210 = load i32*, i32** %2
%211 = call i32 @Continue(i32* %210)
%212 = call i32 (...) @refresh()
%213 = load i32*, i32** %2
%214 = call i32 @wclear(i32* %213)
%215 = call i32 (...) @echo()
%216 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
store i8 0, i8* %216
%217 = load i32*, i32** %2
%218 = call i32 @mvwaddstr(i32* %217, i32 3, i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
%219 = load i32*, i32** %2
%220 = call i32 @mvwaddstr(i32* %219, i32 4, i32 2, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.11, i64 0, i64 0))
%221 = load i32*, i32** %2
%222 = call i32 @mvwaddstr(i32* %221, i32 6, i32 2, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.12, i64 0, i64 0))
%223 = load i32*, i32** %2
%224 = call i32 @mvwin(i32* %223, i32 2, i32 1)
%225 = load i32*, i32** %2
%226 = call i32 @wrefresh(i32* %225)
%227 = load i32*, i32** %2
%228 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%229 = call i32 @mvwscanw(i32* %227, i32 7, i32 6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i32* %11, i8* %228)
%230 = load i32*, i32** %2
%231 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%232 = load i32, i32* %11
%233 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %230, i32 8, i32 6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i8* %231, i32 %232)
%234 = load i32*, i32** %2
%235 = call i32 @Continue(i32* %234)
%236 = call i32 (...) @refresh()
%237 = load i32*, i32** %2
%238 = call i32 @wclear(i32* %237)
%239 = call i32 (...) @echo()
%240 = load i32*, i32** %2
%241 = call i32 @mvwaddstr(i32* %240, i32 3, i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0))
%242 = load i32*, i32** %2
%243 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%244 = call i32 @wgetnstr(i32* %242, i8* %243, i32 5)
%245 = load i32*, i32** %2
%246 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%247 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %245, i32 4, i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i8* %246)
%248 = load i32*, i32** %2
%249 = call i32 @Continue(i32* %248)
br label %250
250: ; preds = %179, %47
ret void
}

LLVM IR (-O2):
@inputTest.spinner = internal unnamed_addr constant [4 x i8] c"/-\\|"
@A_BOLD = global i32 0
@ACS_VLINE = global i32 0
@ACS_HLINE = global i32 0
@.str = [50 x i8] c"Press keys (or mouse buttons) to show their names\00"
@.str.1 = [25 x i8] c"Press spacebar to finish\00"
@TRUE = global i32 0
@ERR = global i32 0
@.str.2 = [14 x i8] c"Key Pressed: \00"
@.str.3 = [6 x i8] c"(%x) \00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [30 x i8] c"Press some keys for 5 seconds\00"
@.str.6 = [30 x i8] c"Pressing ^C should do nothing\00"
@.str.7 = [10 x i8] c"Time = %d\00"
@.str.8 = [31 x i8] c"Press a key, followed by ENTER\00"
@.str.9 = [43 x i8] c"The character should now have been deleted\00"
@.str.10 = [29 x i8] c"The window should have moved\00"
@.str.11 = [58 x i8] c"This text should have appeared without you pressing a key\00"
@.str.12 = [48 x i8] c"Enter a number then a string seperated by space\00"
@.str.13 = [6 x i8] c"%d %s\00"
@.str.14 = [22 x i8] c"String: %s Number: %d\00"
@.str.15 = [29 x i8] c"Enter a 5 character string: \00"
@.str.16 = [11 x i8] c"String: %s\00"
define void @inputTest(i32* %0) {
%2 = alloca i32
%3 = alloca [80 x i8]
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = tail call i32 @wclear(i32* %0)
%7 = tail call i32 @getmaxyx(i32* %0, i32 undef, i32 undef)
%8 = tail call i32 @getbegyx(i32* %0, i32 undef, i32 undef)
%9 = tail call i32* @subwin(i32* %0, i32 0, i32 0, i32 undef, i32 undef)
%10 = icmp eq i32* %9, null
br i1 %10, label %145, label %11
11: ; preds = %1
%12 = load i32, i32* @A_BOLD
%13 = tail call i32 @wbkgd(i32* %9, i32 %12)
%14 = load i32, i32* @ACS_VLINE
%15 = load i32, i32* @ACS_HLINE
%16 = tail call i32 @box(i32* %9, i32 %14, i32 %15)
%17 = tail call i32 @wrefresh(i32* %0)
%18 = tail call i32 (...) @nocbreak()
%19 = tail call i32 @wclear(i32* %0)
%20 = tail call i32 @mvwaddstr(i32* %0, i32 1, i32 1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%21 = tail call i32 @mvwaddstr(i32* %0, i32 2, i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%22 = tail call i32 @wrefresh(i32* %0)
%23 = load i32, i32* @TRUE
%24 = tail call i32 @keypad(i32* %0, i32 %23)
%25 = tail call i32 (...) @raw()
%26 = tail call i32 (...) @noecho()
%27 = tail call i32 @wtimeout(i32* %0, i32 200)
%28 = tail call i32 @curs_set(i32 0)
br label %29
29: ; preds = %72, %11
%30 = phi i32 [ 3, %11 ], [ %75, %72 ]
%31 = phi i32 [ 0, %11 ], [ %49, %72 ]
%32 = tail call i32 @wgetch(i32* %0)
%33 = load i32, i32* @ERR
%34 = icmp eq i32 %32, %33
br i1 %34, label %35, label %48
35: ; preds = %29, %35
%36 = phi i32 [ %39, %35 ], [ %31, %29 ]
%37 = add nsw i32 %36, 1
%38 = icmp eq i32 %37, 4
%39 = select i1 %38, i32 0, i32 %37
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [4 x i8], [4 x i8]* @inputTest.spinner, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = tail call i32 @mvwaddch(i32* %0, i32 %30, i32 3, i8 signext %42)
%44 = tail call i32 @wrefresh(i32* %0)
%45 = tail call i32 @wgetch(i32* %0)
%46 = load i32, i32* @ERR
%47 = icmp eq i32 %45, %46
br i1 %47, label %35, label %48
48: ; preds = %35, %29
%49 = phi i32 [ %31, %29 ], [ %39, %35 ]
%50 = phi i32 [ %32, %29 ], [ %45, %35 ]
%51 = tail call i32 @mvwaddstr(i32* %0, i32 %30, i32 5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%52 = tail call i32 @wclrtoeol(i32* %0)
%53 = tail call i32 @wprintw(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %50)
%54 = tail call i64 @has_key(i32 %50)
%55 = icmp eq i64 %54, 0
br i1 %55, label %59, label %56
56: ; preds = %48
%57 = tail call i32 @keyname(i32 %50)
%58 = tail call i32 @wprintw(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %57)
br label %69
59: ; preds = %48
%60 = tail call i64 @isprint(i32 %50)
%61 = icmp ne i64 %60, 0
%62 = icmp sgt i32 %50, 255
%63 = select i1 %61, i1 true, i1 %62
br i1 %63, label %64, label %66
64: ; preds = %59
%65 = tail call i32 @waddch(i32* %0, i32 %50)
br label %69
66: ; preds = %59
%67 = tail call i32 @unctrl(i32 %50)
%68 = tail call i32 @wprintw(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %67)
br label %69
69: ; preds = %64, %66, %56
%70 = tail call i32 @wrefresh(i32* %0)
%71 = icmp eq i32 %50, 32
br i1 %71, label %76, label %72
72: ; preds = %69
%73 = add nsw i32 %30, 1
%74 = icmp eq i32 %73, 10
%75 = select i1 %74, i32 3, i32 %73
br label %29
76: ; preds = %69
%77 = tail call i32 @wtimeout(i32* %0, i32 -1)
%78 = tail call i32 @curs_set(i32 1)
%79 = tail call i32 @wclear(i32* %0)
%80 = tail call i32 @mvwaddstr(i32* %0, i32 2, i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%81 = tail call i32 @mvwaddstr(i32* %0, i32 1, i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%82 = tail call i32 @wrefresh(i32* %0)
%83 = tail call i32 @werase(i32* %9)
%84 = load i32, i32* @ACS_VLINE
%85 = load i32, i32* @ACS_HLINE
%86 = tail call i32 @box(i32* %9, i32 %84, i32 %85)
%87 = tail call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %9, i32 1, i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 0)
%88 = tail call i32 @wrefresh(i32* %9)
%89 = tail call i32 @napms(i32 1000)
%90 = tail call i32 (...) @flushinp()
%91 = tail call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %9, i32 1, i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 1)
%92 = tail call i32 @wrefresh(i32* %9)
%93 = tail call i32 @napms(i32 1000)
%94 = tail call i32 (...) @flushinp()
%95 = tail call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %9, i32 1, i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 2)
%96 = tail call i32 @wrefresh(i32* %9)
%97 = tail call i32 @napms(i32 1000)
%98 = tail call i32 (...) @flushinp()
%99 = tail call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %9, i32 1, i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 3)
%100 = tail call i32 @wrefresh(i32* %9)
%101 = tail call i32 @napms(i32 1000)
%102 = tail call i32 (...) @flushinp()
%103 = tail call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %9, i32 1, i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 4)
%104 = tail call i32 @wrefresh(i32* %9)
%105 = tail call i32 @napms(i32 1000)
%106 = tail call i32 (...) @flushinp()
%107 = tail call i32 @delwin(i32* %9)
%108 = tail call i32 @werase(i32* %0)
%109 = tail call i32 (...) @flash()
%110 = tail call i32 @wrefresh(i32* %0)
%111 = tail call i32 @napms(i32 500)
%112 = tail call i32 (...) @flushinp()
%113 = tail call i32 @mvwaddstr(i32* %0, i32 2, i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0))
%114 = tail call i32 @wmove(i32* %0, i32 9, i32 10)
%115 = tail call i32 @wrefresh(i32* %0)
%116 = tail call i32 (...) @echo()
%117 = load i32, i32* @TRUE
%118 = tail call i32 @keypad(i32* %0, i32 %117)
%119 = tail call i32 (...) @raw()
%120 = call i32 @wgetnstr(i32* %0, i8* %5, i32 3)
%121 = call i32 (...) @flushinp()
%122 = call i32 @wmove(i32* %0, i32 9, i32 10)
%123 = call i32 @wdelch(i32* %0)
%124 = call i32 @mvwaddstr(i32* %0, i32 4, i32 1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0))
%125 = call i32 @Continue(i32* %0)
%126 = call i32 (...) @refresh()
%127 = call i32 @wclear(i32* %0)
%128 = call i32 (...) @echo()
store i8 0, i8* %5
%129 = call i32 @mvwaddstr(i32* %0, i32 3, i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
%130 = call i32 @mvwaddstr(i32* %0, i32 4, i32 2, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.11, i64 0, i64 0))
%131 = call i32 @mvwaddstr(i32* %0, i32 6, i32 2, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.12, i64 0, i64 0))
%132 = call i32 @mvwin(i32* %0, i32 2, i32 1)
%133 = call i32 @wrefresh(i32* %0)
%134 = call i32 @mvwscanw(i32* %0, i32 7, i32 6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i32* %2, i8* %5)
%135 = load i32, i32* %2
%136 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %0, i32 8, i32 6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i8* %5, i32 %135)
%137 = call i32 @Continue(i32* %0)
%138 = call i32 (...) @refresh()
%139 = call i32 @wclear(i32* %0)
%140 = call i32 (...) @echo()
%141 = call i32 @mvwaddstr(i32* %0, i32 3, i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0))
%142 = call i32 @wgetnstr(i32* %0, i8* %5, i32 5)
%143 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %0, i32 4, i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i8* %5)
%144 = call i32 @Continue(i32* %0)
br label %145
145: ; preds = %1, %76
ret void
}