#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*/ init_8259A();
int /*<<< orphan*/ init_gdt();
int /*<<< orphan*/ init_prot();
int /*<<< orphan*/ printf1(char *);
int /*<<< orphan*/ reflash_idtr();
void init() {
  printf1("init_GDT......");
  init_gdt();
  printf1("[ok]\n");
  printf1("init_8259A.....");
  init_8259A();
  printf1("[ok]\n");
  printf1("init_prot......");
  init_prot();
  printf1("[ok]\n");
  printf1("init_IDT......");
  reflash_idtr();
  printf1("[OK]");
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1040 <printf1@plt>
mov    $0x0,%al
call   1050 <init_gdt@plt>
lea    0xea1(%rip),%rdi
call   1040 <printf1@plt>
lea    0xe9b(%rip),%rdi
call   1040 <printf1@plt>
mov    $0x0,%al
call   1030 <init_8259A@plt>
lea    0xe82(%rip),%rdi
call   1040 <printf1@plt>
lea    0xe8c(%rip),%rdi
call   1040 <printf1@plt>
mov    $0x0,%al
call   1060 <init_prot@plt>
lea    0xe63(%rip),%rdi
call   1040 <printf1@plt>
lea    0xe7d(%rip),%rdi
call   1040 <printf1@plt>
mov    $0x0,%al
call   1070 <reflash_idtr@plt>
lea    0xe79(%rip),%rdi
call   1040 <printf1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbx
lea    0xea8(%rip),%rdi
call   1040 <printf1@plt>
xor    %eax,%eax
call   1050 <init_gdt@plt>
lea    0xea4(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf1@plt>
lea    0xe9b(%rip),%rdi
call   1040 <printf1@plt>
xor    %eax,%eax
call   1030 <init_8259A@plt>
mov    %rbx,%rdi
call   1040 <printf1@plt>
lea    0xe90(%rip),%rdi
call   1040 <printf1@plt>
xor    %eax,%eax
call   1060 <init_prot@plt>
mov    %rbx,%rdi
call   1040 <printf1@plt>
lea    0xe85(%rip),%rdi
call   1040 <printf1@plt>
xor    %eax,%eax
call   1070 <reflash_idtr@plt>
lea    0xe81(%rip),%rdi
pop    %rbx
jmp    1040 <printf1@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"init_GDT......\00"
@.str.1 = [6 x i8] c"[ok]\0A\00"
@.str.2 = [16 x i8] c"init_8259A.....\00"
@.str.3 = [16 x i8] c"init_prot......\00"
@.str.4 = [15 x i8] c"init_IDT......\00"
@.str.5 = [5 x i8] c"[OK]\00"
define void @init() {
%1 = call i32 @printf1(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @init_gdt()
%3 = call i32 @printf1(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf1(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @init_8259A()
%6 = call i32 @printf1(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf1(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (...) @init_prot()
%9 = call i32 @printf1(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @printf1(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (...) @reflash_idtr()
%12 = call i32 @printf1(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"init_GDT......\00"
@.str.1 = [6 x i8] c"[ok]\0A\00"
@.str.2 = [16 x i8] c"init_8259A.....\00"
@.str.3 = [16 x i8] c"init_prot......\00"
@.str.4 = [15 x i8] c"init_IDT......\00"
@.str.5 = [5 x i8] c"[OK]\00"
define void @init() {
%1 = tail call i32 @printf1(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @init_gdt()
%3 = tail call i32 @printf1(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf1(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 (...) @init_8259A()
%6 = tail call i32 @printf1(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @printf1(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 (...) @init_prot()
%9 = tail call i32 @printf1(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @printf1(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i32 (...) @reflash_idtr()
%12 = tail call i32 @printf1(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret void
}