void cli() {
  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__, 14);
      khalt();
    }
  } while (0);
  asm volatile("cli");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"Failed Assertion: %s at %s:%s:%d\0A\00"
@.str.1 = [21 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__.cli = [4 x i8] c"cli\00"
define void @cli() {
br label %1
1: ; preds = %0
%2 = call i32 (...) @interrupts_enabled()
%3 = icmp ne i32 %2, 0
br i1 %3, label %7, label %4
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 ([21 x i8], [21 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__.cli, i64 0, i64 0), i32 14)
%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 = [21 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__.cli = [4 x i8] c"cli\00"
define void @cli() {
%1 = tail call i32 (...) @interrupts_enabled()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
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 ([21 x i8], [21 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__.cli, i64 0, i64 0), i32 14)
%5 = tail call i32 (...) @khalt()
br label %6
6: ; preds = %0, %3
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}