#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*/ TRUE;
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int, char *);
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ *subwin(int /*<<< orphan*/ *, int, int, int, int);
int /*<<< orphan*/ touchwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
int main() {
  initscr();
  raw();
  noecho();
  keypad(stdscr, TRUE);
  refresh();
  WINDOW *win = newwin(20, 20, 5, 5);
  mvwprintw(win, 1, 3, "hehe");
  mvwprintw(win, 0, 0, "+");
  for (int i = 1; i < 19; ++i)
    mvwprintw(win, 0, i, "-");
  mvwprintw(win, 0, 19, "+");
  for (int i = 1; i < 19; ++i)
    mvwprintw(win, i, 0, "|");
  for (int i = 1; i < 19; ++i)
    mvwprintw(win, i, 19, "|");
  mvwprintw(win, 19, 19, "+");
  mvwprintw(win, 19, 0, "+");
  for (int i = 1; i < 19; ++i)
    mvwprintw(win, 19, i, "-");
  wrefresh(win);
  getch();
  WINDOW *sub_win = subwin(win, 4, 4, 2, 2);
  mvwprintw(sub_win, 0, 0, "ok");
  touchwin(win);
  wrefresh(sub_win);
  getch();
  delwin(sub_win);
  delwin(win);
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   1070 <raw@plt>
mov    $0x0,%al
call   10f0 <noecho@plt>
mov    0x2ded(%rip),%rax
mov    (%rax),%edi
mov    0x2ddc(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
mov    $0x0,%al
call   10b0 <refresh@plt>
mov    $0x14,%esi
mov    $0x5,%ecx
mov    %esi,%edi
mov    %ecx,%edx
call   1090 <newwin@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
lea    0xdc2(%rip),%rcx
call   10e0 <mvwprintw@plt>
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
lea    0xdb5(%rip),%rcx
mov    %edx,%esi
call   10e0 <mvwprintw@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0x13,-0x14(%rbp)
jge    128b <main+0xbb>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
lea    0xd8f(%rip),%rcx
call   10e0 <mvwprintw@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    125e <main+0x8e>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x13,%edx
lea    0xd68(%rip),%rcx
call   10e0 <mvwprintw@plt>
movl   $0x1,-0x18(%rbp)
cmpl   $0x13,-0x18(%rbp)
jge    12d6 <main+0x106>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
xor    %edx,%edx
lea    0xd46(%rip),%rcx
call   10e0 <mvwprintw@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12a9 <main+0xd9>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x13,-0x1c(%rbp)
jge    130d <main+0x13d>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    $0x13,%edx
lea    0xd0f(%rip),%rcx
call   10e0 <mvwprintw@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12dd <main+0x10d>
mov    -0x10(%rbp),%rdi
mov    $0x13,%edx
lea    0xce8(%rip),%rcx
mov    %edx,%esi
call   10e0 <mvwprintw@plt>
mov    -0x10(%rbp),%rdi
mov    $0x13,%esi
xor    %edx,%edx
lea    0xccf(%rip),%rcx
call   10e0 <mvwprintw@plt>
movl   $0x1,-0x20(%rbp)
cmpl   $0x13,-0x20(%rbp)
jge    1372 <main+0x1a2>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%edx
mov    $0x13,%esi
lea    0xca8(%rip),%rcx
call   10e0 <mvwprintw@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1342 <main+0x172>
mov    -0x10(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    $0x0,%al
call   10c0 <getch@plt>
mov    -0x10(%rbp),%rdi
mov    $0x4,%edx
mov    $0x2,%r8d
mov    %edx,%esi
mov    %r8d,%ecx
call   1080 <subwin@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
xor    %edx,%edx
lea    0xc5f(%rip),%rcx
mov    %edx,%esi
call   10e0 <mvwprintw@plt>
mov    -0x10(%rbp),%rdi
call   1030 <touchwin@plt>
mov    -0x28(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    $0x0,%al
call   10c0 <getch@plt>
mov    -0x28(%rbp),%rdi
call   10a0 <delwin@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <delwin@plt>
mov    $0x0,%al
call   10d0 <endwin@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <initscr@plt>
xor    %eax,%eax
call   1070 <raw@plt>
xor    %eax,%eax
call   10f0 <noecho@plt>
mov    0x2df4(%rip),%rax
mov    (%rax),%edi
mov    0x2de3(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
xor    %eax,%eax
call   10b0 <refresh@plt>
mov    $0x14,%edi
mov    $0x14,%esi
mov    $0x5,%edx
mov    $0x5,%ecx
call   1090 <newwin@plt>
mov    %rax,%rbx
lea    0xdd2(%rip),%rcx
mov    %rax,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   10e0 <mvwprintw@plt>
lea    0xdbe(%rip),%r15
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    %r15,%rcx
call   10e0 <mvwprintw@plt>
lea    0xdaa(%rip),%r14
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x6,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x7,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xb,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xc,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xd,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xe,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xf,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x11,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x12,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x13,%edx
mov    %r15,%rcx
call   10e0 <mvwprintw@plt>
lea    0xc4f(%rip),%r12
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x12,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x12,%esi
mov    $0x13,%edx
mov    %r12,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0x13,%edx
mov    %r15,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
xor    %edx,%edx
mov    %r15,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0x2,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0x3,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0x4,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0x5,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0x6,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0x7,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0x8,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0x9,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0xa,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0xb,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0xc,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0xd,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0xe,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0xf,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0x10,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0x11,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
mov    $0x12,%edx
mov    %r14,%rcx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
call   1040 <wrefresh@plt>
xor    %eax,%eax
call   10c0 <getch@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
call   1080 <subwin@plt>
mov    %rax,%r14
lea    0x7bc(%rip),%rcx
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10e0 <mvwprintw@plt>
mov    %rbx,%rdi
call   1030 <touchwin@plt>
mov    %r14,%rdi
call   1040 <wrefresh@plt>
xor    %eax,%eax
call   10c0 <getch@plt>
mov    %r14,%rdi
call   10a0 <delwin@plt>
mov    %rbx,%rdi
call   10a0 <delwin@plt>
xor    %eax,%eax
call   10d0 <endwin@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@.str = [5 x i8] c"hehe\00"
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [2 x i8] c"-\00"
@.str.3 = [2 x i8] c"|\00"
@.str.4 = [3 x i8] c"ok\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 0, i32* %1
%8 = call i32 (...) @initscr()
%9 = call i32 (...) @raw()
%10 = call i32 (...) @noecho()
%11 = load i32, i32* @stdscr
%12 = load i32, i32* @TRUE
%13 = call i32 @keypad(i32 %11, i32 %12)
%14 = call i32 (...) @refresh()
%15 = call i32* @newwin(i32 20, i32 20, i32 5, i32 5)
store i32* %15, i32** %2
%16 = load i32*, i32** %2
%17 = call i32 @mvwprintw(i32* %16, i32 1, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = load i32*, i32** %2
%19 = call i32 @mvwprintw(i32* %18, i32 0, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %20
20: ; preds = %27, %0
%21 = load i32, i32* %3
%22 = icmp slt i32 %21, 19
br i1 %22, label %23, label %30
23: ; preds = %20
%24 = load i32*, i32** %2
%25 = load i32, i32* %3
%26 = call i32 @mvwprintw(i32* %24, i32 0, i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %23
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %20
30: ; preds = %20
%31 = load i32*, i32** %2
%32 = call i32 @mvwprintw(i32* %31, i32 0, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %4
br label %33
33: ; preds = %40, %30
%34 = load i32, i32* %4
%35 = icmp slt i32 %34, 19
br i1 %35, label %36, label %43
36: ; preds = %33
%37 = load i32*, i32** %2
%38 = load i32, i32* %4
%39 = call i32 @mvwprintw(i32* %37, i32 %38, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %40
40: ; preds = %36
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %4
br label %33
43: ; preds = %33
store i32 1, i32* %5
br label %44
44: ; preds = %51, %43
%45 = load i32, i32* %5
%46 = icmp slt i32 %45, 19
br i1 %46, label %47, label %54
47: ; preds = %44
%48 = load i32*, i32** %2
%49 = load i32, i32* %5
%50 = call i32 @mvwprintw(i32* %48, i32 %49, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %51
51: ; preds = %47
%52 = load i32, i32* %5
%53 = add nsw i32 %52, 1
store i32 %53, i32* %5
br label %44
54: ; preds = %44
%55 = load i32*, i32** %2
%56 = call i32 @mvwprintw(i32* %55, i32 19, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%57 = load i32*, i32** %2
%58 = call i32 @mvwprintw(i32* %57, i32 19, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %6
br label %59
59: ; preds = %66, %54
%60 = load i32, i32* %6
%61 = icmp slt i32 %60, 19
br i1 %61, label %62, label %69
62: ; preds = %59
%63 = load i32*, i32** %2
%64 = load i32, i32* %6
%65 = call i32 @mvwprintw(i32* %63, i32 19, i32 %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %66
66: ; preds = %62
%67 = load i32, i32* %6
%68 = add nsw i32 %67, 1
store i32 %68, i32* %6
br label %59
69: ; preds = %59
%70 = load i32*, i32** %2
%71 = call i32 @wrefresh(i32* %70)
%72 = call i32 (...) @getch()
%73 = load i32*, i32** %2
%74 = call i32* @subwin(i32* %73, i32 4, i32 4, i32 2, i32 2)
store i32* %74, i32** %7
%75 = load i32*, i32** %7
%76 = call i32 @mvwprintw(i32* %75, i32 0, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%77 = load i32*, i32** %2
%78 = call i32 @touchwin(i32* %77)
%79 = load i32*, i32** %7
%80 = call i32 @wrefresh(i32* %79)
%81 = call i32 (...) @getch()
%82 = load i32*, i32** %7
%83 = call i32 @delwin(i32* %82)
%84 = load i32*, i32** %2
%85 = call i32 @delwin(i32* %84)
%86 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@.str = [5 x i8] c"hehe\00"
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [2 x i8] c"-\00"
@.str.3 = [2 x i8] c"|\00"
@.str.4 = [3 x i8] c"ok\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @raw()
%3 = tail call i32 (...) @noecho()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = tail call i32 @keypad(i32 %4, i32 %5)
%7 = tail call i32 (...) @refresh()
%8 = tail call i32* @newwin(i32 20, i32 20, i32 5, i32 5)
%9 = tail call i32 @mvwprintw(i32* %8, i32 1, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%14 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%16 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%17 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%18 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%20 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%21 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%22 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%23 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%24 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%25 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%26 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%27 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%28 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%29 = tail call i32 @mvwprintw(i32* %8, i32 0, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%30 = tail call i32 @mvwprintw(i32* %8, i32 1, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%31 = tail call i32 @mvwprintw(i32* %8, i32 2, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%32 = tail call i32 @mvwprintw(i32* %8, i32 3, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%33 = tail call i32 @mvwprintw(i32* %8, i32 4, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%34 = tail call i32 @mvwprintw(i32* %8, i32 5, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%35 = tail call i32 @mvwprintw(i32* %8, i32 6, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%36 = tail call i32 @mvwprintw(i32* %8, i32 7, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%37 = tail call i32 @mvwprintw(i32* %8, i32 8, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%38 = tail call i32 @mvwprintw(i32* %8, i32 9, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%39 = tail call i32 @mvwprintw(i32* %8, i32 10, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%40 = tail call i32 @mvwprintw(i32* %8, i32 11, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%41 = tail call i32 @mvwprintw(i32* %8, i32 12, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%42 = tail call i32 @mvwprintw(i32* %8, i32 13, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%43 = tail call i32 @mvwprintw(i32* %8, i32 14, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%44 = tail call i32 @mvwprintw(i32* %8, i32 15, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%45 = tail call i32 @mvwprintw(i32* %8, i32 16, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%46 = tail call i32 @mvwprintw(i32* %8, i32 17, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%47 = tail call i32 @mvwprintw(i32* %8, i32 18, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%48 = tail call i32 @mvwprintw(i32* %8, i32 1, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%49 = tail call i32 @mvwprintw(i32* %8, i32 2, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%50 = tail call i32 @mvwprintw(i32* %8, i32 3, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%51 = tail call i32 @mvwprintw(i32* %8, i32 4, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%52 = tail call i32 @mvwprintw(i32* %8, i32 5, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%53 = tail call i32 @mvwprintw(i32* %8, i32 6, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%54 = tail call i32 @mvwprintw(i32* %8, i32 7, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%55 = tail call i32 @mvwprintw(i32* %8, i32 8, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%56 = tail call i32 @mvwprintw(i32* %8, i32 9, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%57 = tail call i32 @mvwprintw(i32* %8, i32 10, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%58 = tail call i32 @mvwprintw(i32* %8, i32 11, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%59 = tail call i32 @mvwprintw(i32* %8, i32 12, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%60 = tail call i32 @mvwprintw(i32* %8, i32 13, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%61 = tail call i32 @mvwprintw(i32* %8, i32 14, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%62 = tail call i32 @mvwprintw(i32* %8, i32 15, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%63 = tail call i32 @mvwprintw(i32* %8, i32 16, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%64 = tail call i32 @mvwprintw(i32* %8, i32 17, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%65 = tail call i32 @mvwprintw(i32* %8, i32 18, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%66 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%67 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%68 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%69 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%70 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%71 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%72 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%73 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%74 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%75 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%76 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%77 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%78 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%79 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%80 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%81 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%82 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%83 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%84 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%85 = tail call i32 @mvwprintw(i32* %8, i32 19, i32 18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%86 = tail call i32 @wrefresh(i32* %8)
%87 = tail call i32 (...) @getch()
%88 = tail call i32* @subwin(i32* %8, i32 4, i32 4, i32 2, i32 2)
%89 = tail call i32 @mvwprintw(i32* %88, i32 0, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%90 = tail call i32 @touchwin(i32* %8)
%91 = tail call i32 @wrefresh(i32* %88)
%92 = tail call i32 (...) @getch()
%93 = tail call i32 @delwin(i32* %88)
%94 = tail call i32 @delwin(i32* %8)
%95 = tail call i32 (...) @endwin()
ret i32 0
}