#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 */
scalar_t__ COLS;
scalar_t__ LINES;
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ intrflush(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int);
int /*<<< orphan*/ meta(int /*<<< orphan*/, int);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ nonl();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ term_set_size(size_t, size_t);
void term_init(void) {
  initscr();
  term_set_size((size_t)COLS, (size_t)LINES);
  noecho();
  nonl();
  raw();
  meta(stdscr, 1);
  intrflush(stdscr, 0);
  keypad(stdscr, 1);
}


x86 assembly (clang, -O0):
<term_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <initscr@plt>
mov    0x2e46(%rip),%rax
mov    (%rax),%rdi
mov    0x2e4c(%rip),%rax
mov    (%rax),%rsi
call   1030 <term_set_size@plt>
mov    $0x0,%al
call   10a0 <noecho@plt>
mov    $0x0,%al
call   1080 <nonl@plt>
mov    $0x0,%al
call   1060 <raw@plt>
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1090 <meta@plt>
mov    0x2e0d(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1070 <intrflush@plt>
mov    0x2dfd(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <keypad@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_init>:
push   %rbx
xor    %eax,%eax
call   1050 <initscr@plt>
mov    0x2e49(%rip),%rax
mov    (%rax),%rdi
mov    0x2e4f(%rip),%rax
mov    (%rax),%rsi
call   1030 <term_set_size@plt>
xor    %eax,%eax
call   10a0 <noecho@plt>
xor    %eax,%eax
call   1080 <nonl@plt>
xor    %eax,%eax
call   1060 <raw@plt>
mov    0x2e23(%rip),%rbx
mov    (%rbx),%edi
mov    $0x1,%esi
call   1090 <meta@plt>
mov    (%rbx),%edi
xor    %esi,%esi
call   1070 <intrflush@plt>
mov    (%rbx),%edi
mov    $0x1,%esi
pop    %rbx
jmp    1040 <keypad@plt>

LLVM IR (-O0):
@COLS = global i64 0
@LINES = global i64 0
@stdscr = global i32 0
define void @term_init() {
%1 = call i32 (...) @initscr()
%2 = load i64, i64* @COLS
%3 = load i64, i64* @LINES
%4 = call i32 @term_set_size(i64 %2, i64 %3)
%5 = call i32 (...) @noecho()
%6 = call i32 (...) @nonl()
%7 = call i32 (...) @raw()
%8 = load i32, i32* @stdscr
%9 = call i32 @meta(i32 %8, i32 1)
%10 = load i32, i32* @stdscr
%11 = call i32 @intrflush(i32 %10, i32 0)
%12 = load i32, i32* @stdscr
%13 = call i32 @keypad(i32 %12, i32 1)
ret void
}

LLVM IR (-O2):
@COLS = global i64 0
@LINES = global i64 0
@stdscr = global i32 0
define void @term_init() {
%1 = tail call i32 (...) @initscr()
%2 = load i64, i64* @COLS
%3 = load i64, i64* @LINES
%4 = tail call i32 @term_set_size(i64 %2, i64 %3)
%5 = tail call i32 (...) @noecho()
%6 = tail call i32 (...) @nonl()
%7 = tail call i32 (...) @raw()
%8 = load i32, i32* @stdscr
%9 = tail call i32 @meta(i32 %8, i32 1)
%10 = load i32, i32* @stdscr
%11 = tail call i32 @intrflush(i32 %10, i32 0)
%12 = load i32, i32* @stdscr
%13 = tail call i32 @keypad(i32 %12, i32 1)
ret void
}