unsigned int initcore() {
  terminal_writestring("SETTING UP GDT          ");
  gdt_install();
  vgatestok();
  terminal_writestring("SETTING UP IDT          ");
  idt_install();
  vgatestok();
  terminal_writestring("SETTING UP ISRS         ");
  isrs_install();
  vgatestok();
  terminal_writestring("SETTING UP IRQ          ");
  irq_install();
  { __asm__ __volatile__("sti"); }
  vgatestok();
  terminal_writestring("SETTING UP PIC          ");
  timer_phase(100);
  timer_install();
  vgatestok();
  return (0);
}


x86 assembly (clang, -O0):
<initcore>:
push   %rbp
mov    %rsp,%rbp
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1060 <terminal_writestring@plt>
mov    $0x0,%al
call   1070 <gdt_install@plt>
mov    $0x0,%al
call   1080 <vgatestok@plt>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1060 <terminal_writestring@plt>
mov    $0x0,%al
call   1090 <idt_install@plt>
mov    $0x0,%al
call   1080 <vgatestok@plt>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1060 <terminal_writestring@plt>
mov    $0x0,%al
call   10a0 <isrs_install@plt>
mov    $0x0,%al
call   1080 <vgatestok@plt>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1060 <terminal_writestring@plt>
mov    $0x0,%al
call   1050 <irq_install@plt>
sti
mov    $0x0,%al
call   1080 <vgatestok@plt>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1060 <terminal_writestring@plt>
mov    $0x64,%edi
mov    $0x0,%al
call   1030 <timer_phase@plt>
mov    $0x0,%al
call   1040 <timer_install@plt>
mov    $0x0,%al
call   1080 <vgatestok@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<initcore>:
push   %rax
lea    0xe78(%rip),%rdi
xor    %eax,%eax
call   1060 <terminal_writestring@plt>
xor    %eax,%eax
call   1070 <gdt_install@plt>
xor    %eax,%eax
call   1080 <vgatestok@plt>
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1060 <terminal_writestring@plt>
xor    %eax,%eax
call   1090 <idt_install@plt>
xor    %eax,%eax
call   1080 <vgatestok@plt>
lea    0xe72(%rip),%rdi
xor    %eax,%eax
call   1060 <terminal_writestring@plt>
xor    %eax,%eax
call   10a0 <isrs_install@plt>
xor    %eax,%eax
call   1080 <vgatestok@plt>
lea    0xe6f(%rip),%rdi
xor    %eax,%eax
call   1060 <terminal_writestring@plt>
xor    %eax,%eax
call   1050 <irq_install@plt>
sti
xor    %eax,%eax
call   1080 <vgatestok@plt>
lea    0xe6b(%rip),%rdi
xor    %eax,%eax
call   1060 <terminal_writestring@plt>
mov    $0x64,%edi
xor    %eax,%eax
call   1030 <timer_phase@plt>
xor    %eax,%eax
call   1040 <timer_install@plt>
xor    %eax,%eax
call   1080 <vgatestok@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"SETTING UP GDT \00"
@.str.1 = [25 x i8] c"SETTING UP IDT \00"
@.str.2 = [25 x i8] c"SETTING UP ISRS \00"
@.str.3 = [25 x i8] c"SETTING UP IRQ \00"
@.str.4 = [25 x i8] c"SETTING UP PIC \00"
define i32 @initcore() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @terminal_writestring to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @gdt_install()
%3 = call i32 (...) @vgatestok()
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @terminal_writestring to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @idt_install()
%6 = call i32 (...) @vgatestok()
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @terminal_writestring to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (...) @isrs_install()
%9 = call i32 (...) @vgatestok()
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @terminal_writestring to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (...) @irq_install()
%12 = call i32 (...) @vgatestok()
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @terminal_writestring to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i32, ...) bitcast (i32 (...)* @timer_phase to i32 (i32, ...)*)(i32 100)
%15 = call i32 (...) @timer_install()
%16 = call i32 (...) @vgatestok()
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"SETTING UP GDT \00"
@.str.1 = [25 x i8] c"SETTING UP IDT \00"
@.str.2 = [25 x i8] c"SETTING UP ISRS \00"
@.str.3 = [25 x i8] c"SETTING UP IRQ \00"
@.str.4 = [25 x i8] c"SETTING UP PIC \00"
define i32 @initcore() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @terminal_writestring to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @gdt_install()
%3 = tail call i32 (...) @vgatestok()
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @terminal_writestring to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @idt_install()
%6 = tail call i32 (...) @vgatestok()
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @terminal_writestring to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 (...) @isrs_install()
%9 = tail call i32 (...) @vgatestok()
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @terminal_writestring to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i32 (...) @irq_install()
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
%12 = tail call i32 (...) @vgatestok()
%13 = tail call i32 (i8*, ...) bitcast (i32 (...)* @terminal_writestring to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%14 = tail call i32 (i32, ...) bitcast (i32 (...)* @timer_phase to i32 (i32, ...)*)(i32 100)
%15 = tail call i32 (...) @timer_install()
%16 = tail call i32 (...) @vgatestok()
ret i32 0
}