#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*/ TRUE;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ test_update_cursor(char const *);
int /*<<< orphan*/ test_update_display(char const *);
int main(void) {
  const char *filename = "./file.txt";
  initscr();
  raw();
  keypad(stdscr, TRUE);
  noecho();
  test_update_cursor(filename);
  test_update_display(filename);
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe7a(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1060 <raw@plt>
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
mov    0x2e38(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
mov    $0x0,%al
call   1080 <noecho@plt>
mov    -0x10(%rbp),%rdi
call   1030 <test_update_cursor@plt>
mov    -0x10(%rbp),%rdi
call   1090 <test_update_display@plt>
mov    $0x0,%al
call   1070 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1060 <raw@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
mov    0x2e51(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
xor    %eax,%eax
call   1080 <noecho@plt>
lea    0xe5c(%rip),%rbx
mov    %rbx,%rdi
call   1030 <test_update_cursor@plt>
mov    %rbx,%rdi
call   1090 <test_update_display@plt>
xor    %eax,%eax
call   1070 <endwin@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"./file.txt\00"
@stdscr = global i32 0
@TRUE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i32 (...) @initscr()
%4 = call i32 (...) @raw()
%5 = load i32, i32* @stdscr
%6 = load i32, i32* @TRUE
%7 = call i32 @keypad(i32 %5, i32 %6)
%8 = call i32 (...) @noecho()
%9 = load i8*, i8** %2
%10 = call i32 @test_update_cursor(i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 @test_update_display(i8* %11)
%13 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"./file.txt\00"
@stdscr = global i32 0
@TRUE = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @raw()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = tail call i32 @keypad(i32 %3, i32 %4)
%6 = tail call i32 (...) @noecho()
%7 = tail call i32 @test_update_cursor(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @test_update_display(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 (...) @endwin()
ret i32 0
}