#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 KEY_MIN;
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__ 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*/ 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;
  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, 3, 3, spinner[spinner_count]);
        wrefresh(win);
      } else
        break;
    }
    mvwaddstr(win, 3, 5, "Key Pressed: ");
    wclrtoeol(win);
    if (c >= KEY_MIN)
      wprintw(win, "%s", keyname(c));
    else if (isprint(c))
      wprintw(win, "%c", c);
    else
      wprintw(win, "%s", unctrl(c));
    wrefresh(win);
    if (c == ' ')
      break;
  }
  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   $0x0,-0x8c(%rbp)
mov    -0x8(%rbp),%rdi
call   1180 <wclear@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   10d0 <getmaxyx@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1100 <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   10a0 <subwin@plt>
mov    %rax,-0x88(%rbp)
cmp    $0x0,%rax
jne    13d4 <inputTest+0xa4>
jmp    18ed <inputTest+0x5bd>
mov    -0x88(%rbp),%rdi
mov    0x2bde(%rip),%rax
mov    (%rax),%esi
call   1060 <wbkgd@plt>
mov    -0x88(%rbp),%rdi
mov    0x2bc1(%rip),%rax
mov    (%rax),%esi
mov    0x2bc8(%rip),%rax
mov    (%rax),%edx
call   10f0 <box@plt>
mov    -0x8(%rbp),%rdi
call   1070 <wrefresh@plt>
mov    $0x0,%al
call   11a0 <nocbreak@plt>
mov    -0x8(%rbp),%rdi
call   1180 <wclear@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
lea    0xbd4(%rip),%rcx
mov    %edx,%esi
call   1220 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xbea(%rip),%rcx
call   1220 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1070 <wrefresh@plt>
mov    -0x8(%rbp),%rdi
mov    0x2b7b(%rip),%rax
mov    (%rax),%esi
call   1080 <keypad@plt>
mov    $0x0,%al
call   1090 <raw@plt>
mov    $0x0,%al
call   11b0 <noecho@plt>
mov    -0x8(%rbp),%rdi
mov    $0xc8,%esi
call   10c0 <wtimeout@plt>
xor    %edi,%edi
call   1210 <curs_set@plt>
jmp    1494 <inputTest+0x164>
mov    -0x8(%rbp),%rdi
call   1170 <wgetch@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    0x2b3e(%rip),%rcx
cmp    (%rcx),%eax
jne    1508 <inputTest+0x1d8>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
cmpl   $0x4,-0x8c(%rbp)
jne    14d8 <inputTest+0x1a8>
movl   $0x0,-0x8c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x8c(%rbp),%rcx
mov    $0x3,%edx
lea    0xb11(%rip),%rax
mov    %edx,%esi
movsbl (%rax,%rcx,1),%ecx
call   11e0 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
call   1070 <wrefresh@plt>
jmp    150d <inputTest+0x1dd>
jmp    1512 <inputTest+0x1e2>
jmp    1494 <inputTest+0x164>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0x5,%edx
lea    0xb28(%rip),%rcx
call   1220 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1050 <wclrtoeol@plt>
mov    -0x28(%rbp),%eax
mov    0x2a91(%rip),%rcx
cmp    (%rcx),%eax
jl     1574 <inputTest+0x244>
mov    -0x8(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x28(%rbp),%edi
call   10e0 <keyname@plt>
mov    -0x98(%rbp),%rdi
mov    %eax,%edx
lea    0xc4e(%rip),%rsi
call   1120 <wprintw@plt>
jmp    15cb <inputTest+0x29b>
mov    -0x28(%rbp),%edi
call   1160 <isprint@plt>
cmp    $0x0,%rax
je     159e <inputTest+0x26e>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%edx
lea    0xac9(%rip),%rsi
call   1120 <wprintw@plt>
jmp    15c6 <inputTest+0x296>
mov    -0x8(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x28(%rbp),%edi
call   10b0 <unctrl@plt>
mov    -0xa0(%rbp),%rdi
mov    %eax,%edx
lea    0xbf7(%rip),%rsi
call   1120 <wprintw@plt>
jmp    15cb <inputTest+0x29b>
mov    -0x8(%rbp),%rdi
call   1070 <wrefresh@plt>
cmpl   $0x20,-0x28(%rbp)
jne    15e3 <inputTest+0x2b3>
jmp    15e8 <inputTest+0x2b8>
jmp    148f <inputTest+0x15f>
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
call   10c0 <wtimeout@plt>
mov    $0x1,%edi
call   1210 <curs_set@plt>
mov    -0x8(%rbp),%rdi
call   1180 <wclear@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xa42(%rip),%rcx
call   1220 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
lea    0xa4b(%rip),%rcx
mov    %edx,%esi
call   1220 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1070 <wrefresh@plt>
mov    -0x88(%rbp),%rdi
call   1250 <werase@plt>
mov    -0x88(%rbp),%rdi
mov    0x295b(%rip),%rax
mov    (%rax),%esi
mov    0x2962(%rip),%rax
mov    (%rax),%edx
call   10f0 <box@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    16c9 <inputTest+0x399>
mov    -0x88(%rbp),%rdi
mov    -0x24(%rbp),%r8d
mov    $0x1,%edx
lea    0xa07(%rip),%rcx
mov    %edx,%esi
mov    $0x0,%al
call   1190 <mvwprintw@plt>
mov    -0x88(%rbp),%rdi
call   1070 <wrefresh@plt>
mov    $0x3e8,%edi
call   1200 <napms@plt>
mov    $0x0,%al
call   11d0 <flushinp@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1674 <inputTest+0x344>
mov    -0x88(%rbp),%rdi
call   1110 <delwin@plt>
mov    -0x8(%rbp),%rdi
call   1250 <werase@plt>
mov    $0x0,%al
call   1140 <flash@plt>
mov    -0x8(%rbp),%rdi
call   1070 <wrefresh@plt>
mov    $0x1f4,%edi
call   1200 <napms@plt>
mov    $0x0,%al
call   11d0 <flushinp@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
lea    0x992(%rip),%rcx
call   1220 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x9,%esi
mov    $0xa,%edx
call   11f0 <wmove@plt>
mov    -0x8(%rbp),%rdi
call   1070 <wrefresh@plt>
mov    $0x0,%al
call   1030 <echo@plt>
mov    -0x8(%rbp),%rdi
mov    0x2899(%rip),%rax
mov    (%rax),%esi
call   1080 <keypad@plt>
mov    $0x0,%al
call   1090 <raw@plt>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    $0x3,%edx
call   11c0 <wgetnstr@plt>
mov    $0x0,%al
call   11d0 <flushinp@plt>
mov    -0x8(%rbp),%rdi
mov    $0x9,%esi
mov    $0xa,%edx
call   11f0 <wmove@plt>
mov    -0x8(%rbp),%rdi
call   1040 <wdelch@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
lea    0x926(%rip),%rcx
call   1220 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1240 <Continue@plt>
mov    $0x0,%al
call   1150 <refresh@plt>
mov    -0x8(%rbp),%rdi
call   1180 <wclear@plt>
mov    $0x0,%al
call   1030 <echo@plt>
movb   $0x0,-0x80(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
lea    0x913(%rip),%rcx
call   1220 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x2,%edx
lea    0x916(%rip),%rcx
call   1220 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
mov    $0x2,%edx
lea    0x936(%rip),%rcx
call   1220 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1230 <mvwin@plt>
mov    -0x8(%rbp),%rdi
call   1070 <wrefresh@plt>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%r9
mov    $0x7,%esi
mov    $0x6,%edx
lea    0x92c(%rip),%rcx
lea    -0x2c(%rbp),%r8
call   1130 <mvwscanw@plt>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%r8
mov    -0x2c(%rbp),%r9d
mov    $0x8,%esi
mov    $0x6,%edx
lea    0x90c(%rip),%rcx
mov    $0x0,%al
call   1190 <mvwprintw@plt>
mov    -0x8(%rbp),%rdi
call   1240 <Continue@plt>
mov    $0x0,%al
call   1150 <refresh@plt>
mov    -0x8(%rbp),%rdi
call   1180 <wclear@plt>
mov    $0x0,%al
call   1030 <echo@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
lea    0x8e6(%rip),%rcx
call   1220 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    $0x5,%edx
call   11c0 <wgetnstr@plt>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%r8
mov    $0x4,%esi
mov    $0x2,%edx
lea    0x8d3(%rip),%rcx
mov    $0x0,%al
call   1190 <mvwprintw@plt>
mov    -0x8(%rbp),%rdi
call   1240 <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   1180 <wclear@plt>
mov    %rbx,%rdi
call   10d0 <getmaxyx@plt>
mov    %rbx,%rdi
call   1100 <getbegyx@plt>
xor    %r13d,%r13d
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10a0 <subwin@plt>
test   %rax,%rax
je     1891 <inputTest+0x561>
mov    %rax,%rbp
mov    0x2c40(%rip),%rax
mov    (%rax),%esi
mov    %rbp,%rdi
call   1060 <wbkgd@plt>
mov    0x2c27(%rip),%rax
mov    (%rax),%esi
mov    0x2c2e(%rip),%rax
mov    (%rax),%edx
mov    %rbp,0x8(%rsp)
mov    %rbp,%rdi
call   10f0 <box@plt>
mov    %rbx,%rdi
call   1070 <wrefresh@plt>
xor    %eax,%eax
call   11a0 <nocbreak@plt>
mov    %rbx,%rdi
call   1180 <wclear@plt>
lea    0xc3d(%rip),%rcx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1220 <mvwaddstr@plt>
lea    0xc56(%rip),%rcx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1220 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1070 <wrefresh@plt>
mov    0x2bdf(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1080 <keypad@plt>
xor    %eax,%eax
call   1090 <raw@plt>
xor    %eax,%eax
call   11b0 <noecho@plt>
mov    %rbx,%rdi
mov    $0xc8,%esi
call   10c0 <wtimeout@plt>
xor    %edi,%edi
call   1210 <curs_set@plt>
mov    0x2bb4(%rip),%r14
lea    0xbc5(%rip),%r12
xor    %r15d,%r15d
jmp    146e <inputTest+0x13e>
add    $0x1,%r15d
cmp    $0x4,%r15d
cmove  %r13d,%r15d
movslq %r15d,%rax
movsbl (%rax,%r12,1),%ecx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   11e0 <mvwaddch@plt>
mov    %rbx,%rdi
call   1070 <wrefresh@plt>
mov    %rbx,%rdi
call   1170 <wgetch@plt>
cmp    (%r14),%eax
je     1440 <inputTest+0x110>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x5,%edx
lea    0xbbe(%rip),%rcx
call   1220 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1050 <wclrtoeol@plt>
mov    0x2b2b(%rip),%rax
cmp    (%rax),%ebp
jge    14c3 <inputTest+0x193>
mov    %ebp,%edi
call   1160 <isprint@plt>
test   %rax,%rax
je     14cc <inputTest+0x19c>
mov    %rbx,%rdi
lea    0xb9e(%rip),%rsi
mov    %ebp,%edx
jmp    14df <inputTest+0x1af>
mov    %ebp,%edi
call   10e0 <keyname@plt>
jmp    14d3 <inputTest+0x1a3>
mov    %ebp,%edi
call   10b0 <unctrl@plt>
mov    %rbx,%rdi
lea    0xcdb(%rip),%rsi
mov    %eax,%edx
call   1120 <wprintw@plt>
mov    %rbx,%rdi
call   1070 <wrefresh@plt>
cmp    $0x20,%ebp
jne    146e <inputTest+0x13e>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
call   10c0 <wtimeout@plt>
mov    $0x1,%edi
call   1210 <curs_set@plt>
mov    %rbx,%rdi
call   1180 <wclear@plt>
lea    0xb45(%rip),%rcx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1220 <mvwaddstr@plt>
lea    0xb4a(%rip),%rcx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1220 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1070 <wrefresh@plt>
mov    0x8(%rsp),%rbp
mov    %rbp,%rdi
call   1250 <werase@plt>
mov    0x2a56(%rip),%rax
mov    (%rax),%esi
mov    0x2a5d(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
call   10f0 <box@plt>
lea    0xb20(%rip),%r15
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1190 <mvwprintw@plt>
mov    %rbp,%rdi
call   1070 <wrefresh@plt>
mov    $0x3e8,%edi
call   1200 <napms@plt>
xor    %eax,%eax
call   11d0 <flushinp@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r15,%rcx
mov    $0x1,%r8d
xor    %eax,%eax
call   1190 <mvwprintw@plt>
mov    %rbp,%rdi
call   1070 <wrefresh@plt>
mov    $0x3e8,%edi
call   1200 <napms@plt>
xor    %eax,%eax
call   11d0 <flushinp@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r15,%rcx
mov    $0x2,%r8d
xor    %eax,%eax
call   1190 <mvwprintw@plt>
mov    %rbp,%rdi
call   1070 <wrefresh@plt>
mov    $0x3e8,%edi
call   1200 <napms@plt>
xor    %eax,%eax
call   11d0 <flushinp@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r15,%rcx
mov    $0x3,%r8d
xor    %eax,%eax
call   1190 <mvwprintw@plt>
mov    %rbp,%rdi
call   1070 <wrefresh@plt>
mov    $0x3e8,%edi
call   1200 <napms@plt>
xor    %eax,%eax
call   11d0 <flushinp@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r15,%rcx
mov    $0x4,%r8d
xor    %eax,%eax
call   1190 <mvwprintw@plt>
mov    %rbp,%rdi
call   1070 <wrefresh@plt>
mov    $0x3e8,%edi
call   1200 <napms@plt>
xor    %eax,%eax
call   11d0 <flushinp@plt>
mov    %rbp,%rdi
call   1110 <delwin@plt>
mov    %rbx,%rdi
call   1250 <werase@plt>
xor    %eax,%eax
call   1140 <flash@plt>
mov    %rbx,%rdi
call   1070 <wrefresh@plt>
mov    $0x1f4,%edi
call   1200 <napms@plt>
xor    %eax,%eax
call   11d0 <flushinp@plt>
lea    0x9e8(%rip),%rcx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1220 <mvwaddstr@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0xa,%edx
call   11f0 <wmove@plt>
mov    %rbx,%rdi
call   1070 <wrefresh@plt>
xor    %eax,%eax
call   1030 <echo@plt>
mov    0x28e8(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1080 <keypad@plt>
xor    %eax,%eax
call   1090 <raw@plt>
lea    0x10(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   11c0 <wgetnstr@plt>
xor    %eax,%eax
call   11d0 <flushinp@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0xa,%edx
call   11f0 <wmove@plt>
mov    %rbx,%rdi
call   1040 <wdelch@plt>
lea    0x97f(%rip),%rcx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1220 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1240 <Continue@plt>
xor    %eax,%eax
call   1150 <refresh@plt>
mov    %rbx,%rdi
call   1180 <wclear@plt>
xor    %eax,%eax
call   1030 <echo@plt>
movb   $0x0,0x10(%rsp)
lea    0x96e(%rip),%rcx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1220 <mvwaddstr@plt>
lea    0x972(%rip),%rcx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x2,%edx
call   1220 <mvwaddstr@plt>
lea    0x993(%rip),%rcx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x2,%edx
call   1220 <mvwaddstr@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1230 <mvwin@plt>
mov    %rbx,%rdi
call   1070 <wrefresh@plt>
lea    0x990(%rip),%rcx
lea    0x4(%rsp),%r8
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x6,%edx
mov    %r14,%r9
call   1130 <mvwscanw@plt>
mov    0x4(%rsp),%r9d
lea    0x970(%rip),%rcx
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x6,%edx
mov    %r14,%r8
xor    %eax,%eax
call   1190 <mvwprintw@plt>
mov    %rbx,%rdi
call   1240 <Continue@plt>
xor    %eax,%eax
call   1150 <refresh@plt>
mov    %rbx,%rdi
call   1180 <wclear@plt>
xor    %eax,%eax
call   1030 <echo@plt>
lea    0x94a(%rip),%rcx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1220 <mvwaddstr@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
call   11c0 <wgetnstr@plt>
lea    0x93e(%rip),%rcx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x2,%edx
mov    %r14,%r8
xor    %eax,%eax
call   1190 <mvwprintw@plt>
mov    %rbx,%rdi
call   1240 <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"
@KEY_MIN = global i32 0
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [3 x i8] c"%c\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 [80 x i8]
%13 = alloca i32*
%14 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %11
store i32 0, i32* %14
%15 = load i32*, i32** %2
%16 = call i32 @wclear(i32* %15)
%17 = load i32*, i32** %2
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = call i32 @getmaxyx(i32* %17, i32 %18, i32 %19)
%21 = load i32*, i32** %2
%22 = load i32, i32* %6
%23 = load i32, i32* %5
%24 = call i32 @getbegyx(i32* %21, i32 %22, i32 %23)
%25 = load i32, i32* %3
%26 = sdiv i32 %25, 3
store i32 %26, i32* %7
%27 = load i32, i32* %4
%28 = sdiv i32 %27, 3
store i32 %28, i32* %8
%29 = load i32*, i32** %2
%30 = load i32, i32* %8
%31 = load i32, i32* %7
%32 = load i32, i32* %6
%33 = load i32, i32* %4
%34 = add nsw i32 %32, %33
%35 = load i32, i32* %8
%36 = sub nsw i32 %34, %35
%37 = sub nsw i32 %36, 2
%38 = load i32, i32* %5
%39 = load i32, i32* %3
%40 = add nsw i32 %38, %39
%41 = load i32, i32* %7
%42 = sub nsw i32 %40, %41
%43 = sub nsw i32 %42, 2
%44 = call i32* @subwin(i32* %29, i32 %30, i32 %31, i32 %37, i32 %43)
store i32* %44, i32** %13
%45 = icmp eq i32* %44, null
br i1 %45, label %46, label %47
46: ; preds = %1
br label %235
47: ; preds = %1
%48 = load i32*, i32** %13
%49 = load i32, i32* @A_BOLD
%50 = call i32 @wbkgd(i32* %48, i32 %49)
%51 = load i32*, i32** %13
%52 = load i32, i32* @ACS_VLINE
%53 = load i32, i32* @ACS_HLINE
%54 = call i32 @box(i32* %51, i32 %52, i32 %53)
%55 = load i32*, i32** %2
%56 = call i32 @wrefresh(i32* %55)
%57 = call i32 (...) @nocbreak()
%58 = load i32*, i32** %2
%59 = call i32 @wclear(i32* %58)
%60 = load i32*, i32** %2
%61 = call i32 @mvwaddstr(i32* %60, i32 1, i32 1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%62 = load i32*, i32** %2
%63 = call i32 @mvwaddstr(i32* %62, i32 2, i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%64 = load i32*, i32** %2
%65 = call i32 @wrefresh(i32* %64)
%66 = load i32*, i32** %2
%67 = load i32, i32* @TRUE
%68 = call i32 @keypad(i32* %66, i32 %67)
%69 = call i32 (...) @raw()
%70 = call i32 (...) @noecho()
%71 = load i32*, i32** %2
%72 = call i32 @wtimeout(i32* %71, i32 200)
%73 = call i32 @curs_set(i32 0)
br label %74
74: ; preds = %47, %131
br label %75
75: ; preds = %74, %97
%76 = load i32*, i32** %2
%77 = call i32 @wgetch(i32* %76)
store i32 %77, i32* %10
%78 = load i32, i32* %10
%79 = load i32, i32* @ERR
%80 = icmp eq i32 %78, %79
br i1 %80, label %81, label %96
81: ; preds = %75
%82 = load i32, i32* %14
%83 = add nsw i32 %82, 1
store i32 %83, i32* %14
%84 = load i32, i32* %14
%85 = icmp eq i32 %84, 4
br i1 %85, label %86, label %87
86: ; preds = %81
store i32 0, i32* %14
br label %87
87: ; preds = %86, %81
%88 = load i32*, i32** %2
%89 = load i32, i32* %14
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [4 x i8], [4 x i8]* @inputTest.spinner, i64 0, i64 %90
%92 = load i8, i8* %91
%93 = call i32 @mvwaddch(i32* %88, i32 3, i32 3, i8 signext %92)
%94 = load i32*, i32** %2
%95 = call i32 @wrefresh(i32* %94)
br label %97
96: ; preds = %75
br label %98
97: ; preds = %87
br label %75
98: ; preds = %96
%99 = load i32*, i32** %2
%100 = call i32 @mvwaddstr(i32* %99, i32 3, i32 5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%101 = load i32*, i32** %2
%102 = call i32 @wclrtoeol(i32* %101)
%103 = load i32, i32* %10
%104 = load i32, i32* @KEY_MIN
%105 = icmp sge i32 %103, %104
br i1 %105, label %106, label %111
106: ; preds = %98
%107 = load i32*, i32** %2
%108 = load i32, i32* %10
%109 = call i32 @keyname(i32 %108)
%110 = call i32 @wprintw(i32* %107, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %109)
br label %125
111: ; preds = %98
%112 = load i32, i32* %10
%113 = call i64 @isprint(i32 %112)
%114 = icmp ne i64 %113, 0
br i1 %114, label %115, label %119
115: ; preds = %111
%116 = load i32*, i32** %2
%117 = load i32, i32* %10
%118 = call i32 @wprintw(i32* %116, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %117)
br label %124
119: ; preds = %111
%120 = load i32*, i32** %2
%121 = load i32, i32* %10
%122 = call i32 @unctrl(i32 %121)
%123 = call i32 @wprintw(i32* %120, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %122)
br label %124
124: ; preds = %119, %115
br label %125
125: ; preds = %124, %106
%126 = load i32*, i32** %2
%127 = call i32 @wrefresh(i32* %126)
%128 = load i32, i32* %10
%129 = icmp eq i32 %128, 32
br i1 %129, label %130, label %131
130: ; preds = %125
br label %132
131: ; preds = %125
br label %74
132: ; preds = %130
%133 = load i32*, i32** %2
%134 = call i32 @wtimeout(i32* %133, i32 -1)
%135 = call i32 @curs_set(i32 1)
%136 = load i32*, i32** %2
%137 = call i32 @wclear(i32* %136)
%138 = load i32*, i32** %2
%139 = call i32 @mvwaddstr(i32* %138, i32 2, i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%140 = load i32*, i32** %2
%141 = call i32 @mvwaddstr(i32* %140, i32 1, i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%142 = load i32*, i32** %2
%143 = call i32 @wrefresh(i32* %142)
%144 = load i32*, i32** %13
%145 = call i32 @werase(i32* %144)
%146 = load i32*, i32** %13
%147 = load i32, i32* @ACS_VLINE
%148 = load i32, i32* @ACS_HLINE
%149 = call i32 @box(i32* %146, i32 %147, i32 %148)
store i32 0, i32* %9
br label %150
150: ; preds = %161, %132
%151 = load i32, i32* %9
%152 = icmp slt i32 %151, 5
br i1 %152, label %153, label %164
153: ; preds = %150
%154 = load i32*, i32** %13
%155 = load i32, i32* %9
%156 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %154, i32 1, i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %155)
%157 = load i32*, i32** %13
%158 = call i32 @wrefresh(i32* %157)
%159 = call i32 @napms(i32 1000)
%160 = call i32 (...) @flushinp()
br label %161
161: ; preds = %153
%162 = load i32, i32* %9
%163 = add nsw i32 %162, 1
store i32 %163, i32* %9
br label %150
164: ; preds = %150
%165 = load i32*, i32** %13
%166 = call i32 @delwin(i32* %165)
%167 = load i32*, i32** %2
%168 = call i32 @werase(i32* %167)
%169 = call i32 (...) @flash()
%170 = load i32*, i32** %2
%171 = call i32 @wrefresh(i32* %170)
%172 = call i32 @napms(i32 500)
%173 = call i32 (...) @flushinp()
%174 = load i32*, i32** %2
%175 = call i32 @mvwaddstr(i32* %174, i32 2, i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0))
%176 = load i32*, i32** %2
%177 = call i32 @wmove(i32* %176, i32 9, i32 10)
%178 = load i32*, i32** %2
%179 = call i32 @wrefresh(i32* %178)
%180 = call i32 (...) @echo()
%181 = load i32*, i32** %2
%182 = load i32, i32* @TRUE
%183 = call i32 @keypad(i32* %181, i32 %182)
%184 = call i32 (...) @raw()
%185 = load i32*, i32** %2
%186 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%187 = call i32 @wgetnstr(i32* %185, i8* %186, i32 3)
%188 = call i32 (...) @flushinp()
%189 = load i32*, i32** %2
%190 = call i32 @wmove(i32* %189, i32 9, i32 10)
%191 = load i32*, i32** %2
%192 = call i32 @wdelch(i32* %191)
%193 = load i32*, i32** %2
%194 = call i32 @mvwaddstr(i32* %193, i32 4, i32 1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0))
%195 = load i32*, i32** %2
%196 = call i32 @Continue(i32* %195)
%197 = call i32 (...) @refresh()
%198 = load i32*, i32** %2
%199 = call i32 @wclear(i32* %198)
%200 = call i32 (...) @echo()
%201 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
store i8 0, i8* %201
%202 = load i32*, i32** %2
%203 = call i32 @mvwaddstr(i32* %202, i32 3, i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
%204 = load i32*, i32** %2
%205 = call i32 @mvwaddstr(i32* %204, i32 4, i32 2, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.11, i64 0, i64 0))
%206 = load i32*, i32** %2
%207 = call i32 @mvwaddstr(i32* %206, i32 6, i32 2, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.12, i64 0, i64 0))
%208 = load i32*, i32** %2
%209 = call i32 @mvwin(i32* %208, i32 2, i32 1)
%210 = load i32*, i32** %2
%211 = call i32 @wrefresh(i32* %210)
%212 = load i32*, i32** %2
%213 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%214 = call i32 @mvwscanw(i32* %212, i32 7, i32 6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i32* %11, i8* %213)
%215 = load i32*, i32** %2
%216 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%217 = load i32, i32* %11
%218 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %215, i32 8, i32 6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i8* %216, i32 %217)
%219 = load i32*, i32** %2
%220 = call i32 @Continue(i32* %219)
%221 = call i32 (...) @refresh()
%222 = load i32*, i32** %2
%223 = call i32 @wclear(i32* %222)
%224 = call i32 (...) @echo()
%225 = load i32*, i32** %2
%226 = call i32 @mvwaddstr(i32* %225, i32 3, i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0))
%227 = load i32*, i32** %2
%228 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%229 = call i32 @wgetnstr(i32* %227, i8* %228, i32 5)
%230 = load i32*, i32** %2
%231 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%232 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %230, i32 4, i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i8* %231)
%233 = load i32*, i32** %2
%234 = call i32 @Continue(i32* %233)
br label %235
235: ; preds = %164, %46
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"
@KEY_MIN = global i32 0
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [3 x i8] c"%c\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 %137, 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 = %65, %11
%30 = phi i32 [ 0, %11 ], [ %48, %65 ]
%31 = tail call i32 @wgetch(i32* %0)
%32 = load i32, i32* @ERR
%33 = icmp eq i32 %31, %32
br i1 %33, label %34, label %47
34: ; preds = %29, %34
%35 = phi i32 [ %38, %34 ], [ %30, %29 ]
%36 = add nsw i32 %35, 1
%37 = icmp eq i32 %36, 4
%38 = select i1 %37, i32 0, i32 %36
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [4 x i8], [4 x i8]* @inputTest.spinner, i64 0, i64 %39
%41 = load i8, i8* %40
%42 = tail call i32 @mvwaddch(i32* %0, i32 3, i32 3, i8 signext %41)
%43 = tail call i32 @wrefresh(i32* %0)
%44 = tail call i32 @wgetch(i32* %0)
%45 = load i32, i32* @ERR
%46 = icmp eq i32 %44, %45
br i1 %46, label %34, label %47
47: ; preds = %34, %29
%48 = phi i32 [ %30, %29 ], [ %38, %34 ]
%49 = phi i32 [ %31, %29 ], [ %44, %34 ]
%50 = tail call i32 @mvwaddstr(i32* %0, i32 3, i32 5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%51 = tail call i32 @wclrtoeol(i32* %0)
%52 = load i32, i32* @KEY_MIN
%53 = icmp slt i32 %49, %52
br i1 %53, label %57, label %54
54: ; preds = %47
%55 = tail call i32 @keyname(i32 %49)
%56 = tail call i32 @wprintw(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %55)
br label %65
57: ; preds = %47
%58 = tail call i64 @isprint(i32 %49)
%59 = icmp eq i64 %58, 0
br i1 %59, label %62, label %60
60: ; preds = %57
%61 = tail call i32 @wprintw(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %49)
br label %65
62: ; preds = %57
%63 = tail call i32 @unctrl(i32 %49)
%64 = tail call i32 @wprintw(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %63)
br label %65
65: ; preds = %60, %62, %54
%66 = tail call i32 @wrefresh(i32* %0)
%67 = icmp eq i32 %49, 32
br i1 %67, label %68, label %29
68: ; preds = %65
%69 = tail call i32 @wtimeout(i32* %0, i32 -1)
%70 = tail call i32 @curs_set(i32 1)
%71 = tail call i32 @wclear(i32* %0)
%72 = 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))
%73 = 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))
%74 = tail call i32 @wrefresh(i32* %0)
%75 = tail call i32 @werase(i32* %9)
%76 = load i32, i32* @ACS_VLINE
%77 = load i32, i32* @ACS_HLINE
%78 = tail call i32 @box(i32* %9, i32 %76, i32 %77)
%79 = 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)
%80 = tail call i32 @wrefresh(i32* %9)
%81 = tail call i32 @napms(i32 1000)
%82 = tail call i32 (...) @flushinp()
%83 = 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)
%84 = tail call i32 @wrefresh(i32* %9)
%85 = tail call i32 @napms(i32 1000)
%86 = tail call i32 (...) @flushinp()
%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 2)
%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 3)
%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 4)
%96 = tail call i32 @wrefresh(i32* %9)
%97 = tail call i32 @napms(i32 1000)
%98 = tail call i32 (...) @flushinp()
%99 = tail call i32 @delwin(i32* %9)
%100 = tail call i32 @werase(i32* %0)
%101 = tail call i32 (...) @flash()
%102 = tail call i32 @wrefresh(i32* %0)
%103 = tail call i32 @napms(i32 500)
%104 = tail call i32 (...) @flushinp()
%105 = 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))
%106 = tail call i32 @wmove(i32* %0, i32 9, i32 10)
%107 = tail call i32 @wrefresh(i32* %0)
%108 = tail call i32 (...) @echo()
%109 = load i32, i32* @TRUE
%110 = tail call i32 @keypad(i32* %0, i32 %109)
%111 = tail call i32 (...) @raw()
%112 = call i32 @wgetnstr(i32* %0, i8* %5, i32 3)
%113 = call i32 (...) @flushinp()
%114 = call i32 @wmove(i32* %0, i32 9, i32 10)
%115 = call i32 @wdelch(i32* %0)
%116 = call i32 @mvwaddstr(i32* %0, i32 4, i32 1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0))
%117 = call i32 @Continue(i32* %0)
%118 = call i32 (...) @refresh()
%119 = call i32 @wclear(i32* %0)
%120 = call i32 (...) @echo()
store i8 0, i8* %5
%121 = call i32 @mvwaddstr(i32* %0, i32 3, i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
%122 = call i32 @mvwaddstr(i32* %0, i32 4, i32 2, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.11, i64 0, i64 0))
%123 = call i32 @mvwaddstr(i32* %0, i32 6, i32 2, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.12, i64 0, i64 0))
%124 = call i32 @mvwin(i32* %0, i32 2, i32 1)
%125 = call i32 @wrefresh(i32* %0)
%126 = 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)
%127 = load i32, i32* %2
%128 = 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 %127)
%129 = call i32 @Continue(i32* %0)
%130 = call i32 (...) @refresh()
%131 = call i32 @wclear(i32* %0)
%132 = call i32 (...) @echo()
%133 = call i32 @mvwaddstr(i32* %0, i32 3, i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0))
%134 = call i32 @wgetnstr(i32* %0, i8* %5, i32 5)
%135 = 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)
%136 = call i32 @Continue(i32* %0)
br label %137
137: ; preds = %1, %68
ret void
}