#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*/ get_screen_size();
scalar_t__ has_colors();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ move(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ use_default_colors();
void display_setup(void) {
  initscr();
  noecho();
  keypad(stdscr, 0);
  raw();
  move(0, 0);
  refresh();
  get_screen_size();
  if (has_colors()) {
    start_color();
    use_default_colors();
  }
}


x86 assembly (clang, -O0):
<display_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   10b0 <noecho@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1050 <keypad@plt>
mov    $0x0,%al
call   1070 <raw@plt>
xor    %esi,%esi
mov    %esi,%edi
call   10c0 <move@plt>
mov    $0x0,%al
call   10a0 <refresh@plt>
mov    $0x0,%al
call   1090 <get_screen_size@plt>
mov    $0x0,%al
call   1040 <has_colors@plt>
cmp    $0x0,%rax
je     11ff <display_setup+0x5f>
mov    $0x0,%al
call   1080 <start_color@plt>
mov    $0x0,%al
call   1030 <use_default_colors@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_setup>:
push   %rax
xor    %eax,%eax
call   1060 <initscr@plt>
xor    %eax,%eax
call   10b0 <noecho@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1050 <keypad@plt>
xor    %eax,%eax
call   1070 <raw@plt>
xor    %edi,%edi
xor    %esi,%esi
call   10c0 <move@plt>
xor    %eax,%eax
call   10a0 <refresh@plt>
xor    %eax,%eax
call   1090 <get_screen_size@plt>
xor    %eax,%eax
call   1040 <has_colors@plt>
test   %rax,%rax
je     11f8 <display_setup+0x58>
xor    %eax,%eax
call   1080 <start_color@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <use_default_colors@plt>
pop    %rax
ret

LLVM IR (-O0):
@stdscr = global i32 0
define void @display_setup() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @noecho()
%3 = load i32, i32* @stdscr
%4 = call i32 @keypad(i32 %3, i32 0)
%5 = call i32 (...) @raw()
%6 = call i32 @move(i32 0, i32 0)
%7 = call i32 (...) @refresh()
%8 = call i32 (...) @get_screen_size()
%9 = call i64 (...) @has_colors()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = call i32 (...) @start_color()
%13 = call i32 (...) @use_default_colors()
br label %14
14: ; preds = %11, %0
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @display_setup() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
%3 = load i32, i32* @stdscr
%4 = tail call i32 @keypad(i32 %3, i32 0)
%5 = tail call i32 (...) @raw()
%6 = tail call i32 @move(i32 0, i32 0)
%7 = tail call i32 (...) @refresh()
%8 = tail call i32 (...) @get_screen_size()
%9 = tail call i64 (...) @has_colors()
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %0
%12 = tail call i32 (...) @start_color()
%13 = tail call i32 (...) @use_default_colors()
br label %14
14: ; preds = %11, %0
ret void
}