#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*/ gdt_init();
int /*<<< orphan*/ idt_init();
int /*<<< orphan*/ irq_init();
int /*<<< orphan*/ isr_init();
int /*<<< orphan*/ screen_init();
int /*<<< orphan*/ screen_puts(char *);
int /*<<< orphan*/ sys_init();
void boot() {
  screen_init();
  screen_puts("gdt init...\n");
  gdt_init();
  screen_puts("idt init...\n");
  idt_init();
  screen_puts("isr init...\n");
  isr_init();
  screen_puts("irq init...\n");
  irq_init();
  screen_puts("sys init...\n");
  sys_init();
}


x86 assembly (clang, -O0):
<boot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <screen_init@plt>
lea    0xe7e(%rip),%rdi
call   1050 <screen_puts@plt>
mov    $0x0,%al
call   1090 <gdt_init@plt>
lea    0xe78(%rip),%rdi
call   1050 <screen_puts@plt>
mov    $0x0,%al
call   1070 <idt_init@plt>
lea    0xe72(%rip),%rdi
call   1050 <screen_puts@plt>
mov    $0x0,%al
call   1080 <isr_init@plt>
lea    0xe6c(%rip),%rdi
call   1050 <screen_puts@plt>
mov    $0x0,%al
call   1060 <irq_init@plt>
lea    0xe66(%rip),%rdi
call   1050 <screen_puts@plt>
mov    $0x0,%al
call   1030 <sys_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<boot>:
push   %rax
xor    %eax,%eax
call   1040 <screen_init@plt>
lea    0xe81(%rip),%rdi
call   1050 <screen_puts@plt>
xor    %eax,%eax
call   1090 <gdt_init@plt>
lea    0xe7b(%rip),%rdi
call   1050 <screen_puts@plt>
xor    %eax,%eax
call   1070 <idt_init@plt>
lea    0xe75(%rip),%rdi
call   1050 <screen_puts@plt>
xor    %eax,%eax
call   1080 <isr_init@plt>
lea    0xe6f(%rip),%rdi
call   1050 <screen_puts@plt>
xor    %eax,%eax
call   1060 <irq_init@plt>
lea    0xe69(%rip),%rdi
call   1050 <screen_puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <sys_init@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"gdt init...\0A\00"
@.str.1 = [13 x i8] c"idt init...\0A\00"
@.str.2 = [13 x i8] c"isr init...\0A\00"
@.str.3 = [13 x i8] c"irq init...\0A\00"
@.str.4 = [13 x i8] c"sys init...\0A\00"
define void @boot() {
%1 = call i32 (...) @screen_init()
%2 = call i32 @screen_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @gdt_init()
%4 = call i32 @screen_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @idt_init()
%6 = call i32 @screen_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (...) @isr_init()
%8 = call i32 @screen_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (...) @irq_init()
%10 = call i32 @screen_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (...) @sys_init()
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"gdt init...\0A\00"
@.str.1 = [13 x i8] c"idt init...\0A\00"
@.str.2 = [13 x i8] c"isr init...\0A\00"
@.str.3 = [13 x i8] c"irq init...\0A\00"
@.str.4 = [13 x i8] c"sys init...\0A\00"
define void @boot() {
%1 = tail call i32 (...) @screen_init()
%2 = tail call i32 @screen_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @gdt_init()
%4 = tail call i32 @screen_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @idt_init()
%6 = tail call i32 @screen_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 (...) @isr_init()
%8 = tail call i32 @screen_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 (...) @irq_init()
%10 = tail call i32 @screen_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i32 (...) @sys_init()
ret void
}