#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 */

/* Variables and functions */
int /*<<< orphan*/ ACS_HLINE;
int /*<<< orphan*/ ACS_LTEE;
int /*<<< orphan*/ ACS_RTEE;
scalar_t__ COLS;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ border(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mvaddch(int, scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ mvhline(int, int, int /*<<< orphan*/, scalar_t__);
int /*<<< orphan*/ nodelay(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ nonl();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
void initcurses() {
  stdscr = initscr();
  start_color();
  nodelay(stdscr, TRUE);
  cbreak();
  noecho();
  keypad(stdscr, TRUE);
  nonl();
  curs_set(0);
  border(0, 0, 0, 0, 0, 0, 0, 0);
  mvaddch(2, 0, ACS_LTEE);
  mvaddch(2, COLS - 1, ACS_RTEE);
  mvhline(2, 1, ACS_HLINE, COLS - 2);
  refresh();
}


x86 assembly (clang, -O0):
<initcurses>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <initscr@plt>
mov    %eax,%ecx
mov    0x2e08(%rip),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1070 <start_color@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
mov    0x2de7(%rip),%rax
mov    (%rax),%esi
call   1090 <nodelay@plt>
mov    $0x0,%al
call   1040 <cbreak@plt>
mov    $0x0,%al
call   10c0 <noecho@plt>
mov    0x2dd3(%rip),%rax
mov    (%rax),%edi
mov    0x2dc2(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
mov    $0x0,%al
call   1080 <nonl@plt>
xor    %edi,%edi
call   10e0 <curs_set@plt>
xor    %r9d,%r9d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <border@plt>
mov    0x2d90(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
xor    %eax,%eax
mov    %eax,%esi
call   10d0 <mvaddch@plt>
mov    0x2d61(%rip),%rax
mov    (%rax),%rsi
sub    $0x1,%rsi
mov    0x2d3b(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   10d0 <mvaddch@plt>
mov    0x2d30(%rip),%rax
mov    (%rax),%edx
mov    0x2d37(%rip),%rax
mov    (%rax),%rcx
sub    $0x2,%rcx
mov    $0x2,%edi
mov    $0x1,%esi
call   10b0 <mvhline@plt>
mov    $0x0,%al
call   10a0 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initcurses>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <initscr@plt>
mov    0x2e0e(%rip),%rbx
mov    %eax,(%rbx)
xor    %eax,%eax
call   1070 <start_color@plt>
mov    (%rbx),%edi
mov    0x2df4(%rip),%r14
mov    (%r14),%esi
call   1090 <nodelay@plt>
xor    %eax,%eax
call   1040 <cbreak@plt>
xor    %eax,%eax
call   10c0 <noecho@plt>
mov    (%rbx),%edi
mov    (%r14),%esi
call   1050 <keypad@plt>
xor    %eax,%eax
call   1080 <nonl@plt>
xor    %edi,%edi
call   10e0 <curs_set@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1030 <border@plt>
add    $0x10,%rsp
mov    0x2db4(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
xor    %esi,%esi
call   10d0 <mvaddch@plt>
mov    0x2d87(%rip),%rbx
mov    (%rbx),%rsi
add    $0xffffffffffffffff,%rsi
mov    0x2d61(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   10d0 <mvaddch@plt>
mov    0x2d56(%rip),%rax
mov    (%rax),%edx
mov    (%rbx),%rcx
add    $0xfffffffffffffffe,%rcx
mov    $0x2,%edi
mov    $0x1,%esi
call   10b0 <mvhline@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    10a0 <refresh@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@ACS_LTEE = global i32 0
@COLS = global i64 0
@ACS_RTEE = global i32 0
@ACS_HLINE = global i32 0
define void @initcurses() {
%1 = call i32 (...) @initscr()
store i32 %1, i32* @stdscr
%2 = call i32 (...) @start_color()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = call i32 @nodelay(i32 %3, i32 %4)
%6 = call i32 (...) @cbreak()
%7 = call i32 (...) @noecho()
%8 = load i32, i32* @stdscr
%9 = load i32, i32* @TRUE
%10 = call i32 @keypad(i32 %8, i32 %9)
%11 = call i32 (...) @nonl()
%12 = call i32 @curs_set(i32 0)
%13 = call i32 @border(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%14 = load i32, i32* @ACS_LTEE
%15 = call i32 @mvaddch(i32 2, i64 0, i32 %14)
%16 = load i64, i64* @COLS
%17 = sub nsw i64 %16, 1
%18 = load i32, i32* @ACS_RTEE
%19 = call i32 @mvaddch(i32 2, i64 %17, i32 %18)
%20 = load i32, i32* @ACS_HLINE
%21 = load i64, i64* @COLS
%22 = sub nsw i64 %21, 2
%23 = call i32 @mvhline(i32 2, i32 1, i32 %20, i64 %22)
%24 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@ACS_LTEE = global i32 0
@COLS = global i64 0
@ACS_RTEE = global i32 0
@ACS_HLINE = global i32 0
define void @initcurses() {
%1 = tail call i32 (...) @initscr()
store i32 %1, i32* @stdscr
%2 = tail call i32 (...) @start_color()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = tail call i32 @nodelay(i32 %3, i32 %4)
%6 = tail call i32 (...) @cbreak()
%7 = tail call i32 (...) @noecho()
%8 = load i32, i32* @stdscr
%9 = load i32, i32* @TRUE
%10 = tail call i32 @keypad(i32 %8, i32 %9)
%11 = tail call i32 (...) @nonl()
%12 = tail call i32 @curs_set(i32 0)
%13 = tail call i32 @border(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%14 = load i32, i32* @ACS_LTEE
%15 = tail call i32 @mvaddch(i32 2, i64 0, i32 %14)
%16 = load i64, i64* @COLS
%17 = add nsw i64 %16, -1
%18 = load i32, i32* @ACS_RTEE
%19 = tail call i32 @mvaddch(i32 2, i64 %17, i32 %18)
%20 = load i32, i32* @ACS_HLINE
%21 = load i64, i64* @COLS
%22 = add nsw i64 %21, -2
%23 = tail call i32 @mvhline(i32 2, i32 1, i32 %20, i64 %22)
%24 = tail call i32 (...) @refresh()
ret void
}