void sti() {
  do {
    if (!(!interrupts_enabled())) {
      kprintf("Failed Assertion: %s at %s:%s:%d\n", "!interrupts_enabled()",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/naegelejd/duneOS/refs/heads/master/"
              "kernel/int.c",
              __func__, 20);
      khalt();
    }
  } while (0);
  asm volatile("sti");
}


x86 assembly (clang, -O0):
<sti>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <sti+0x9>
mov    $0x0,%al
call   1050 <interrupts_enabled@plt>
cmp    $0x0,%eax
je     1179 <sti+0x49>
lea    0xeb0(%rip),%rdi
lea    0xecb(%rip),%rsi
lea    0xeda(%rip),%rdx
lea    0xf5d(%rip),%rcx
mov    $0x14,%r8d
mov    $0x0,%al
call   1040 <kprintf@plt>
mov    $0x0,%al
call   1030 <khalt@plt>
jmp    117e <sti+0x4e>
sti
pop    %rbp
ret

x86 assembly (clang, -O2):
<sti>:
push   %rax
xor    %eax,%eax
call   1050 <interrupts_enabled@plt>
test   %eax,%eax
je     116c <sti+0x3c>
lea    0xebd(%rip),%rdi
lea    0xed8(%rip),%rsi
lea    0xee7(%rip),%rdx
lea    0xf6a(%rip),%rcx
mov    $0x14,%r8d
xor    %eax,%eax
call   1040 <kprintf@plt>
xor    %eax,%eax
call   1030 <khalt@plt>
sti
pop    %rax
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Failed Assertion: %s at %s:%s:%d\0A\00"
@.str.1 = [22 x i8] c"!interrupts_enabled()\00"
@.str.2 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/naegelejd/duneOS/refs/heads/master/kernel/int.c\00"
@__func__.sti = [4 x i8] c"sti\00"
define void @sti() {
br label %1
1: ; preds = %0
%2 = call i32 (...) @interrupts_enabled()
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = call i32 (i8*, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.sti, i64 0, i64 0), i32 20)
%6 = call i32 (...) @khalt()
br label %7
7: ; preds = %4, %1
br label %8
8: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Failed Assertion: %s at %s:%s:%d\0A\00"
@.str.1 = [22 x i8] c"!interrupts_enabled()\00"
@.str.2 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/naegelejd/duneOS/refs/heads/master/kernel/int.c\00"
@__func__.sti = [4 x i8] c"sti\00"
define void @sti() {
%1 = tail call i32 (...) @interrupts_enabled()
%2 = icmp eq i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (i8*, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.sti, i64 0, i64 0), i32 20)
%5 = tail call i32 (...) @khalt()
br label %6
6: ; preds = %0, %3
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}