#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*/ c_print(char *, int);
int /*<<< orphan*/ clearScreen();
int /*<<< orphan*/ scrollUp(int);
void kmain() {
  clearScreen();
  scrollUp(25);
  c_print("===================================================================="
          "===========\n",
          0x02);
  c_print("Welcome to Ernesto's OS\n", 0x03);
  c_print("ErnestOS is an Operating System created for recreational  purpose\n",
          0x04);
  c_print("Please enjoy the code to make this possible\n", 0x05);
  c_print("===================================================================="
          "===========",
          0x06);
  c_print("\n\nThis is so crazy ;) ", 0x07);
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <clearScreen@plt>
mov    $0x19,%edi
call   1040 <scrollUp@plt>
lea    0xeb4(%rip),%rdi
mov    $0x2,%esi
call   1030 <c_print@plt>
lea    0xef4(%rip),%rdi
mov    $0x3,%esi
call   1030 <c_print@plt>
lea    0xefc(%rip),%rdi
mov    $0x4,%esi
call   1030 <c_print@plt>
lea    0xf2e(%rip),%rdi
mov    $0x5,%esi
call   1030 <c_print@plt>
lea    0xf4a(%rip),%rdi
mov    $0x6,%esi
call   1030 <c_print@plt>
lea    0xf89(%rip),%rdi
mov    $0x7,%esi
call   1030 <c_print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmain>:
push   %rax
xor    %eax,%eax
call   1050 <clearScreen@plt>
mov    $0x19,%edi
call   1040 <scrollUp@plt>
lea    0xeb7(%rip),%rdi
mov    $0x2,%esi
call   1030 <c_print@plt>
lea    0xef7(%rip),%rdi
mov    $0x3,%esi
call   1030 <c_print@plt>
lea    0xeff(%rip),%rdi
mov    $0x4,%esi
call   1030 <c_print@plt>
lea    0xf31(%rip),%rdi
mov    $0x5,%esi
call   1030 <c_print@plt>
lea    0xf4d(%rip),%rdi
mov    $0x6,%esi
call   1030 <c_print@plt>
lea    0xf8c(%rip),%rdi
mov    $0x7,%esi
pop    %rax
jmp    1030 <c_print@plt>

LLVM IR (-O0):
@.str = [81 x i8] c"===============================================================================\0A\00"
@.str.1 = [25 x i8] c"Welcome to Ernesto's OS\0A\00"
@.str.2 = [67 x i8] c"ErnestOS is an Operating System created for recreational purpose\0A\00"
@.str.3 = [45 x i8] c"Please enjoy the code to make this possible\0A\00"
@.str.4 = [80 x i8] c"===============================================================================\00"
@.str.5 = [23 x i8] c"\0A\0AThis is so crazy ;) \00"
define void @kmain() {
%1 = call i32 (...) @clearScreen()
%2 = call i32 @scrollUp(i32 25)
%3 = call i32 @c_print(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = call i32 @c_print(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 3)
%5 = call i32 @c_print(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0), i32 4)
%6 = call i32 @c_print(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i32 5)
%7 = call i32 @c_print(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.4, i64 0, i64 0), i32 6)
%8 = call i32 @c_print(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 7)
ret void
}

LLVM IR (-O2):
@.str = [81 x i8] c"===============================================================================\0A\00"
@.str.1 = [25 x i8] c"Welcome to Ernesto's OS\0A\00"
@.str.2 = [67 x i8] c"ErnestOS is an Operating System created for recreational purpose\0A\00"
@.str.3 = [45 x i8] c"Please enjoy the code to make this possible\0A\00"
@.str.4 = [80 x i8] c"===============================================================================\00"
@.str.5 = [23 x i8] c"\0A\0AThis is so crazy ;) \00"
define void @kmain() {
%1 = tail call i32 (...) @clearScreen()
%2 = tail call i32 @scrollUp(i32 25)
%3 = tail call i32 @c_print(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 @c_print(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 3)
%5 = tail call i32 @c_print(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0), i32 4)
%6 = tail call i32 @c_print(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i32 5)
%7 = tail call i32 @c_print(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.4, i64 0, i64 0), i32 6)
%8 = tail call i32 @c_print(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 7)
ret void
}