#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*/ _IONBF;
int /*<<< orphan*/ clipboard_init();
int editor_main(int, char **);
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ term_clear_screen();
int /*<<< orphan*/ term_close();
int /*<<< orphan*/ term_cursor_toggle(int);
int /*<<< orphan*/ term_setup();
int main(int argc, char **argv) {
  setvbuf(stdin, NULL, _IONBF, 0);
  term_setup();
  term_cursor_toggle(0);
  clipboard_init();
  int exitcode = editor_main(argc, argv);
  term_clear_screen();
  term_cursor_toggle(1);
  term_close();
  return exitcode;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
mov    0x2e4a(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1060 <setvbuf@plt>
mov    $0x0,%al
call   1030 <term_setup@plt>
xor    %edi,%edi
call   1070 <term_cursor_toggle@plt>
mov    $0x0,%al
call   1080 <clipboard_init@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <editor_main@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <term_clear_screen@plt>
mov    $0x1,%edi
call   1070 <term_cursor_toggle@plt>
mov    $0x0,%al
call   1050 <term_close@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
mov    0x2e58(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1060 <setvbuf@plt>
xor    %eax,%eax
call   1030 <term_setup@plt>
xor    %edi,%edi
call   1070 <term_cursor_toggle@plt>
xor    %eax,%eax
call   1080 <clipboard_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1090 <editor_main@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <term_clear_screen@plt>
mov    $0x1,%edi
call   1070 <term_cursor_toggle@plt>
xor    %eax,%eax
call   1050 <term_close@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@_IONBF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @stdin
%8 = load i32, i32* @_IONBF
%9 = call i32 @setvbuf(i32 %7, i32* null, i32 %8, i32 0)
%10 = call i32 (...) @term_setup()
%11 = call i32 @term_cursor_toggle(i32 0)
%12 = call i32 (...) @clipboard_init()
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i32 @editor_main(i32 %13, i8** %14)
store i32 %15, i32* %6
%16 = call i32 (...) @term_clear_screen()
%17 = call i32 @term_cursor_toggle(i32 1)
%18 = call i32 (...) @term_close()
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
@stdin = global i32 0
@_IONBF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = load i32, i32* @stdin
%4 = load i32, i32* @_IONBF
%5 = tail call i32 @setvbuf(i32 %3, i32* null, i32 %4, i32 0)
%6 = tail call i32 (...) @term_setup()
%7 = tail call i32 @term_cursor_toggle(i32 0)
%8 = tail call i32 (...) @clipboard_init()
%9 = tail call i32 @editor_main(i32 %0, i8** %1)
%10 = tail call i32 (...) @term_clear_screen()
%11 = tail call i32 @term_cursor_toggle(i32 1)
%12 = tail call i32 (...) @term_close()
ret i32 %9
}