#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*/ atexit(void (*)());
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
scalar_t__ endwin;
int /*<<< orphan*/ init_color_pairs();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ use_default_colors();
void init_curses(void) {
  initscr();
  cbreak();
  keypad(stdscr, 1);
  noecho();
  curs_set(0);
  use_default_colors();
  start_color();
  init_color_pairs();
  atexit((void (*)(void))endwin);
}


x86 assembly (clang, -O0):
<init_curses>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   1040 <cbreak@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1050 <keypad@plt>
mov    $0x0,%al
call   1090 <noecho@plt>
xor    %edi,%edi
call   10b0 <curs_set@plt>
mov    $0x0,%al
call   1030 <use_default_colors@plt>
mov    $0x0,%al
call   1070 <start_color@plt>
mov    $0x0,%al
call   1080 <init_color_pairs@plt>
mov    0x2e09(%rip),%rax
mov    (%rax),%rdi
call   11f0 <atexit>
pop    %rbp
ret
nopl   0x0(%rax)

x86 assembly (clang, -O2):
<init_curses>:
push   %rax
xor    %eax,%eax
call   1060 <initscr@plt>
xor    %eax,%eax
call   1040 <cbreak@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1050 <keypad@plt>
xor    %eax,%eax
call   1090 <noecho@plt>
xor    %edi,%edi
call   10b0 <curs_set@plt>
xor    %eax,%eax
call   1030 <use_default_colors@plt>
xor    %eax,%eax
call   1070 <start_color@plt>
xor    %eax,%eax
call   1080 <init_color_pairs@plt>
mov    0x2e0c(%rip),%rax
mov    (%rax),%rdi
pop    %rax
jmp    11f0 <atexit>
cs nopw 0x0(%rax,%rax,1)
nop

LLVM IR (-O0):
@stdscr = global i32 0
@endwin = global i64 0
define void @init_curses() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @cbreak()
%3 = load i32, i32* @stdscr
%4 = call i32 @keypad(i32 %3, i32 1)
%5 = call i32 (...) @noecho()
%6 = call i32 @curs_set(i32 0)
%7 = call i32 (...) @use_default_colors()
%8 = call i32 (...) @start_color()
%9 = call i32 (...) @init_color_pairs()
%10 = load i64, i64* @endwin
%11 = inttoptr i64 %10 to void ()*
%12 = bitcast void ()* %11 to void (...)*
%13 = call i32 @atexit(void (...)* %12)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@endwin = global i64 0
define void @init_curses() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = load i32, i32* @stdscr
%4 = tail call i32 @keypad(i32 %3, i32 1)
%5 = tail call i32 (...) @noecho()
%6 = tail call i32 @curs_set(i32 0)
%7 = tail call i32 (...) @use_default_colors()
%8 = tail call i32 (...) @start_color()
%9 = tail call i32 (...) @init_color_pairs()
%10 = load i64, i64* @endwin
%11 = inttoptr i64 %10 to void (...)*
%12 = tail call i32 @atexit(void (...)* %11)
ret void
}