#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 COLS;
int /*<<< orphan*/ EXIT_SUCCESS;
int LINES;
int /*<<< orphan*/ box(int /*<<< orphan*/ *, char, char);
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ mvwaddch(int /*<<< orphan*/ *, int, int, char);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int, char *, char *);
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ printw(char *, char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ *stdscr;
int /*<<< orphan*/ touchwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ wclear(int /*<<< orphan*/ *);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
int main() {
  WINDOW *new_window_ptr;
  WINDOW *popup_window_ptr;
  int x_loop;
  int y_loop;
  char a_letter = 'a';
  initscr();
  move(5, 5);
  printw("%s", "Testing multiple windows");
  refresh();
  for (y_loop = 0; y_loop < LINES - 1; y_loop++) {
    for (x_loop = 0; x_loop < COLS - 1; x_loop++) {
      mvwaddch(stdscr, y_loop, x_loop, a_letter);
      a_letter++;
      if (a_letter > 'z')
        a_letter = 'a';
    }
  }
  refresh();
  sleep(2);
  new_window_ptr = newwin(10, 20, 5, 5);
  mvwprintw(new_window_ptr, 2, 2, "%s", "Hello World");
  mvwprintw(new_window_ptr, 5, 2, "%s",
            "Notice how very long lines wrap inside the window");
  wrefresh(new_window_ptr);
  sleep(2);
  a_letter = '0';
  for (y_loop = 0; y_loop < LINES - 1; y_loop++) {
    for (x_loop = 0; x_loop < COLS - 1; x_loop++) {
      mvwaddch(stdscr, y_loop, x_loop, a_letter);
      a_letter++;
      if (a_letter > '9')
        a_letter = '0';
    }
  }
  refresh();
  sleep(2);
  wrefresh(new_window_ptr);
  sleep(2);
  touchwin(new_window_ptr);
  wrefresh(new_window_ptr);
  sleep(2);
  popup_window_ptr = newwin(10, 20, 8, 8);
  box(popup_window_ptr, '|', '-');
  mvwprintw(popup_window_ptr, 5, 2, "%s", "Pop Up window!");
  wrefresh(popup_window_ptr);
  sleep(2);
  touchwin(new_window_ptr);
  wrefresh(new_window_ptr);
  sleep(2);
  wclear(new_window_ptr);
  wrefresh(new_window_ptr);
  sleep(2);
  delwin(new_window_ptr);
  touchwin(popup_window_ptr);
  wrefresh(popup_window_ptr);
  sleep(2);
  delwin(popup_window_ptr);
  touchwin(stdscr);
  refresh();
  sleep(2);
  endwin();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x21(%rbp)
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x5,%esi
mov    %esi,%edi
call   1110 <move@plt>
lea    0xde3(%rip),%rdi
lea    0xddf(%rip),%rsi
call   1090 <printw@plt>
mov    $0x0,%al
call   10a0 <refresh@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2da7(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12c4 <main+0xd4>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2d79(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12b1 <main+0xc1>
mov    0x2d6d(%rip),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
movsbl -0x21(%rbp),%ecx
call   10e0 <mvwaddch@plt>
mov    -0x21(%rbp),%al
add    $0x1,%al
mov    %al,-0x21(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x7a,%eax
jle    129e <main+0xae>
movb   $0x61,-0x21(%rbp)
jmp    12a3 <main+0xb3>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1255 <main+0x65>
jmp    12b6 <main+0xc6>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1237 <main+0x47>
mov    $0x0,%al
call   10a0 <refresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    $0xa,%edi
mov    $0x14,%esi
mov    $0x5,%ecx
mov    %ecx,%edx
call   1060 <newwin@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2,%edx
lea    0xd01(%rip),%rcx
lea    0xd16(%rip),%r8
mov    %edx,%esi
call   10d0 <mvwprintw@plt>
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
mov    $0x2,%edx
lea    0xcde(%rip),%rcx
lea    0xcff(%rip),%r8
call   10d0 <mvwprintw@plt>
mov    -0x10(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
movb   $0x30,-0x21(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2c92(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13d9 <main+0x1e9>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2c64(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13c6 <main+0x1d6>
mov    0x2c58(%rip),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
movsbl -0x21(%rbp),%ecx
call   10e0 <mvwaddch@plt>
mov    -0x21(%rbp),%al
add    $0x1,%al
mov    %al,-0x21(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x39,%eax
jle    13b3 <main+0x1c3>
movb   $0x30,-0x21(%rbp)
jmp    13b8 <main+0x1c8>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    136a <main+0x17a>
jmp    13cb <main+0x1db>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    134c <main+0x15c>
mov    $0x0,%al
call   10a0 <refresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    -0x10(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    -0x10(%rbp),%rdi
call   1030 <touchwin@plt>
mov    -0x10(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    $0xa,%edi
mov    $0x14,%esi
mov    $0x8,%ecx
mov    %ecx,%edx
call   1060 <newwin@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x7c,%esi
mov    $0x2d,%edx
call   1070 <box@plt>
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
mov    $0x2,%edx
lea    0xba5(%rip),%rcx
lea    0xbf8(%rip),%r8
call   10d0 <mvwprintw@plt>
mov    -0x18(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    -0x10(%rbp),%rdi
call   1030 <touchwin@plt>
mov    -0x10(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    -0x10(%rbp),%rdi
call   10c0 <wclear@plt>
mov    -0x10(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    -0x10(%rbp),%rdi
call   1080 <delwin@plt>
mov    -0x18(%rbp),%rdi
call   1030 <touchwin@plt>
mov    -0x18(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    -0x18(%rbp),%rdi
call   1080 <delwin@plt>
mov    0x2af9(%rip),%rax
mov    (%rax),%rdi
call   1030 <touchwin@plt>
mov    $0x0,%al
call   10a0 <refresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    $0x0,%al
call   10b0 <endwin@plt>
mov    0x2aba(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <initscr@plt>
mov    $0x5,%edi
mov    $0x5,%esi
call   1110 <move@plt>
lea    0xde5(%rip),%rdi
lea    0xde1(%rip),%rsi
call   1090 <printw@plt>
xor    %eax,%eax
call   10a0 <refresh@plt>
mov    0x2db3(%rip),%rax
mov    (%rax),%edx
cmp    $0x2,%edx
jl     12b8 <main+0xc8>
mov    0x2d95(%rip),%r15
mov    (%r15),%ecx
mov    $0x61,%al
mov    0x2d91(%rip),%r13
mov    $0x61,%r12d
jmp    126c <main+0x7c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14d
lea    -0x1(%rdx),%esi
cmp    %esi,%r14d
jge    12b8 <main+0xc8>
cmp    $0x2,%ecx
jl     1260 <main+0x70>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x0(%r13),%rdi
movsbl %al,%ebx
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   10e0 <mvwaddch@plt>
add    $0x1,%bl
cmp    $0x7b,%bl
movzbl %bl,%eax
cmovge %r12d,%eax
add    $0x1,%ebp
mov    (%r15),%ecx
lea    -0x1(%rcx),%edx
cmp    %edx,%ebp
jl     1280 <main+0x90>
mov    0x2d34(%rip),%rdx
mov    (%rdx),%edx
jmp    1260 <main+0x70>
xor    %r15d,%r15d
xor    %eax,%eax
call   10a0 <refresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    $0xa,%edi
mov    $0x14,%esi
mov    $0x5,%edx
mov    $0x5,%ecx
call   1060 <newwin@plt>
mov    %rax,%rbp
lea    0xd11(%rip),%rbx
lea    0xd26(%rip),%r8
mov    %rax,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    %rbx,%rcx
call   10d0 <mvwprintw@plt>
lea    0xd16(%rip),%r8
mov    %rbp,%rdi
mov    $0x5,%esi
mov    $0x2,%edx
mov    %rbx,%rcx
call   10d0 <mvwprintw@plt>
mov    %rbp,(%rsp)
mov    %rbp,%rdi
call   1040 <wrefresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    0x2ca4(%rip),%rax
mov    (%rax),%edx
cmp    $0x2,%edx
jl     13cb <main+0x1db>
mov    0x2c82(%rip),%r13
mov    0x0(%r13),%ecx
mov    $0x30,%al
mov    0x2c7d(%rip),%r14
mov    $0x30,%r12d
jmp    137c <main+0x18c>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15d
lea    -0x1(%rdx),%esi
cmp    %esi,%r15d
jge    13cb <main+0x1db>
cmp    $0x2,%ecx
jl     1370 <main+0x180>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14),%rdi
movsbl %al,%ebp
mov    %r15d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
call   10e0 <mvwaddch@plt>
add    $0x1,%bpl
cmp    $0x3a,%bpl
movzbl %bpl,%eax
cmovge %r12d,%eax
add    $0x1,%ebx
mov    0x0(%r13),%ecx
lea    -0x1(%rcx),%edx
cmp    %edx,%ebx
jl     1390 <main+0x1a0>
mov    0x2c21(%rip),%rdx
mov    (%rdx),%edx
jmp    1370 <main+0x180>
xor    %eax,%eax
call   10a0 <refresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    (%rsp),%rbx
mov    %rbx,%rdi
call   1040 <wrefresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    %rbx,%rdi
call   1030 <touchwin@plt>
mov    %rbx,%rdi
call   1040 <wrefresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    $0xa,%edi
mov    $0x14,%esi
mov    $0x8,%edx
mov    $0x8,%ecx
call   1060 <newwin@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    $0x7c,%esi
mov    $0x2d,%edx
call   1070 <box@plt>
lea    0xbbf(%rip),%rcx
lea    0xc12(%rip),%r8
mov    %rbp,%rdi
mov    $0x5,%esi
mov    $0x2,%edx
call   10d0 <mvwprintw@plt>
mov    %rbp,%rdi
call   1040 <wrefresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    %rbx,%rdi
call   1030 <touchwin@plt>
mov    %rbx,%rdi
call   1040 <wrefresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    %rbx,%rdi
call   10c0 <wclear@plt>
mov    %rbx,%rdi
call   1040 <wrefresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    %rbx,%rdi
call   1080 <delwin@plt>
mov    %rbp,%rdi
call   1030 <touchwin@plt>
mov    %rbp,%rdi
call   1040 <wrefresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
mov    %rbp,%rdi
call   1080 <delwin@plt>
mov    0x2b0f(%rip),%rax
mov    (%rax),%rdi
call   1030 <touchwin@plt>
xor    %eax,%eax
call   10a0 <refresh@plt>
mov    $0x2,%edi
call   1100 <sleep@plt>
xor    %eax,%eax
call   10b0 <endwin@plt>
mov    0x2ad0(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [25 x i8] c"Testing multiple windows\00"
@LINES = global i32 0
@COLS = global i32 0
@stdscr = global i32* null
@.str.2 = [12 x i8] c"Hello World\00"
@.str.3 = [50 x i8] c"Notice how very long lines wrap inside the window\00"
@.str.4 = [15 x i8] c"Pop Up window!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 0, i32* %1
store i8 97, i8* %6
%7 = call i32 (...) @initscr()
%8 = call i32 @move(i32 5, i32 5)
%9 = call i32 @printw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (...) @refresh()
store i32 0, i32* %5
br label %11
11: ; preds = %39, %0
%12 = load i32, i32* %5
%13 = load i32, i32* @LINES
%14 = sub nsw i32 %13, 1
%15 = icmp slt i32 %12, %14
br i1 %15, label %16, label %42
16: ; preds = %11
store i32 0, i32* %4
br label %17
17: ; preds = %35, %16
%18 = load i32, i32* %4
%19 = load i32, i32* @COLS
%20 = sub nsw i32 %19, 1
%21 = icmp slt i32 %18, %20
br i1 %21, label %22, label %38
22: ; preds = %17
%23 = load i32*, i32** @stdscr
%24 = load i32, i32* %5
%25 = load i32, i32* %4
%26 = load i8, i8* %6
%27 = call i32 @mvwaddch(i32* %23, i32 %24, i32 %25, i8 signext %26)
%28 = load i8, i8* %6
%29 = add i8 %28, 1
store i8 %29, i8* %6
%30 = load i8, i8* %6
%31 = sext i8 %30 to i32
%32 = icmp sgt i32 %31, 122
br i1 %32, label %33, label %34
33: ; preds = %22
store i8 97, i8* %6
br label %34
34: ; preds = %33, %22
br label %35
35: ; preds = %34
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %17
38: ; preds = %17
br label %39
39: ; preds = %38
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %11
42: ; preds = %11
%43 = call i32 (...) @refresh()
%44 = call i32 @sleep(i32 2)
%45 = call i32* @newwin(i32 10, i32 20, i32 5, i32 5)
store i32* %45, i32** %2
%46 = load i32*, i32** %2
%47 = call i32 @mvwprintw(i32* %46, i32 2, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%48 = load i32*, i32** %2
%49 = call i32 @mvwprintw(i32* %48, i32 5, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
%50 = load i32*, i32** %2
%51 = call i32 @wrefresh(i32* %50)
%52 = call i32 @sleep(i32 2)
store i8 48, i8* %6
store i32 0, i32* %5
br label %53
53: ; preds = %81, %42
%54 = load i32, i32* %5
%55 = load i32, i32* @LINES
%56 = sub nsw i32 %55, 1
%57 = icmp slt i32 %54, %56
br i1 %57, label %58, label %84
58: ; preds = %53
store i32 0, i32* %4
br label %59
59: ; preds = %77, %58
%60 = load i32, i32* %4
%61 = load i32, i32* @COLS
%62 = sub nsw i32 %61, 1
%63 = icmp slt i32 %60, %62
br i1 %63, label %64, label %80
64: ; preds = %59
%65 = load i32*, i32** @stdscr
%66 = load i32, i32* %5
%67 = load i32, i32* %4
%68 = load i8, i8* %6
%69 = call i32 @mvwaddch(i32* %65, i32 %66, i32 %67, i8 signext %68)
%70 = load i8, i8* %6
%71 = add i8 %70, 1
store i8 %71, i8* %6
%72 = load i8, i8* %6
%73 = sext i8 %72 to i32
%74 = icmp sgt i32 %73, 57
br i1 %74, label %75, label %76
75: ; preds = %64
store i8 48, i8* %6
br label %76
76: ; preds = %75, %64
br label %77
77: ; preds = %76
%78 = load i32, i32* %4
%79 = add nsw i32 %78, 1
store i32 %79, i32* %4
br label %59
80: ; preds = %59
br label %81
81: ; preds = %80
%82 = load i32, i32* %5
%83 = add nsw i32 %82, 1
store i32 %83, i32* %5
br label %53
84: ; preds = %53
%85 = call i32 (...) @refresh()
%86 = call i32 @sleep(i32 2)
%87 = load i32*, i32** %2
%88 = call i32 @wrefresh(i32* %87)
%89 = call i32 @sleep(i32 2)
%90 = load i32*, i32** %2
%91 = call i32 @touchwin(i32* %90)
%92 = load i32*, i32** %2
%93 = call i32 @wrefresh(i32* %92)
%94 = call i32 @sleep(i32 2)
%95 = call i32* @newwin(i32 10, i32 20, i32 8, i32 8)
store i32* %95, i32** %3
%96 = load i32*, i32** %3
%97 = call i32 @box(i32* %96, i8 signext 124, i8 signext 45)
%98 = load i32*, i32** %3
%99 = call i32 @mvwprintw(i32* %98, i32 5, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%100 = load i32*, i32** %3
%101 = call i32 @wrefresh(i32* %100)
%102 = call i32 @sleep(i32 2)
%103 = load i32*, i32** %2
%104 = call i32 @touchwin(i32* %103)
%105 = load i32*, i32** %2
%106 = call i32 @wrefresh(i32* %105)
%107 = call i32 @sleep(i32 2)
%108 = load i32*, i32** %2
%109 = call i32 @wclear(i32* %108)
%110 = load i32*, i32** %2
%111 = call i32 @wrefresh(i32* %110)
%112 = call i32 @sleep(i32 2)
%113 = load i32*, i32** %2
%114 = call i32 @delwin(i32* %113)
%115 = load i32*, i32** %3
%116 = call i32 @touchwin(i32* %115)
%117 = load i32*, i32** %3
%118 = call i32 @wrefresh(i32* %117)
%119 = call i32 @sleep(i32 2)
%120 = load i32*, i32** %3
%121 = call i32 @delwin(i32* %120)
%122 = load i32*, i32** @stdscr
%123 = call i32 @touchwin(i32* %122)
%124 = call i32 (...) @refresh()
%125 = call i32 @sleep(i32 2)
%126 = call i32 (...) @endwin()
%127 = load i32, i32* @EXIT_SUCCESS
%128 = call i32 @exit(i32 %127)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [25 x i8] c"Testing multiple windows\00"
@LINES = global i32 0
@COLS = global i32 0
@stdscr = global i32* null
@.str.2 = [12 x i8] c"Hello World\00"
@.str.3 = [50 x i8] c"Notice how very long lines wrap inside the window\00"
@.str.4 = [15 x i8] c"Pop Up window!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 @move(i32 5, i32 5)
%3 = tail call i32 @printw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @refresh()
%5 = load i32, i32* @LINES
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %36
7: ; preds = %0
%8 = load i32, i32* @COLS
br label %9
9: ; preds = %7, %29
%10 = phi i32 [ %30, %29 ], [ %5, %7 ]
%11 = phi i32 [ %31, %29 ], [ %8, %7 ]
%12 = phi i8 [ %32, %29 ], [ 97, %7 ]
%13 = phi i32 [ %33, %29 ], [ 0, %7 ]
%14 = icmp sgt i32 %11, 1
br i1 %14, label %15, label %29
15: ; preds = %9, %15
%16 = phi i8 [ %22, %15 ], [ %12, %9 ]
%17 = phi i32 [ %23, %15 ], [ 0, %9 ]
%18 = load i32*, i32** @stdscr
%19 = tail call i32 @mvwaddch(i32* %18, i32 %13, i32 %17, i8 signext %16)
%20 = add i8 %16, 1
%21 = icmp sgt i8 %20, 122
%22 = select i1 %21, i8 97, i8 %20
%23 = add nuw nsw i32 %17, 1
%24 = load i32, i32* @COLS
%25 = add nsw i32 %24, -1
%26 = icmp slt i32 %23, %25
br i1 %26, label %15, label %27
27: ; preds = %15
%28 = load i32, i32* @LINES
br label %29
29: ; preds = %27, %9
%30 = phi i32 [ %10, %9 ], [ %28, %27 ]
%31 = phi i32 [ %11, %9 ], [ %24, %27 ]
%32 = phi i8 [ %12, %9 ], [ %22, %27 ]
%33 = add nuw nsw i32 %13, 1
%34 = add nsw i32 %30, -1
%35 = icmp slt i32 %33, %34
br i1 %35, label %9, label %36
36: ; preds = %29, %0
%37 = tail call i32 (...) @refresh()
%38 = tail call i32 @sleep(i32 2)
%39 = tail call i32* @newwin(i32 10, i32 20, i32 5, i32 5)
%40 = tail call i32 @mvwprintw(i32* %39, i32 2, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%41 = tail call i32 @mvwprintw(i32* %39, i32 5, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
%42 = tail call i32 @wrefresh(i32* %39)
%43 = tail call i32 @sleep(i32 2)
%44 = load i32, i32* @LINES
%45 = icmp sgt i32 %44, 1
br i1 %45, label %46, label %75
46: ; preds = %36
%47 = load i32, i32* @COLS
br label %48
48: ; preds = %46, %68
%49 = phi i32 [ %69, %68 ], [ %44, %46 ]
%50 = phi i32 [ %70, %68 ], [ %47, %46 ]
%51 = phi i8 [ %71, %68 ], [ 48, %46 ]
%52 = phi i32 [ %72, %68 ], [ 0, %46 ]
%53 = icmp sgt i32 %50, 1
br i1 %53, label %54, label %68
54: ; preds = %48, %54
%55 = phi i8 [ %61, %54 ], [ %51, %48 ]
%56 = phi i32 [ %62, %54 ], [ 0, %48 ]
%57 = load i32*, i32** @stdscr
%58 = tail call i32 @mvwaddch(i32* %57, i32 %52, i32 %56, i8 signext %55)
%59 = add i8 %55, 1
%60 = icmp sgt i8 %59, 57
%61 = select i1 %60, i8 48, i8 %59
%62 = add nuw nsw i32 %56, 1
%63 = load i32, i32* @COLS
%64 = add nsw i32 %63, -1
%65 = icmp slt i32 %62, %64
br i1 %65, label %54, label %66
66: ; preds = %54
%67 = load i32, i32* @LINES
br label %68
68: ; preds = %66, %48
%69 = phi i32 [ %49, %48 ], [ %67, %66 ]
%70 = phi i32 [ %50, %48 ], [ %63, %66 ]
%71 = phi i8 [ %51, %48 ], [ %61, %66 ]
%72 = add nuw nsw i32 %52, 1
%73 = add nsw i32 %69, -1
%74 = icmp slt i32 %72, %73
br i1 %74, label %48, label %75
75: ; preds = %68, %36
%76 = tail call i32 (...) @refresh()
%77 = tail call i32 @sleep(i32 2)
%78 = tail call i32 @wrefresh(i32* %39)
%79 = tail call i32 @sleep(i32 2)
%80 = tail call i32 @touchwin(i32* %39)
%81 = tail call i32 @wrefresh(i32* %39)
%82 = tail call i32 @sleep(i32 2)
%83 = tail call i32* @newwin(i32 10, i32 20, i32 8, i32 8)
%84 = tail call i32 @box(i32* %83, i8 signext 124, i8 signext 45)
%85 = tail call i32 @mvwprintw(i32* %83, i32 5, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%86 = tail call i32 @wrefresh(i32* %83)
%87 = tail call i32 @sleep(i32 2)
%88 = tail call i32 @touchwin(i32* %39)
%89 = tail call i32 @wrefresh(i32* %39)
%90 = tail call i32 @sleep(i32 2)
%91 = tail call i32 @wclear(i32* %39)
%92 = tail call i32 @wrefresh(i32* %39)
%93 = tail call i32 @sleep(i32 2)
%94 = tail call i32 @delwin(i32* %39)
%95 = tail call i32 @touchwin(i32* %83)
%96 = tail call i32 @wrefresh(i32* %83)
%97 = tail call i32 @sleep(i32 2)
%98 = tail call i32 @delwin(i32* %83)
%99 = load i32*, i32** @stdscr
%100 = tail call i32 @touchwin(i32* %99)
%101 = tail call i32 (...) @refresh()
%102 = tail call i32 @sleep(i32 2)
%103 = tail call i32 (...) @endwin()
%104 = load i32, i32* @EXIT_SUCCESS
%105 = tail call i32 @exit(i32 %104)
unreachable
}