#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*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
int main(void) {
  WINDOW *form_win;
  int x = 10, y = 10;
  initscr();
  cbreak();
  refresh();
  form_win = newwin(4, x + 4, 5, 5);
  box(form_win, 0, 0);
  wrefresh(form_win);
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1080 <refresh@plt>
mov    -0x14(%rbp),%esi
add    $0x4,%esi
mov    $0x4,%edi
mov    $0x5,%ecx
mov    %ecx,%edx
call   1060 <newwin@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <box@plt>
mov    -0x10(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    $0x0,%al
call   1080 <refresh@plt>
mov    $0x0,%al
call   1090 <getch@plt>
mov    $0x0,%al
call   10a0 <endwin@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1080 <refresh@plt>
mov    $0x4,%edi
mov    $0xe,%esi
mov    $0x5,%edx
mov    $0x5,%ecx
call   1060 <newwin@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <box@plt>
mov    %rbx,%rdi
call   1040 <wrefresh@plt>
xor    %eax,%eax
call   1080 <refresh@plt>
xor    %eax,%eax
call   1090 <getch@plt>
xor    %eax,%eax
call   10a0 <endwin@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %3
store i32 10, i32* %4
%5 = call i32 (...) @initscr()
%6 = call i32 (...) @cbreak()
%7 = call i32 (...) @refresh()
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 4
%10 = call i32* @newwin(i32 4, i32 %9, i32 5, i32 5)
store i32* %10, i32** %2
%11 = load i32*, i32** %2
%12 = call i32 @box(i32* %11, i32 0, i32 0)
%13 = load i32*, i32** %2
%14 = call i32 @wrefresh(i32* %13)
%15 = call i32 (...) @refresh()
%16 = call i32 (...) @getch()
%17 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @refresh()
%4 = tail call i32* @newwin(i32 4, i32 14, i32 5, i32 5)
%5 = tail call i32 @box(i32* %4, i32 0, i32 0)
%6 = tail call i32 @wrefresh(i32* %4)
%7 = tail call i32 (...) @refresh()
%8 = tail call i32 (...) @getch()
%9 = tail call i32 (...) @endwin()
ret i32 0
}