#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*/ FALSE;
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ intrflush(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ nonl();
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdscr;
void setup_curses() {
  setlocale(LC_ALL, "");
  initscr();
  cbreak();
  noecho();
  nonl();
  intrflush(stdscr, FALSE);
  keypad(stdscr, TRUE);
  curs_set(0);
  return;
}


x86 assembly (clang, -O0):
<setup_curses>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
lea    0xe6c(%rip),%rsi
call   1080 <setlocale@plt>
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1090 <noecho@plt>
mov    $0x0,%al
call   1070 <nonl@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
mov    0x2e0b(%rip),%rax
mov    (%rax),%esi
call   1060 <intrflush@plt>
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
mov    0x2e04(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
xor    %edi,%edi
call   10a0 <curs_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_curses>:
push   %rbx
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
lea    0xe6f(%rip),%rsi
call   1080 <setlocale@plt>
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1090 <noecho@plt>
xor    %eax,%eax
call   1070 <nonl@plt>
mov    0x2e2f(%rip),%rbx
mov    (%rbx),%edi
mov    0x2e0e(%rip),%rax
mov    (%rax),%esi
call   1060 <intrflush@plt>
mov    (%rbx),%edi
mov    0x2e0e(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
xor    %edi,%edi
pop    %rbx
jmp    10a0 <curs_set@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@stdscr = global i32 0
@FALSE = global i32 0
@TRUE = global i32 0
define void @setup_curses() {
%1 = load i32, i32* @LC_ALL
%2 = call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @initscr()
%4 = call i32 (...) @cbreak()
%5 = call i32 (...) @noecho()
%6 = call i32 (...) @nonl()
%7 = load i32, i32* @stdscr
%8 = load i32, i32* @FALSE
%9 = call i32 @intrflush(i32 %7, i32 %8)
%10 = load i32, i32* @stdscr
%11 = load i32, i32* @TRUE
%12 = call i32 @keypad(i32 %10, i32 %11)
%13 = call i32 @curs_set(i32 0)
ret void
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@stdscr = global i32 0
@FALSE = global i32 0
@TRUE = global i32 0
define void @setup_curses() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @initscr()
%4 = tail call i32 (...) @cbreak()
%5 = tail call i32 (...) @noecho()
%6 = tail call i32 (...) @nonl()
%7 = load i32, i32* @stdscr
%8 = load i32, i32* @FALSE
%9 = tail call i32 @intrflush(i32 %7, i32 %8)
%10 = load i32, i32* @stdscr
%11 = load i32, i32* @TRUE
%12 = tail call i32 @keypad(i32 %10, i32 %11)
%13 = tail call i32 @curs_set(i32 0)
ret void
}