#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*/ abort();
int /*<<< orphan*/ clear_screen();
int get_memory_size();
int /*<<< orphan*/ init_stdlib();
int /*<<< orphan*/ int_init();
int /*<<< orphan*/ lisp();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ test_disk();
int /*<<< orphan*/ tty_init();
void main() {
  tty_init();
  clear_screen();
  int_init();
  init_stdlib();
  test_disk();
  printf("Lispix-v%d.%d ready\n", 0, 1);
  printf("%dMb RAM available\n\n", get_memory_size());
  lisp();
  printf("goodbay!\n");
  abort();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <tty_init@plt>
mov    $0x0,%al
call   1090 <clear_screen@plt>
mov    $0x0,%al
call   1080 <int_init@plt>
mov    $0x0,%al
call   10a0 <init_stdlib@plt>
mov    $0x0,%al
call   1040 <test_disk@plt>
lea    0xe42(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   10b0 <get_memory_size@plt>
mov    %eax,%esi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <lisp@plt>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <tty_init@plt>
xor    %eax,%eax
call   10a0 <clear_screen@plt>
xor    %eax,%eax
call   1090 <int_init@plt>
xor    %eax,%eax
call   10b0 <init_stdlib@plt>
xor    %eax,%eax
call   1050 <test_disk@plt>
lea    0xe35(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   10c0 <get_memory_size@plt>
lea    0xe2e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1080 <lisp@plt>
lea    0xe2c(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Lispix-v%d.%d ready\0A\00"
@.str.1 = [21 x i8] c"%dMb RAM available\0A\0A\00"
@.str.2 = [10 x i8] c"goodbay!\0A\00"
define void @main() {
%1 = call i32 (...) @tty_init()
%2 = call i32 (...) @clear_screen()
%3 = call i32 (...) @int_init()
%4 = call i32 (...) @init_stdlib()
%5 = call i32 (...) @test_disk()
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
%7 = call i32 (...) @get_memory_size()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @lisp()
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"Lispix-v%d.%d ready\0A\00"
@.str.1 = [21 x i8] c"%dMb RAM available\0A\0A\00"
@str = [9 x i8] c"goodbay!\00"
define void @main() {
%1 = tail call i32 (...) @tty_init()
%2 = tail call i32 (...) @clear_screen()
%3 = tail call i32 (...) @int_init()
%4 = tail call i32 (...) @init_stdlib()
%5 = tail call i32 (...) @test_disk()
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
%7 = tail call i32 (...) @get_memory_size()
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 (...) @lisp()
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 (...) @abort()
unreachable
}