#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*/ COLOR_RED;
int /*<<< orphan*/ COLS;
int LINES;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ *create_newwin(int, int /*<<< orphan*/, int,
                                  int /*<<< orphan*/);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ init_color(int /*<<< orphan*/, int, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ wborder(int /*<<< orphan*/ *, char, char, char, char, char,
                           char, char, char);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void init_ui(char *pname) {
  WINDOW *win;
  WINDOW *win2;
  WINDOW *win3;
  WINDOW *win4;
  initscr();
  raw();
  keypad(stdscr, TRUE);
  noecho();
  init_color(COLOR_RED, 700, 0, 0);
  win = create_newwin(1, COLS, 0, 0);
  win2 = create_newwin(LINES - 3, COLS, 1, 0);
  win3 = create_newwin(1, COLS, LINES - 2, 0);
  win4 = create_newwin(1, COLS, LINES - 1, 0);
  wborder(win3, '-', '-', '-', '-', '-', '-', '-', '-');
  wrefresh(win3);
  wborder(win4, '|', '|', '-', '-', '+', '+', '+', '+');
  wrefresh(win4);
  refresh();
  getch();
  endwin();
}


x86 assembly (clang, -O0):
<init_ui>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1070 <initscr@plt>
mov    $0x0,%al
call   1080 <raw@plt>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
mov    0x2dfe(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
mov    $0x0,%al
call   10c0 <noecho@plt>
mov    0x2dd1(%rip),%rax
mov    (%rax),%edi
mov    $0x2bc,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    0x2dca(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
xor    %ecx,%ecx
mov    %ecx,%edx
call   10d0 <create_newwin@plt>
mov    %rax,-0x10(%rbp)
mov    0x2dc7(%rip),%rax
mov    (%rax),%edi
sub    $0x3,%edi
mov    0x2da3(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   10d0 <create_newwin@plt>
mov    %rax,-0x18(%rbp)
mov    0x2d8a(%rip),%rax
mov    (%rax),%esi
mov    0x2d99(%rip),%rax
mov    (%rax),%edx
sub    $0x2,%edx
mov    $0x1,%edi
xor    %ecx,%ecx
call   10d0 <create_newwin@plt>
mov    %rax,-0x20(%rbp)
mov    0x2d65(%rip),%rax
mov    (%rax),%esi
mov    0x2d74(%rip),%rax
mov    (%rax),%edx
sub    $0x1,%edx
mov    $0x1,%edi
xor    %ecx,%ecx
call   10d0 <create_newwin@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x2d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x2d,(%rsp)
movl   $0x2d,0x8(%rsp)
movl   $0x2d,0x10(%rsp)
call   1040 <wborder@plt>
mov    -0x20(%rbp),%rdi
call   1050 <wrefresh@plt>
mov    -0x28(%rbp),%rdi
mov    $0x7c,%edx
mov    $0x2d,%r8d
mov    $0x2b,%r9d
mov    %edx,%esi
mov    %r8d,%ecx
movl   $0x2b,(%rsp)
movl   $0x2b,0x8(%rsp)
movl   $0x2b,0x10(%rsp)
call   1040 <wborder@plt>
mov    -0x28(%rbp),%rdi
call   1050 <wrefresh@plt>
mov    $0x0,%al
call   1090 <refresh@plt>
mov    $0x0,%al
call   10a0 <getch@plt>
mov    $0x0,%al
call   10b0 <endwin@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_ui>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1070 <initscr@plt>
xor    %eax,%eax
call   1080 <raw@plt>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
mov    0x2e05(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
xor    %eax,%eax
call   10c0 <noecho@plt>
mov    0x2dd8(%rip),%rax
mov    (%rax),%edi
mov    $0x2bc,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    0x2dd1(%rip),%r14
mov    (%r14),%esi
mov    $0x1,%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   10d0 <create_newwin@plt>
mov    0x2dd1(%rip),%r15
mov    (%r15),%edi
add    $0xfffffffd,%edi
mov    (%r14),%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   10d0 <create_newwin@plt>
mov    (%r14),%esi
mov    (%r15),%edx
add    $0xfffffffe,%edx
mov    $0x1,%edi
xor    %ecx,%ecx
call   10d0 <create_newwin@plt>
mov    %rax,%rbx
mov    (%r14),%esi
mov    (%r15),%edx
add    $0xffffffff,%edx
mov    $0x1,%edi
xor    %ecx,%ecx
call   10d0 <create_newwin@plt>
mov    %rax,%r14
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    $0x2d,%esi
mov    $0x2d,%edx
mov    $0x2d,%ecx
mov    $0x2d,%r8d
mov    $0x2d,%r9d
push   $0x2d
push   $0x2d
push   $0x2d
call   1040 <wborder@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
call   1050 <wrefresh@plt>
sub    $0x8,%rsp
mov    %r14,%rdi
mov    $0x7c,%esi
mov    $0x7c,%edx
mov    $0x2d,%ecx
mov    $0x2d,%r8d
mov    $0x2b,%r9d
push   $0x2b
push   $0x2b
push   $0x2b
call   1040 <wborder@plt>
add    $0x20,%rsp
mov    %r14,%rdi
call   1050 <wrefresh@plt>
xor    %eax,%eax
call   1090 <refresh@plt>
xor    %eax,%eax
call   10a0 <getch@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    10b0 <endwin@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_RED = global i32 0
@COLS = global i32 0
@LINES = global i32 0
define void @init_ui(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %2
%7 = call i32 (...) @initscr()
%8 = call i32 (...) @raw()
%9 = load i32, i32* @stdscr
%10 = load i32, i32* @TRUE
%11 = call i32 @keypad(i32 %9, i32 %10)
%12 = call i32 (...) @noecho()
%13 = load i32, i32* @COLOR_RED
%14 = call i32 @init_color(i32 %13, i32 700, i32 0, i32 0)
%15 = load i32, i32* @COLS
%16 = call i32* @create_newwin(i32 1, i32 %15, i32 0, i32 0)
store i32* %16, i32** %3
%17 = load i32, i32* @LINES
%18 = sub nsw i32 %17, 3
%19 = load i32, i32* @COLS
%20 = call i32* @create_newwin(i32 %18, i32 %19, i32 1, i32 0)
store i32* %20, i32** %4
%21 = load i32, i32* @COLS
%22 = load i32, i32* @LINES
%23 = sub nsw i32 %22, 2
%24 = call i32* @create_newwin(i32 1, i32 %21, i32 %23, i32 0)
store i32* %24, i32** %5
%25 = load i32, i32* @COLS
%26 = load i32, i32* @LINES
%27 = sub nsw i32 %26, 1
%28 = call i32* @create_newwin(i32 1, i32 %25, i32 %27, i32 0)
store i32* %28, i32** %6
%29 = load i32*, i32** %5
%30 = call i32 @wborder(i32* %29, i8 signext 45, i8 signext 45, i8 signext 45, i8 signext 45, i8 signext 45, i8 signext 45, i8 signext 45, i8 signext 45)
%31 = load i32*, i32** %5
%32 = call i32 @wrefresh(i32* %31)
%33 = load i32*, i32** %6
%34 = call i32 @wborder(i32* %33, i8 signext 124, i8 signext 124, i8 signext 45, i8 signext 45, i8 signext 43, i8 signext 43, i8 signext 43, i8 signext 43)
%35 = load i32*, i32** %6
%36 = call i32 @wrefresh(i32* %35)
%37 = call i32 (...) @refresh()
%38 = call i32 (...) @getch()
%39 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_RED = global i32 0
@COLS = global i32 0
@LINES = global i32 0
define void @init_ui(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @initscr()
%3 = tail call i32 (...) @raw()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = tail call i32 @keypad(i32 %4, i32 %5)
%7 = tail call i32 (...) @noecho()
%8 = load i32, i32* @COLOR_RED
%9 = tail call i32 @init_color(i32 %8, i32 700, i32 0, i32 0)
%10 = load i32, i32* @COLS
%11 = tail call i32* @create_newwin(i32 1, i32 %10, i32 0, i32 0)
%12 = load i32, i32* @LINES
%13 = add nsw i32 %12, -3
%14 = load i32, i32* @COLS
%15 = tail call i32* @create_newwin(i32 %13, i32 %14, i32 1, i32 0)
%16 = load i32, i32* @COLS
%17 = load i32, i32* @LINES
%18 = add nsw i32 %17, -2
%19 = tail call i32* @create_newwin(i32 1, i32 %16, i32 %18, i32 0)
%20 = load i32, i32* @COLS
%21 = load i32, i32* @LINES
%22 = add nsw i32 %21, -1
%23 = tail call i32* @create_newwin(i32 1, i32 %20, i32 %22, i32 0)
%24 = tail call i32 @wborder(i32* %19, i8 signext 45, i8 signext 45, i8 signext 45, i8 signext 45, i8 signext 45, i8 signext 45, i8 signext 45, i8 signext 45)
%25 = tail call i32 @wrefresh(i32* %19)
%26 = tail call i32 @wborder(i32* %23, i8 signext 124, i8 signext 124, i8 signext 45, i8 signext 45, i8 signext 43, i8 signext 43, i8 signext 43, i8 signext 43)
%27 = tail call i32 @wrefresh(i32* %23)
%28 = tail call i32 (...) @refresh()
%29 = tail call i32 (...) @getch()
%30 = tail call i32 (...) @endwin()
ret void
}