void boot_prompt() {
  char x = 0;
  __asm__ __volatile__("xor %%ah , %%ah\n"
                       "mov $0x02, %%al\n"
                       "mov $0x20, %%bh\n"
                       "int $0x10\n"
                       :);
  puts("-----------------------------------------------------------------------"
       "------");
  puts("                             HILOW Helix Loader                        "
       "      ");
  puts("-----------------------------------------------------------------------"
       "------");
  puts("Press:");
  puts("      1 Boot into Helix ");
  puts("      2 Boot into Other Operating system");
  x = getch();
  if (x == (char)'1')
    return;
  __asm__ __volatile__("mov $0x7C0, %%ax\n"
                       "mov %%ax  , %%es\n"
                       "mov $0x2  , %%ah\n"
                       "mov $0x1  , %%al\n"
                       "xor %%bx  , %%bx\n"
                       "xor %%dh  , %%dh\n"
                       "mov $0x80 , %%dl\n"
                       "xor %%ch  , %%ch\n"
                       "mov $0x1  , %%cl\n"
                       "int $0x13\n"
                       :);
  jmp_in_dry_well();
}


x86 assembly (clang, -O0):
<boot_prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
xor    %ah,%ah
mov    $0x2,%al
mov    $0x20,%bh
int    $0x10
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xf27(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xf2b(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x31,%eax
jne    11b4 <boot_prompt+0x84>
jmp    11d2 <boot_prompt+0xa2>
mov    $0x7c0,%ax
mov    %eax,%es
mov    $0x2,%ah
mov    $0x1,%al
xor    %bx,%bx
xor    %dh,%dh
mov    $0x80,%dl
xor    %ch,%ch
mov    $0x1,%cl
int    $0x13
mov    $0x0,%al
call   1040 <jmp_in_dry_well@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<boot_prompt>:
push   %rbx
xor    %ah,%ah
mov    $0x2,%al
mov    $0x20,%bh
int    $0x10
lea    0xec0(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xf33(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xf2c(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xf37(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getch@plt>
cmp    $0x31,%al
jne    1199 <boot_prompt+0x69>
pop    %rbx
ret
mov    $0x7c0,%ax
mov    %eax,%es
mov    $0x2,%ah
mov    $0x1,%al
xor    %bx,%bx
xor    %dh,%dh
mov    $0x80,%dl
xor    %ch,%ch
mov    $0x1,%cl
int    $0x13
xor    %eax,%eax
pop    %rbx
jmp    1040 <jmp_in_dry_well@plt>

LLVM IR (-O0):
@.str = [78 x i8] c"-----------------------------------------------------------------------------\00"
@.str.1 = [78 x i8] c" HILOW Helix Loader \00"
@.str.2 = [7 x i8] c"Press:\00"
@.str.3 = [25 x i8] c" 1 Boot into Helix \00"
@.str.4 = [41 x i8] c" 2 Boot into Other Operating system\00"
define void @boot_prompt() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 (...) @getch()
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 49
br i1 %12, label %13, label %14
13: ; preds = %0
br label %16
14: ; preds = %0
%15 = call i32 (...) @jmp_in_dry_well()
br label %16
16: ; preds = %14, %13
ret void
}

LLVM IR (-O2):
@.str = [78 x i8] c"-----------------------------------------------------------------------------\00"
@.str.1 = [78 x i8] c" HILOW Helix Loader \00"
@.str.2 = [7 x i8] c"Press:\00"
@.str.3 = [25 x i8] c" 1 Boot into Helix \00"
@.str.4 = [41 x i8] c" 2 Boot into Other Operating system\00"
define void @boot_prompt() {
tail call void asm sideeffect "xor %ah , %ah\0Amov $$0x02, %al\0Amov $$0x20, %bh\0Aint $$0x10\0A", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 (...) @getch()
%8 = and i32 %7, 255
%9 = icmp eq i32 %8, 49
br i1 %9, label %12, label %10
10: ; preds = %0
tail call void asm sideeffect "mov $$0x7C0, %ax\0Amov %ax , %es\0Amov $$0x2 , %ah\0Amov $$0x1 , %al\0Axor %bx , %bx\0Axor %dh , %dh\0Amov $$0x80 , %dl\0Axor %ch , %ch\0Amov $$0x1 , %cl\0Aint $$0x13\0A", "~{dirflag},~{fpsr},~{flags}"()
%11 = tail call i32 (...) @jmp_in_dry_well()
br label %12
12: ; preds = %0, %10
ret void
}