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

/* Variables and functions */
int /*<<< orphan*/ ACS_HLINE;
int /*<<< orphan*/ ACS_VLINE;
int A_BLINK;
int A_BOLD;
int /*<<< orphan*/ A_NORMAL;
int COLS;
int /*<<< orphan*/ Continue(int /*<<< orphan*/ *);
int LINES;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ clear();
int /*<<< orphan*/ copywin(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/, int, int,
                           int /*<<< orphan*/);
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ echo();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getbegyx(int /*<<< orphan*/ *, int, int);
char *longname();
int /*<<< orphan*/ mvaddstr(int, int, char *);
int /*<<< orphan*/ mvwaddnstr(int /*<<< orphan*/ *, int, int, char *, int);
int /*<<< orphan*/ mvwaddstr(int /*<<< orphan*/ *, int, int, char *);
int /*<<< orphan*/ mvwin(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ mvwinnstr(int /*<<< orphan*/ *, int, int, char *, int);
int /*<<< orphan*/ mvwinsstr(int /*<<< orphan*/ *, int, int, char *);
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ nl();
int /*<<< orphan*/ overlay(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printw(char *, int, char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ scanw(char *, char *);
int termattrs();
char *termname();
int /*<<< orphan*/ waddstr(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ wattroff(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ wattron(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ wbkgd(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ wclear(int /*<<< orphan*/ *);
int /*<<< orphan*/ wclrtobot(int /*<<< orphan*/ *);
int /*<<< orphan*/ wclrtoeol(int /*<<< orphan*/ *);
int /*<<< orphan*/ werase(int /*<<< orphan*/ *);
int /*<<< orphan*/ wgetch(int /*<<< orphan*/ *);
int /*<<< orphan*/ winch(int /*<<< orphan*/ *);
int /*<<< orphan*/ winsch(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ winsdelln(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ wmove(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ wprintw(int /*<<< orphan*/ *, char *, int, char *);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
int /*<<< orphan*/ wscanw(int /*<<< orphan*/ *, char *, char *);
void outputTest(WINDOW *win) {
  WINDOW *win1;
  char Buffer[80];
  chtype ch;
  int by, bx;
  nl();
  wclear(win);
  mvwaddstr(win, 1, 1,
            "You should now have a screen in the upper left corner, and this "
            "text should have wrapped");
  waddstr(win, "\nThis text should be down\n");
  waddstr(win, "and broken into two here ^");
  Continue(win);
  wclear(win);
  wattron(win, A_BOLD);
  mvwaddstr(win, 1, 1, "A new window will appear with this text in it");
  mvwaddstr(win, 8, 1, "Press any key to continue");
  wrefresh(win);
  wgetch(win);
  getbegyx(win, by, bx);
  if (LINES < 24 || COLS < 75) {
    mvwaddstr(win, 5, 1, "Some tests have been skipped as they require a");
    mvwaddstr(win, 6, 1, "display of at least 24 LINES by 75 COLUMNS");
    Continue(win);
  } else {
    win1 = newwin(10, 50, 14, 25);
    if (win1 == NULL) {
      endwin();
      return;
    }
    wbkgd(win1, A_NORMAL);
    wclear(win1);
    mvwaddstr(win1, 5, 1, "This text should appear; using overlay option");
    copywin(win, win1, 0, 0, 0, 0, 9, 49, TRUE);
    box(win1, ACS_VLINE, ACS_HLINE);
    wmove(win1, 8, 26);
    wrefresh(win1);
    wgetch(win1);
    wclear(win1);
    wattron(win1, A_BLINK);
    mvwaddstr(win1, 4, 1,
              "This blinking text should appear in only the second window");
    wattroff(win1, A_BLINK);
    mvwin(win1, by, bx);
    overlay(win, win1);
    mvwin(win1, 14, 25);
    wmove(win1, 8, 26);
    wrefresh(win1);
    wgetch(win1);
    delwin(win1);
  }
  clear();
  wclear(win);
  wrefresh(win);
  mvwaddstr(win, 6, 2, "This line shouldn't appear");
  mvwaddstr(win, 4, 2, "Only half of the next line is visible");
  mvwaddstr(win, 5, 2, "Only half of the next line is visible");
  wmove(win, 6, 1);
  wclrtobot(win);
  wmove(win, 5, 20);
  wclrtoeol(win);
  mvwaddstr(win, 8, 2, "This line also shouldn't appear");
  wmove(win, 8, 1);
  winsdelln(win, -1);
  Continue(win);
  wmove(win, 5, 9);
  ch = winch(win);
  wclear(win);
  wmove(win, 6, 2);
  waddstr(win, "The next char should be l:  ");
  winsch(win, ch);
  Continue(win);
  mvwinsstr(win, 6, 2, "A1B2C3D4E5");
  Continue(win);
  wmove(win, 5, 1);
  winsdelln(win, 1);
  mvwaddstr(win, 5, 2, "The lines below should have moved down");
  Continue(win);
  wclear(win);
  wmove(win, 2, 2);
  wprintw(win, "This is a formatted string in a window: %d %s\n", 42, "is it");
  mvwaddstr(win, 10, 1, "Enter a string: ");
  wrefresh(win);
  echo();
  wscanw(win, "%s", Buffer);
  printw("This is a formatted string in stdscr: %d %s\n", 42, "is it");
  mvaddstr(10, 1, "Enter a string: ");
  scanw("%s", Buffer);
  wclear(win);
  curs_set(2);
  mvwaddstr(win, 1, 1, "The cursor should appear as a block");
  Continue(win);
  wclear(win);
  curs_set(0);
  mvwaddstr(win, 1, 1, "The cursor should have disappeared");
  Continue(win);
  wclear(win);
  curs_set(1);
  mvwaddstr(win, 1, 1, "The cursor should be an underline");
  Continue(win);
  werase(win);
  mvwaddstr(win, 1, 1, "Information About Your Terminal");
  mvwaddstr(win, 3, 1, termname());
  mvwaddstr(win, 4, 1, longname());
  if (termattrs() & A_BLINK)
    mvwaddstr(win, 5, 1, "This terminal supports blinking.");
  else
    mvwaddstr(win, 5, 1, "This terminal does NOT support blinking.");
  mvwaddnstr(win, 7, 5, "Have a nice day!ok", 16);
  wrefresh(win);
  mvwinnstr(win, 7, 5, Buffer, 18);
  mvaddstr(LINES - 2, 10, Buffer);
  refresh();
  Continue(win);
}


x86 assembly (clang, -O0):
<outputTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1080 <nl@plt>
mov    -0x8(%rbp),%rdi
call   11d0 <wclear@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
lea    0xc51(%rip),%rcx
mov    %edx,%esi
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
lea    0xc98(%rip),%rsi
call   1030 <waddstr@plt>
mov    -0x8(%rbp),%rdi
lea    0xca3(%rip),%rsi
call   1030 <waddstr@plt>
mov    -0x8(%rbp),%rdi
call   1290 <Continue@plt>
mov    -0x8(%rbp),%rdi
call   11d0 <wclear@plt>
mov    -0x8(%rbp),%rdi
mov    0x2bbd(%rip),%rax
mov    (%rax),%esi
call   1210 <wattron@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
lea    0xc85(%rip),%rcx
mov    %edx,%esi
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
lea    0xc97(%rip),%rcx
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   10b0 <wrefresh@plt>
mov    -0x8(%rbp),%rdi
call   11b0 <wgetch@plt>
mov    -0x8(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x6c(%rbp),%edx
call   1130 <getbegyx@plt>
mov    0x2b8d(%rip),%rax
cmpl   $0x18,(%rax)
jl     146c <outputTest+0xec>
mov    0x2b65(%rip),%rax
cmpl   $0x4b,(%rax)
jge    14ae <outputTest+0x12e>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
lea    0xc56(%rip),%rcx
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
lea    0xc6b(%rip),%rcx
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1290 <Continue@plt>
jmp    1630 <outputTest+0x2b0>
mov    $0xa,%edi
mov    $0x32,%esi
mov    $0xe,%edx
mov    $0x19,%ecx
call   10e0 <newwin@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    14e2 <outputTest+0x162>
mov    $0x0,%al
call   11a0 <endwin@plt>
jmp    1a4d <outputTest+0x6cd>
mov    -0x10(%rbp),%rdi
mov    0x2afb(%rip),%rax
mov    (%rax),%esi
call   10a0 <wbkgd@plt>
mov    -0x10(%rbp),%rdi
call   11d0 <wclear@plt>
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
lea    0xc1f(%rip),%rcx
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ab2(%rip),%rax
mov    (%rax),%eax
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x9,(%rsp)
movl   $0x31,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1270 <copywin@plt>
mov    -0x10(%rbp),%rdi
mov    0x2a51(%rip),%rax
mov    (%rax),%esi
mov    0x2a58(%rip),%rax
mov    (%rax),%edx
call   1120 <box@plt>
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1a,%edx
call   1220 <wmove@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <wrefresh@plt>
mov    -0x10(%rbp),%rdi
call   11b0 <wgetch@plt>
mov    -0x10(%rbp),%rdi
call   11d0 <wclear@plt>
mov    -0x10(%rbp),%rdi
mov    0x2a30(%rip),%rax
mov    (%rax),%esi
call   1210 <wattron@plt>
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
lea    0xba3(%rip),%rcx
call   1260 <mvwaddstr@plt>
mov    -0x10(%rbp),%rdi
mov    0x2a04(%rip),%rax
mov    (%rax),%esi
call   1200 <wattroff@plt>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x6c(%rbp),%edx
call   1280 <mvwin@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <overlay@plt>
mov    -0x10(%rbp),%rdi
mov    $0xe,%esi
mov    $0x19,%edx
call   1280 <mvwin@plt>
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1a,%edx
call   1220 <wmove@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <wrefresh@plt>
mov    -0x10(%rbp),%rdi
call   11b0 <wgetch@plt>
mov    -0x10(%rbp),%rdi
call   1140 <delwin@plt>
mov    $0x0,%al
call   1240 <clear@plt>
mov    -0x8(%rbp),%rdi
call   11d0 <wclear@plt>
mov    -0x8(%rbp),%rdi
call   10b0 <wrefresh@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
mov    $0x2,%edx
lea    0xb3c(%rip),%rcx
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x2,%edx
lea    0xb3d(%rip),%rcx
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
mov    $0x2,%edx
lea    0xb23(%rip),%rcx
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
call   1220 <wmove@plt>
mov    -0x8(%rbp),%rdi
call   1180 <wclrtobot@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
mov    $0x14,%edx
call   1220 <wmove@plt>
mov    -0x8(%rbp),%rdi
call   1090 <wclrtoeol@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x2,%edx
lea    0xaf7(%rip),%rcx
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1220 <wmove@plt>
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
call   1070 <winsdelln@plt>
mov    -0x8(%rbp),%rdi
call   1290 <Continue@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
mov    $0x9,%edx
call   1220 <wmove@plt>
mov    -0x8(%rbp),%rdi
call   1110 <winch@plt>
mov    %eax,-0x64(%rbp)
mov    -0x8(%rbp),%rdi
call   11d0 <wclear@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
mov    $0x2,%edx
call   1220 <wmove@plt>
mov    -0x8(%rbp),%rdi
lea    0xaa2(%rip),%rsi
call   1030 <waddstr@plt>
mov    -0x8(%rbp),%rdi
mov    -0x64(%rbp),%esi
call   10d0 <winsch@plt>
mov    -0x8(%rbp),%rdi
call   1290 <Continue@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
mov    $0x2,%edx
lea    0xa90(%rip),%rcx
call   1060 <mvwinsstr@plt>
mov    -0x8(%rbp),%rdi
call   1290 <Continue@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
call   1220 <wmove@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1070 <winsdelln@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
mov    $0x2,%edx
lea    0xa57(%rip),%rcx
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1290 <Continue@plt>
mov    -0x8(%rbp),%rdi
call   11d0 <wclear@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%edx
mov    %edx,%esi
call   1220 <wmove@plt>
mov    -0x8(%rbp),%rdi
lea    0xa4c(%rip),%rsi
mov    $0x2a,%edx
lea    0xa6f(%rip),%rcx
call   1160 <wprintw@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
lea    0xa5b(%rip),%rcx
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   10b0 <wrefresh@plt>
mov    $0x0,%al
call   1040 <echo@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rdx
lea    0xa48(%rip),%rsi
call   11e0 <wscanw@plt>
lea    0xa3f(%rip),%rdi
mov    $0x2a,%esi
lea    0xa19(%rip),%rdx
call   1150 <printw@plt>
mov    $0xa,%edi
mov    $0x1,%esi
lea    0xa09(%rip),%rdx
call   11f0 <mvaddstr@plt>
lea    -0x60(%rbp),%rsi
lea    0xa0a(%rip),%rdi
call   1230 <scanw@plt>
mov    -0x8(%rbp),%rdi
call   11d0 <wclear@plt>
mov    $0x2,%edi
call   1250 <curs_set@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
lea    0xa12(%rip),%rcx
mov    %edx,%esi
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1290 <Continue@plt>
mov    -0x8(%rbp),%rdi
call   11d0 <wclear@plt>
xor    %edi,%edi
call   1250 <curs_set@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
lea    0xa06(%rip),%rcx
mov    %edx,%esi
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1290 <Continue@plt>
mov    -0x8(%rbp),%rdi
call   11d0 <wclear@plt>
mov    $0x1,%edi
call   1250 <curs_set@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
lea    0x9f6(%rip),%rcx
mov    %edx,%esi
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1290 <Continue@plt>
mov    -0x8(%rbp),%rdi
call   12a0 <werase@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
lea    0x9ef(%rip),%rcx
mov    %edx,%esi
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    $0x0,%al
call   11c0 <termname@plt>
mov    -0x80(%rbp),%rdi
mov    %rax,%rcx
mov    $0x3,%esi
mov    $0x1,%edx
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    $0x0,%al
call   1170 <longname@plt>
mov    -0x78(%rbp),%rdi
mov    %rax,%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1260 <mvwaddstr@plt>
mov    $0x0,%al
call   10c0 <termattrs@plt>
mov    0x2637(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     19c3 <outputTest+0x643>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
lea    0x990(%rip),%rcx
call   1260 <mvwaddstr@plt>
jmp    19dd <outputTest+0x65d>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
lea    0x992(%rip),%rcx
call   1260 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
mov    $0x5,%edx
lea    0x9a1(%rip),%rcx
mov    $0x10,%r8d
call   1100 <mvwaddnstr@plt>
mov    -0x8(%rbp),%rdi
call   10b0 <wrefresh@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rcx
mov    $0x7,%esi
mov    $0x5,%edx
mov    $0x12,%r8d
call   10f0 <mvwinnstr@plt>
mov    0x25b6(%rip),%rax
mov    (%rax),%edi
sub    $0x2,%edi
lea    -0x60(%rbp),%rdx
mov    $0xa,%esi
call   11f0 <mvaddstr@plt>
mov    $0x0,%al
call   1190 <refresh@plt>
mov    -0x8(%rbp),%rdi
call   1290 <Continue@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outputTest>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1080 <nl@plt>
mov    %rbx,%rdi
call   11d0 <wclear@plt>
lea    0xc59(%rip),%rcx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1260 <mvwaddstr@plt>
lea    0xc99(%rip),%rsi
mov    %rbx,%rdi
call   1030 <waddstr@plt>
lea    0xca5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <waddstr@plt>
mov    %rbx,%rdi
call   1290 <Continue@plt>
mov    %rbx,%rdi
call   11d0 <wclear@plt>
mov    0x2bc2(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1210 <wattron@plt>
lea    0xc90(%rip),%rcx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1260 <mvwaddstr@plt>
lea    0xca5(%rip),%rcx
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1260 <mvwaddstr@plt>
mov    %rbx,%rdi
call   10b0 <wrefresh@plt>
mov    %rbx,%rdi
call   11b0 <wgetch@plt>
mov    %rbx,%rdi
call   1130 <getbegyx@plt>
mov    0x2b97(%rip),%r13
cmpl   $0x18,0x0(%r13)
jl     15b1 <outputTest+0x231>
mov    0x2b6d(%rip),%rax
cmpl   $0x4a,(%rax)
jle    15b1 <outputTest+0x231>
mov    $0xa,%edi
mov    $0x32,%esi
mov    $0xe,%edx
mov    $0x19,%ecx
call   10e0 <newwin@plt>
test   %rax,%rax
je     19bb <outputTest+0x63b>
mov    %rax,%r14
mov    0x2b58(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   10a0 <wbkgd@plt>
mov    %r14,%rdi
call   11d0 <wclear@plt>
lea    0xc88(%rip),%rcx
mov    %r14,%rdi
mov    $0x5,%esi
mov    $0x1,%edx
call   1260 <mvwaddstr@plt>
mov    0x2b16(%rip),%rax
mov    (%rax),%eax
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
push   $0x31
push   $0x9
call   1270 <copywin@plt>
add    $0x20,%rsp
mov    0x2abb(%rip),%rax
mov    (%rax),%esi
mov    0x2ac2(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
call   1120 <box@plt>
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1a,%edx
call   1220 <wmove@plt>
mov    %r14,%rdi
call   10b0 <wrefresh@plt>
mov    %r14,%rdi
call   11b0 <wgetch@plt>
mov    %r14,%rdi
call   11d0 <wclear@plt>
mov    0x2a9f(%rip),%rbp
mov    0x0(%rbp),%esi
mov    %r14,%rdi
call   1210 <wattron@plt>
lea    0xc1c(%rip),%rcx
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1260 <mvwaddstr@plt>
mov    0x0(%rbp),%esi
mov    %r14,%rdi
call   1200 <wattroff@plt>
mov    %r14,%rdi
call   1280 <mvwin@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <overlay@plt>
mov    %r14,%rdi
mov    $0xe,%esi
mov    $0x19,%edx
call   1280 <mvwin@plt>
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1a,%edx
call   1220 <wmove@plt>
mov    %r14,%rdi
call   10b0 <wrefresh@plt>
mov    %r14,%rdi
call   11b0 <wgetch@plt>
mov    %r14,%rdi
call   1140 <delwin@plt>
jmp    15eb <outputTest+0x26b>
lea    0xb1f(%rip),%rcx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x1,%edx
call   1260 <mvwaddstr@plt>
lea    0xb35(%rip),%rcx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x1,%edx
call   1260 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1290 <Continue@plt>
xor    %eax,%eax
call   1240 <clear@plt>
mov    %rbx,%rdi
call   11d0 <wclear@plt>
mov    %rbx,%rdi
call   10b0 <wrefresh@plt>
lea    0xb91(%rip),%rcx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x2,%edx
call   1260 <mvwaddstr@plt>
lea    0xb93(%rip),%r14
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x2,%edx
mov    %r14,%rcx
call   1260 <mvwaddstr@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x2,%edx
mov    %r14,%rcx
call   1260 <mvwaddstr@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x1,%edx
call   1220 <wmove@plt>
mov    %rbx,%rdi
call   1180 <wclrtobot@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x14,%edx
call   1220 <wmove@plt>
mov    %rbx,%rdi
call   1090 <wclrtoeol@plt>
lea    0xb54(%rip),%rcx
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x2,%edx
call   1260 <mvwaddstr@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1220 <wmove@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
call   1070 <winsdelln@plt>
mov    %rbx,%rdi
call   1290 <Continue@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x9,%edx
call   1220 <wmove@plt>
mov    %rbx,%rdi
call   1110 <winch@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   11d0 <wclear@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x2,%edx
call   1220 <wmove@plt>
lea    0xafe(%rip),%rsi
mov    %rbx,%rdi
call   1030 <waddstr@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   10d0 <winsch@plt>
mov    %rbx,%rdi
call   1290 <Continue@plt>
lea    0xafa(%rip),%rcx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x2,%edx
call   1060 <mvwinsstr@plt>
mov    %rbx,%rdi
call   1290 <Continue@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x1,%edx
call   1220 <wmove@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1070 <winsdelln@plt>
lea    0xac5(%rip),%rcx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x2,%edx
call   1260 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1290 <Continue@plt>
mov    %rbx,%rdi
call   11d0 <wclear@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1220 <wmove@plt>
lea    0xab1(%rip),%rsi
lea    0xad9(%rip),%r15
mov    %rbx,%rdi
mov    $0x2a,%edx
mov    %r15,%rcx
call   1160 <wprintw@plt>
lea    0xac8(%rip),%r12
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1260 <mvwaddstr@plt>
mov    %rbx,%rdi
call   10b0 <wrefresh@plt>
xor    %eax,%eax
call   1040 <echo@plt>
lea    0xaae(%rip),%rbp
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
call   11e0 <wscanw@plt>
lea    0xa99(%rip),%rdi
mov    $0x2a,%esi
mov    %r15,%rdx
call   1150 <printw@plt>
mov    $0xa,%edi
mov    $0x1,%esi
mov    %r12,%rdx
call   11f0 <mvaddstr@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1230 <scanw@plt>
mov    %rbx,%rdi
call   11d0 <wclear@plt>
mov    $0x2,%edi
call   1250 <curs_set@plt>
lea    0xa83(%rip),%rcx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1260 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1290 <Continue@plt>
mov    %rbx,%rdi
call   11d0 <wclear@plt>
xor    %edi,%edi
call   1250 <curs_set@plt>
lea    0xa77(%rip),%rcx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1260 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1290 <Continue@plt>
mov    %rbx,%rdi
call   11d0 <wclear@plt>
mov    $0x1,%edi
call   1250 <curs_set@plt>
lea    0xa67(%rip),%rcx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1260 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1290 <Continue@plt>
mov    %rbx,%rdi
call   12a0 <werase@plt>
lea    0xa60(%rip),%rcx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1260 <mvwaddstr@plt>
xor    %eax,%eax
call   11c0 <termname@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1260 <mvwaddstr@plt>
xor    %eax,%eax
call   1170 <longname@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1260 <mvwaddstr@plt>
xor    %eax,%eax
call   10c0 <termattrs@plt>
mov    0x26af(%rip),%rcx
and    (%rcx),%eax
lea    0xa40(%rip),%rax
lea    0xa18(%rip),%rcx
cmove  %rax,%rcx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x1,%edx
call   1260 <mvwaddstr@plt>
lea    0xa45(%rip),%rcx
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x5,%edx
mov    $0x10,%r8d
call   1100 <mvwaddnstr@plt>
mov    %rbx,%rdi
call   10b0 <wrefresh@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x5,%edx
mov    %r14,%rcx
mov    $0x12,%r8d
call   10f0 <mvwinnstr@plt>
mov    0x0(%r13),%edi
add    $0xfffffffe,%edi
mov    $0xa,%esi
mov    %r14,%rdx
call   11f0 <mvaddstr@plt>
xor    %eax,%eax
call   1190 <refresh@plt>
mov    %rbx,%rdi
call   1290 <Continue@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    11a0 <endwin@plt>

LLVM IR (-O0):
@.str = [89 x i8] c"You should now have a screen in the upper left corner, and this text should have wrapped\00"
@.str.1 = [27 x i8] c"\0AThis text should be down\0A\00"
@.str.2 = [27 x i8] c"and broken into two here ^\00"
@A_BOLD = global i32 0
@.str.3 = [46 x i8] c"A new window will appear with this text in it\00"
@.str.4 = [26 x i8] c"Press any key to continue\00"
@LINES = global i32 0
@COLS = global i32 0
@.str.5 = [47 x i8] c"Some tests have been skipped as they require a\00"
@.str.6 = [43 x i8] c"display of at least 24 LINES by 75 COLUMNS\00"
@A_NORMAL = global i32 0
@.str.7 = [46 x i8] c"This text should appear; using overlay option\00"
@TRUE = global i32 0
@ACS_VLINE = global i32 0
@ACS_HLINE = global i32 0
@A_BLINK = global i32 0
@.str.8 = [59 x i8] c"This blinking text should appear in only the second window\00"
@.str.9 = [27 x i8] c"This line shouldn't appear\00"
@.str.10 = [38 x i8] c"Only half of the next line is visible\00"
@.str.11 = [32 x i8] c"This line also shouldn't appear\00"
@.str.12 = [29 x i8] c"The next char should be l: \00"
@.str.13 = [11 x i8] c"A1B2C3D4E5\00"
@.str.14 = [39 x i8] c"The lines below should have moved down\00"
@.str.15 = [47 x i8] c"This is a formatted string in a window: %d %s\0A\00"
@.str.16 = [6 x i8] c"is it\00"
@.str.17 = [17 x i8] c"Enter a string: \00"
@.str.18 = [3 x i8] c"%s\00"
@.str.19 = [45 x i8] c"This is a formatted string in stdscr: %d %s\0A\00"
@.str.20 = [36 x i8] c"The cursor should appear as a block\00"
@.str.21 = [35 x i8] c"The cursor should have disappeared\00"
@.str.22 = [34 x i8] c"The cursor should be an underline\00"
@.str.23 = [32 x i8] c"Information About Your Terminal\00"
@.str.24 = [33 x i8] c"This terminal supports blinking.\00"
@.str.25 = [41 x i8] c"This terminal does NOT support blinking.\00"
@.str.26 = [19 x i8] c"Have a nice day!ok\00"
define void @outputTest(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca [80 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %2
%8 = call i32 (...) @nl()
%9 = load i32*, i32** %2
%10 = call i32 @wclear(i32* %9)
%11 = load i32*, i32** %2
%12 = call i32 @mvwaddstr(i32* %11, i32 1, i32 1, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
%13 = load i32*, i32** %2
%14 = call i32 @waddstr(i32* %13, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32*, i32** %2
%16 = call i32 @waddstr(i32* %15, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%17 = load i32*, i32** %2
%18 = call i32 @Continue(i32* %17)
%19 = load i32*, i32** %2
%20 = call i32 @wclear(i32* %19)
%21 = load i32*, i32** %2
%22 = load i32, i32* @A_BOLD
%23 = call i32 @wattron(i32* %21, i32 %22)
%24 = load i32*, i32** %2
%25 = call i32 @mvwaddstr(i32* %24, i32 1, i32 1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%26 = load i32*, i32** %2
%27 = call i32 @mvwaddstr(i32* %26, i32 8, i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%28 = load i32*, i32** %2
%29 = call i32 @wrefresh(i32* %28)
%30 = load i32*, i32** %2
%31 = call i32 @wgetch(i32* %30)
%32 = load i32*, i32** %2
%33 = load i32, i32* %6
%34 = load i32, i32* %7
%35 = call i32 @getbegyx(i32* %32, i32 %33, i32 %34)
%36 = load i32, i32* @LINES
%37 = icmp slt i32 %36, 24
br i1 %37, label %41, label %38
38: ; preds = %1
%39 = load i32, i32* @COLS
%40 = icmp slt i32 %39, 75
br i1 %40, label %41, label %48
41: ; preds = %38, %1
%42 = load i32*, i32** %2
%43 = call i32 @mvwaddstr(i32* %42, i32 5, i32 1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0))
%44 = load i32*, i32** %2
%45 = call i32 @mvwaddstr(i32* %44, i32 6, i32 1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0))
%46 = load i32*, i32** %2
%47 = call i32 @Continue(i32* %46)
br label %103
48: ; preds = %38
%49 = call i32* @newwin(i32 10, i32 50, i32 14, i32 25)
store i32* %49, i32** %3
%50 = load i32*, i32** %3
%51 = icmp eq i32* %50, null
br i1 %51, label %52, label %54
52: ; preds = %48
%53 = call i32 (...) @endwin()
br label %232
54: ; preds = %48
%55 = load i32*, i32** %3
%56 = load i32, i32* @A_NORMAL
%57 = call i32 @wbkgd(i32* %55, i32 %56)
%58 = load i32*, i32** %3
%59 = call i32 @wclear(i32* %58)
%60 = load i32*, i32** %3
%61 = call i32 @mvwaddstr(i32* %60, i32 5, i32 1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0))
%62 = load i32*, i32** %2
%63 = load i32*, i32** %3
%64 = load i32, i32* @TRUE
%65 = call i32 @copywin(i32* %62, i32* %63, i32 0, i32 0, i32 0, i32 0, i32 9, i32 49, i32 %64)
%66 = load i32*, i32** %3
%67 = load i32, i32* @ACS_VLINE
%68 = load i32, i32* @ACS_HLINE
%69 = call i32 @box(i32* %66, i32 %67, i32 %68)
%70 = load i32*, i32** %3
%71 = call i32 @wmove(i32* %70, i32 8, i32 26)
%72 = load i32*, i32** %3
%73 = call i32 @wrefresh(i32* %72)
%74 = load i32*, i32** %3
%75 = call i32 @wgetch(i32* %74)
%76 = load i32*, i32** %3
%77 = call i32 @wclear(i32* %76)
%78 = load i32*, i32** %3
%79 = load i32, i32* @A_BLINK
%80 = call i32 @wattron(i32* %78, i32 %79)
%81 = load i32*, i32** %3
%82 = call i32 @mvwaddstr(i32* %81, i32 4, i32 1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.8, i64 0, i64 0))
%83 = load i32*, i32** %3
%84 = load i32, i32* @A_BLINK
%85 = call i32 @wattroff(i32* %83, i32 %84)
%86 = load i32*, i32** %3
%87 = load i32, i32* %6
%88 = load i32, i32* %7
%89 = call i32 @mvwin(i32* %86, i32 %87, i32 %88)
%90 = load i32*, i32** %2
%91 = load i32*, i32** %3
%92 = call i32 @overlay(i32* %90, i32* %91)
%93 = load i32*, i32** %3
%94 = call i32 @mvwin(i32* %93, i32 14, i32 25)
%95 = load i32*, i32** %3
%96 = call i32 @wmove(i32* %95, i32 8, i32 26)
%97 = load i32*, i32** %3
%98 = call i32 @wrefresh(i32* %97)
%99 = load i32*, i32** %3
%100 = call i32 @wgetch(i32* %99)
%101 = load i32*, i32** %3
%102 = call i32 @delwin(i32* %101)
br label %103
103: ; preds = %54, %41
%104 = call i32 (...) @clear()
%105 = load i32*, i32** %2
%106 = call i32 @wclear(i32* %105)
%107 = load i32*, i32** %2
%108 = call i32 @wrefresh(i32* %107)
%109 = load i32*, i32** %2
%110 = call i32 @mvwaddstr(i32* %109, i32 6, i32 2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%111 = load i32*, i32** %2
%112 = call i32 @mvwaddstr(i32* %111, i32 4, i32 2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
%113 = load i32*, i32** %2
%114 = call i32 @mvwaddstr(i32* %113, i32 5, i32 2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
%115 = load i32*, i32** %2
%116 = call i32 @wmove(i32* %115, i32 6, i32 1)
%117 = load i32*, i32** %2
%118 = call i32 @wclrtobot(i32* %117)
%119 = load i32*, i32** %2
%120 = call i32 @wmove(i32* %119, i32 5, i32 20)
%121 = load i32*, i32** %2
%122 = call i32 @wclrtoeol(i32* %121)
%123 = load i32*, i32** %2
%124 = call i32 @mvwaddstr(i32* %123, i32 8, i32 2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0))
%125 = load i32*, i32** %2
%126 = call i32 @wmove(i32* %125, i32 8, i32 1)
%127 = load i32*, i32** %2
%128 = call i32 @winsdelln(i32* %127, i32 -1)
%129 = load i32*, i32** %2
%130 = call i32 @Continue(i32* %129)
%131 = load i32*, i32** %2
%132 = call i32 @wmove(i32* %131, i32 5, i32 9)
%133 = load i32*, i32** %2
%134 = call i32 @winch(i32* %133)
store i32 %134, i32* %5
%135 = load i32*, i32** %2
%136 = call i32 @wclear(i32* %135)
%137 = load i32*, i32** %2
%138 = call i32 @wmove(i32* %137, i32 6, i32 2)
%139 = load i32*, i32** %2
%140 = call i32 @waddstr(i32* %139, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0))
%141 = load i32*, i32** %2
%142 = load i32, i32* %5
%143 = call i32 @winsch(i32* %141, i32 %142)
%144 = load i32*, i32** %2
%145 = call i32 @Continue(i32* %144)
%146 = load i32*, i32** %2
%147 = call i32 @mvwinsstr(i32* %146, i32 6, i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
%148 = load i32*, i32** %2
%149 = call i32 @Continue(i32* %148)
%150 = load i32*, i32** %2
%151 = call i32 @wmove(i32* %150, i32 5, i32 1)
%152 = load i32*, i32** %2
%153 = call i32 @winsdelln(i32* %152, i32 1)
%154 = load i32*, i32** %2
%155 = call i32 @mvwaddstr(i32* %154, i32 5, i32 2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.14, i64 0, i64 0))
%156 = load i32*, i32** %2
%157 = call i32 @Continue(i32* %156)
%158 = load i32*, i32** %2
%159 = call i32 @wclear(i32* %158)
%160 = load i32*, i32** %2
%161 = call i32 @wmove(i32* %160, i32 2, i32 2)
%162 = load i32*, i32** %2
%163 = call i32 @wprintw(i32* %162, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.15, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%164 = load i32*, i32** %2
%165 = call i32 @mvwaddstr(i32* %164, i32 10, i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.17, i64 0, i64 0))
%166 = load i32*, i32** %2
%167 = call i32 @wrefresh(i32* %166)
%168 = call i32 (...) @echo()
%169 = load i32*, i32** %2
%170 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%171 = call i32 @wscanw(i32* %169, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* %170)
%172 = call i32 @printw(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.19, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%173 = call i32 @mvaddstr(i32 10, i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.17, i64 0, i64 0))
%174 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%175 = call i32 @scanw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* %174)
%176 = load i32*, i32** %2
%177 = call i32 @wclear(i32* %176)
%178 = call i32 @curs_set(i32 2)
%179 = load i32*, i32** %2
%180 = call i32 @mvwaddstr(i32* %179, i32 1, i32 1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.20, i64 0, i64 0))
%181 = load i32*, i32** %2
%182 = call i32 @Continue(i32* %181)
%183 = load i32*, i32** %2
%184 = call i32 @wclear(i32* %183)
%185 = call i32 @curs_set(i32 0)
%186 = load i32*, i32** %2
%187 = call i32 @mvwaddstr(i32* %186, i32 1, i32 1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.21, i64 0, i64 0))
%188 = load i32*, i32** %2
%189 = call i32 @Continue(i32* %188)
%190 = load i32*, i32** %2
%191 = call i32 @wclear(i32* %190)
%192 = call i32 @curs_set(i32 1)
%193 = load i32*, i32** %2
%194 = call i32 @mvwaddstr(i32* %193, i32 1, i32 1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.22, i64 0, i64 0))
%195 = load i32*, i32** %2
%196 = call i32 @Continue(i32* %195)
%197 = load i32*, i32** %2
%198 = call i32 @werase(i32* %197)
%199 = load i32*, i32** %2
%200 = call i32 @mvwaddstr(i32* %199, i32 1, i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.23, i64 0, i64 0))
%201 = load i32*, i32** %2
%202 = call i8* (...) @termname()
%203 = call i32 @mvwaddstr(i32* %201, i32 3, i32 1, i8* %202)
%204 = load i32*, i32** %2
%205 = call i8* (...) @longname()
%206 = call i32 @mvwaddstr(i32* %204, i32 4, i32 1, i8* %205)
%207 = call i32 (...) @termattrs()
%208 = load i32, i32* @A_BLINK
%209 = and i32 %207, %208
%210 = icmp ne i32 %209, 0
br i1 %210, label %211, label %214
211: ; preds = %103
%212 = load i32*, i32** %2
%213 = call i32 @mvwaddstr(i32* %212, i32 5, i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.24, i64 0, i64 0))
br label %217
214: ; preds = %103
%215 = load i32*, i32** %2
%216 = call i32 @mvwaddstr(i32* %215, i32 5, i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.25, i64 0, i64 0))
br label %217
217: ; preds = %214, %211
%218 = load i32*, i32** %2
%219 = call i32 @mvwaddnstr(i32* %218, i32 7, i32 5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.26, i64 0, i64 0), i32 16)
%220 = load i32*, i32** %2
%221 = call i32 @wrefresh(i32* %220)
%222 = load i32*, i32** %2
%223 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%224 = call i32 @mvwinnstr(i32* %222, i32 7, i32 5, i8* %223, i32 18)
%225 = load i32, i32* @LINES
%226 = sub nsw i32 %225, 2
%227 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%228 = call i32 @mvaddstr(i32 %226, i32 10, i8* %227)
%229 = call i32 (...) @refresh()
%230 = load i32*, i32** %2
%231 = call i32 @Continue(i32* %230)
br label %232
232: ; preds = %217, %52
ret void
}

LLVM IR (-O2):
@.str = [89 x i8] c"You should now have a screen in the upper left corner, and this text should have wrapped\00"
@.str.1 = [27 x i8] c"\0AThis text should be down\0A\00"
@.str.2 = [27 x i8] c"and broken into two here ^\00"
@A_BOLD = global i32 0
@.str.3 = [46 x i8] c"A new window will appear with this text in it\00"
@.str.4 = [26 x i8] c"Press any key to continue\00"
@LINES = global i32 0
@COLS = global i32 0
@.str.5 = [47 x i8] c"Some tests have been skipped as they require a\00"
@.str.6 = [43 x i8] c"display of at least 24 LINES by 75 COLUMNS\00"
@A_NORMAL = global i32 0
@.str.7 = [46 x i8] c"This text should appear; using overlay option\00"
@TRUE = global i32 0
@ACS_VLINE = global i32 0
@ACS_HLINE = global i32 0
@A_BLINK = global i32 0
@.str.8 = [59 x i8] c"This blinking text should appear in only the second window\00"
@.str.9 = [27 x i8] c"This line shouldn't appear\00"
@.str.10 = [38 x i8] c"Only half of the next line is visible\00"
@.str.11 = [32 x i8] c"This line also shouldn't appear\00"
@.str.12 = [29 x i8] c"The next char should be l: \00"
@.str.13 = [11 x i8] c"A1B2C3D4E5\00"
@.str.14 = [39 x i8] c"The lines below should have moved down\00"
@.str.15 = [47 x i8] c"This is a formatted string in a window: %d %s\0A\00"
@.str.16 = [6 x i8] c"is it\00"
@.str.17 = [17 x i8] c"Enter a string: \00"
@.str.18 = [3 x i8] c"%s\00"
@.str.19 = [45 x i8] c"This is a formatted string in stdscr: %d %s\0A\00"
@.str.20 = [36 x i8] c"The cursor should appear as a block\00"
@.str.21 = [35 x i8] c"The cursor should have disappeared\00"
@.str.22 = [34 x i8] c"The cursor should be an underline\00"
@.str.23 = [32 x i8] c"Information About Your Terminal\00"
@.str.24 = [33 x i8] c"This terminal supports blinking.\00"
@.str.25 = [41 x i8] c"This terminal does NOT support blinking.\00"
@.str.26 = [19 x i8] c"Have a nice day!ok\00"
define void @outputTest(i32* %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (...) @nl()
%5 = tail call i32 @wclear(i32* %0)
%6 = tail call i32 @mvwaddstr(i32* %0, i32 1, i32 1, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @waddstr(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @waddstr(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @Continue(i32* %0)
%10 = tail call i32 @wclear(i32* %0)
%11 = load i32, i32* @A_BOLD
%12 = tail call i32 @wattron(i32* %0, i32 %11)
%13 = tail call i32 @mvwaddstr(i32* %0, i32 1, i32 1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%14 = tail call i32 @mvwaddstr(i32* %0, i32 8, i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%15 = tail call i32 @wrefresh(i32* %0)
%16 = tail call i32 @wgetch(i32* %0)
%17 = tail call i32 @getbegyx(i32* %0, i32 undef, i32 undef)
%18 = load i32, i32* @LINES
%19 = icmp slt i32 %18, 24
%20 = load i32, i32* @COLS
%21 = icmp slt i32 %20, 75
%22 = select i1 %19, i1 true, i1 %21
br i1 %22, label %23, label %27
23: ; preds = %1
%24 = tail call i32 @mvwaddstr(i32* %0, i32 5, i32 1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0))
%25 = tail call i32 @mvwaddstr(i32* %0, i32 6, i32 1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0))
%26 = tail call i32 @Continue(i32* %0)
br label %58
27: ; preds = %1
%28 = tail call i32* @newwin(i32 10, i32 50, i32 14, i32 25)
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = tail call i32 (...) @endwin()
br label %128
32: ; preds = %27
%33 = load i32, i32* @A_NORMAL
%34 = tail call i32 @wbkgd(i32* %28, i32 %33)
%35 = tail call i32 @wclear(i32* %28)
%36 = tail call i32 @mvwaddstr(i32* %28, i32 5, i32 1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0))
%37 = load i32, i32* @TRUE
%38 = tail call i32 @copywin(i32* %0, i32* %28, i32 0, i32 0, i32 0, i32 0, i32 9, i32 49, i32 %37)
%39 = load i32, i32* @ACS_VLINE
%40 = load i32, i32* @ACS_HLINE
%41 = tail call i32 @box(i32* %28, i32 %39, i32 %40)
%42 = tail call i32 @wmove(i32* %28, i32 8, i32 26)
%43 = tail call i32 @wrefresh(i32* %28)
%44 = tail call i32 @wgetch(i32* %28)
%45 = tail call i32 @wclear(i32* %28)
%46 = load i32, i32* @A_BLINK
%47 = tail call i32 @wattron(i32* %28, i32 %46)
%48 = tail call i32 @mvwaddstr(i32* %28, i32 4, i32 1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.8, i64 0, i64 0))
%49 = load i32, i32* @A_BLINK
%50 = tail call i32 @wattroff(i32* %28, i32 %49)
%51 = tail call i32 @mvwin(i32* %28, i32 undef, i32 undef)
%52 = tail call i32 @overlay(i32* %0, i32* %28)
%53 = tail call i32 @mvwin(i32* %28, i32 14, i32 25)
%54 = tail call i32 @wmove(i32* %28, i32 8, i32 26)
%55 = tail call i32 @wrefresh(i32* %28)
%56 = tail call i32 @wgetch(i32* %28)
%57 = tail call i32 @delwin(i32* %28)
br label %58
58: ; preds = %32, %23
%59 = tail call i32 (...) @clear()
%60 = tail call i32 @wclear(i32* %0)
%61 = tail call i32 @wrefresh(i32* %0)
%62 = tail call i32 @mvwaddstr(i32* %0, i32 6, i32 2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%63 = tail call i32 @mvwaddstr(i32* %0, i32 4, i32 2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
%64 = tail call i32 @mvwaddstr(i32* %0, i32 5, i32 2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
%65 = tail call i32 @wmove(i32* %0, i32 6, i32 1)
%66 = tail call i32 @wclrtobot(i32* %0)
%67 = tail call i32 @wmove(i32* %0, i32 5, i32 20)
%68 = tail call i32 @wclrtoeol(i32* %0)
%69 = tail call i32 @mvwaddstr(i32* %0, i32 8, i32 2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0))
%70 = tail call i32 @wmove(i32* %0, i32 8, i32 1)
%71 = tail call i32 @winsdelln(i32* %0, i32 -1)
%72 = tail call i32 @Continue(i32* %0)
%73 = tail call i32 @wmove(i32* %0, i32 5, i32 9)
%74 = tail call i32 @winch(i32* %0)
%75 = tail call i32 @wclear(i32* %0)
%76 = tail call i32 @wmove(i32* %0, i32 6, i32 2)
%77 = tail call i32 @waddstr(i32* %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0))
%78 = tail call i32 @winsch(i32* %0, i32 %74)
%79 = tail call i32 @Continue(i32* %0)
%80 = tail call i32 @mvwinsstr(i32* %0, i32 6, i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
%81 = tail call i32 @Continue(i32* %0)
%82 = tail call i32 @wmove(i32* %0, i32 5, i32 1)
%83 = tail call i32 @winsdelln(i32* %0, i32 1)
%84 = tail call i32 @mvwaddstr(i32* %0, i32 5, i32 2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.14, i64 0, i64 0))
%85 = tail call i32 @Continue(i32* %0)
%86 = tail call i32 @wclear(i32* %0)
%87 = tail call i32 @wmove(i32* %0, i32 2, i32 2)
%88 = tail call i32 @wprintw(i32* %0, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.15, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%89 = tail call i32 @mvwaddstr(i32* %0, i32 10, i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.17, i64 0, i64 0))
%90 = tail call i32 @wrefresh(i32* %0)
%91 = tail call i32 (...) @echo()
%92 = call i32 @wscanw(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* %3)
%93 = call i32 @printw(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.19, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%94 = call i32 @mvaddstr(i32 10, i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.17, i64 0, i64 0))
%95 = call i32 @scanw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* %3)
%96 = call i32 @wclear(i32* %0)
%97 = call i32 @curs_set(i32 2)
%98 = call i32 @mvwaddstr(i32* %0, i32 1, i32 1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.20, i64 0, i64 0))
%99 = call i32 @Continue(i32* %0)
%100 = call i32 @wclear(i32* %0)
%101 = call i32 @curs_set(i32 0)
%102 = call i32 @mvwaddstr(i32* %0, i32 1, i32 1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.21, i64 0, i64 0))
%103 = call i32 @Continue(i32* %0)
%104 = call i32 @wclear(i32* %0)
%105 = call i32 @curs_set(i32 1)
%106 = call i32 @mvwaddstr(i32* %0, i32 1, i32 1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.22, i64 0, i64 0))
%107 = call i32 @Continue(i32* %0)
%108 = call i32 @werase(i32* %0)
%109 = call i32 @mvwaddstr(i32* %0, i32 1, i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.23, i64 0, i64 0))
%110 = call i8* (...) @termname()
%111 = call i32 @mvwaddstr(i32* %0, i32 3, i32 1, i8* %110)
%112 = call i8* (...) @longname()
%113 = call i32 @mvwaddstr(i32* %0, i32 4, i32 1, i8* %112)
%114 = call i32 (...) @termattrs()
%115 = load i32, i32* @A_BLINK
%116 = and i32 %115, %114
%117 = icmp eq i32 %116, 0
%118 = select i1 %117, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.24, i64 0, i64 0)
%119 = call i32 @mvwaddstr(i32* %0, i32 5, i32 1, i8* %118)
%120 = call i32 @mvwaddnstr(i32* %0, i32 7, i32 5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.26, i64 0, i64 0), i32 16)
%121 = call i32 @wrefresh(i32* %0)
%122 = call i32 @mvwinnstr(i32* %0, i32 7, i32 5, i8* %3, i32 18)
%123 = load i32, i32* @LINES
%124 = add nsw i32 %123, -2
%125 = call i32 @mvaddstr(i32 %124, i32 10, i8* %3)
%126 = call i32 (...) @refresh()
%127 = call i32 @Continue(i32* %0)
br label %128
128: ; preds = %58, %30
ret void
}