; LLVM IR from Simple-XX/SimpleKernel :: src/arch/ia32/i386/intr/intr.ll (ZN4INTR4initEv)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.INTR::idt_entry32_t" = type { i64 }
%"struct.INTR::idt_ptr_t" = type <{ i16, i32 }>

@_ZN4INTR11idt_entry32E = external dso_local global [256 x %"struct.INTR::idt_entry32_t"], align 16
@_ZN4INTR7idt_ptrE = external dso_local global %"struct.INTR::idt_ptr_t", align 1
@.str = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1), i8 noundef zeroext, i32 noundef, i16 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4INTR19init_interrupt_chipEv(ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4INTR4initEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  store i16 2047, ptr @_ZN4INTR7idt_ptrE, align 1, !tbaa !9
  store i32 ptrtoint (ptr @_ZN4INTR11idt_entry32E to i32), ptr getelementptr inbounds (%"struct.INTR::idt_ptr_t", ptr @_ZN4INTR7idt_ptrE, i32 0, i32 1), align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !14
  br label %6

6:                                                ; preds = %13, %1
  %7 = load i32, ptr %3, align 4, !tbaa !14
  %8 = icmp ult i32 %7, 256
  br i1 %8, label %10, label %9

9:                                                ; preds = %6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %16

10:                                               ; preds = %6
  %11 = load i32, ptr %3, align 4, !tbaa !14
  %12 = trunc i32 %11 to i8
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext %12, i32 noundef 0, i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  br label %13

13:                                               ; preds = %10
  %14 = load i32, ptr %3, align 4, !tbaa !14
  %15 = add i32 %14, 1
  store i32 %15, ptr %3, align 4, !tbaa !14
  br label %6, !llvm.loop !15

16:                                               ; preds = %9
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 0, i32 noundef ptrtoint (ptr @isr0 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 1, i32 noundef ptrtoint (ptr @isr1 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 2, i32 noundef ptrtoint (ptr @isr2 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 3, i32 noundef ptrtoint (ptr @isr3 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 4, i32 noundef ptrtoint (ptr @isr4 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 5, i32 noundef ptrtoint (ptr @isr5 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 6, i32 noundef ptrtoint (ptr @isr6 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 7, i32 noundef ptrtoint (ptr @isr7 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 8, i32 noundef ptrtoint (ptr @isr8 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 9, i32 noundef ptrtoint (ptr @isr9 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 10, i32 noundef ptrtoint (ptr @isr10 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 11, i32 noundef ptrtoint (ptr @isr11 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 12, i32 noundef ptrtoint (ptr @isr12 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 13, i32 noundef ptrtoint (ptr @isr13 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 14, i32 noundef ptrtoint (ptr @isr14 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 16, i32 noundef ptrtoint (ptr @isr16 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 17, i32 noundef ptrtoint (ptr @isr17 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 18, i32 noundef ptrtoint (ptr @isr18 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 19, i32 noundef ptrtoint (ptr @isr19 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 20, i32 noundef ptrtoint (ptr @isr20 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 32, i32 noundef ptrtoint (ptr @irq0 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 33, i32 noundef ptrtoint (ptr @irq1 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 34, i32 noundef ptrtoint (ptr @irq2 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 35, i32 noundef ptrtoint (ptr @irq3 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 36, i32 noundef ptrtoint (ptr @irq4 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 37, i32 noundef ptrtoint (ptr @irq5 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 38, i32 noundef ptrtoint (ptr @irq6 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 39, i32 noundef ptrtoint (ptr @irq7 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 40, i32 noundef ptrtoint (ptr @irq8 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 41, i32 noundef ptrtoint (ptr @irq9 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 42, i32 noundef ptrtoint (ptr @irq10 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 43, i32 noundef ptrtoint (ptr @irq11 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 44, i32 noundef ptrtoint (ptr @irq12 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 45, i32 noundef ptrtoint (ptr @irq13 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 46, i32 noundef ptrtoint (ptr @irq14 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext 47, i32 noundef ptrtoint (ptr @irq15 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext -128, i32 noundef ptrtoint (ptr @isr128 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 3, i8 noundef zeroext 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !14
  br label %17

17:                                               ; preds = %24, %16
  %18 = load i32, ptr %4, align 4, !tbaa !14
  %19 = icmp ult i32 %18, 256
  br i1 %19, label %21, label %20

20:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %27

21:                                               ; preds = %17
  %22 = load i32, ptr %4, align 4, !tbaa !14
  %23 = trunc i32 %22 to i8
  call void @_ZN4INTR26register_interrupt_handlerEhPFvPNS_14intr_context_tEE(ptr noundef nonnull align 1 dereferenceable(1) %5, i8 noundef zeroext %23, ptr noundef @_ZL15handler_defaultPN4INTR14intr_context_tE)
  br label %24

24:                                               ; preds = %21
  %25 = load i32, ptr %4, align 4, !tbaa !14
  %26 = add i32 %25, 1
  store i32 %26, ptr %4, align 4, !tbaa !14
  br label %17, !llvm.loop !17

27:                                               ; preds = %20
  call void @_ZN4INTR19init_interrupt_chipEv(ptr noundef nonnull align 1 dereferenceable(1) %5)
  call void @idt_load(i32 noundef ptrtoint (ptr @_ZN4INTR7idt_ptrE to i32))
  %28 = call noundef i32 @_ZN4APIC4initEv()
  %29 = call noundef nonnull align 1 dereferenceable(5) ptr @_ZN8KEYBOARD12get_instanceEv()
  %30 = call noundef i32 @_ZN8KEYBOARD4initEv(ptr noundef nonnull align 1 dereferenceable(5) %29)
  %31 = call i32 (ptr, ...) @info(ptr noundef @.str)
  ret i32 0
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

declare void @isr0() #3

declare void @isr1() #3

declare void @isr2() #3

declare void @isr3() #3

declare void @isr4() #3

declare void @isr5() #3

declare void @isr6() #3

declare void @isr7() #3

declare void @isr8() #3

declare void @isr9() #3

declare void @isr10() #3

declare void @isr11() #3

declare void @isr12() #3

declare void @isr13() #3

declare void @isr14() #3

declare void @isr16() #3

declare void @isr17() #3

declare void @isr18() #3

declare void @isr19() #3

declare void @isr20() #3

declare void @irq0() #3

declare void @irq1() #3

declare void @irq2() #3

declare void @irq3() #3

declare void @irq4() #3

declare void @irq5() #3

declare void @irq6() #3

declare void @irq7() #3

declare void @irq8() #3

declare void @irq9() #3

declare void @irq10() #3

declare void @irq11() #3

declare void @irq12() #3

declare void @irq13() #3

declare void @irq14() #3

declare void @irq15() #3

declare void @isr128() #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4INTR26register_interrupt_handlerEhPFvPNS_14intr_context_tEE(ptr noundef nonnull align 1 dereferenceable(1), i8 noundef zeroext, ptr noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL15handler_defaultPN4INTR14intr_context_tE(ptr noundef) #0

declare void @idt_load(i32 noundef) #3

declare noundef i32 @_ZN4APIC4initEv() #3

declare noundef nonnull align 1 dereferenceable(5) ptr @_ZN8KEYBOARD12get_instanceEv() #3

declare noundef i32 @_ZN8KEYBOARD4initEv(ptr noundef nonnull align 1 dereferenceable(5)) #3

declare i32 @info(ptr noundef, ...) #3

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN4INTR9idt_ptr_tE", !11, i64 0, !12, i64 2}
!11 = !{!"short", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !12, i64 2}
!14 = !{!12, !12, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.INTR::idt_entry32_t" = type { i64 }
%"struct.INTR::idt_ptr_t" = type <{ i16, i32 }>

@_ZN4INTR11idt_entry32E = external dso_local global [256 x %"struct.INTR::idt_entry32_t"], align 16
@_ZN4INTR7idt_ptrE = external dso_local global %"struct.INTR::idt_ptr_t", align 1
@.str = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1), i8 noundef zeroext, i32 noundef, i16 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4INTR19init_interrupt_chipEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4INTR4initEv(ptr noundef nonnull align 1 dereferenceable(1) %0) local_unnamed_addr #1 align 2 {
  store i16 2047, ptr @_ZN4INTR7idt_ptrE, align 1, !tbaa !5
  store i32 ptrtoint (ptr @_ZN4INTR11idt_entry32E to i32), ptr getelementptr inbounds (i8, ptr @_ZN4INTR7idt_ptrE, i64 2), align 1, !tbaa !11
  br label %3

2:                                                ; preds = %3
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 0, i32 noundef ptrtoint (ptr @isr0 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 1, i32 noundef ptrtoint (ptr @isr1 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 2, i32 noundef ptrtoint (ptr @isr2 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 3, i32 noundef ptrtoint (ptr @isr3 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 4, i32 noundef ptrtoint (ptr @isr4 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 5, i32 noundef ptrtoint (ptr @isr5 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 6, i32 noundef ptrtoint (ptr @isr6 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 7, i32 noundef ptrtoint (ptr @isr7 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 8, i32 noundef ptrtoint (ptr @isr8 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 9, i32 noundef ptrtoint (ptr @isr9 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 10, i32 noundef ptrtoint (ptr @isr10 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 11, i32 noundef ptrtoint (ptr @isr11 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 12, i32 noundef ptrtoint (ptr @isr12 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 13, i32 noundef ptrtoint (ptr @isr13 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 14, i32 noundef ptrtoint (ptr @isr14 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 16, i32 noundef ptrtoint (ptr @isr16 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 17, i32 noundef ptrtoint (ptr @isr17 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 18, i32 noundef ptrtoint (ptr @isr18 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 19, i32 noundef ptrtoint (ptr @isr19 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 20, i32 noundef ptrtoint (ptr @isr20 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 32, i32 noundef ptrtoint (ptr @irq0 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 33, i32 noundef ptrtoint (ptr @irq1 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 34, i32 noundef ptrtoint (ptr @irq2 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 35, i32 noundef ptrtoint (ptr @irq3 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 36, i32 noundef ptrtoint (ptr @irq4 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 37, i32 noundef ptrtoint (ptr @irq5 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 38, i32 noundef ptrtoint (ptr @irq6 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 39, i32 noundef ptrtoint (ptr @irq7 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 40, i32 noundef ptrtoint (ptr @irq8 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 41, i32 noundef ptrtoint (ptr @irq9 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 42, i32 noundef ptrtoint (ptr @irq10 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 43, i32 noundef ptrtoint (ptr @irq11 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 44, i32 noundef ptrtoint (ptr @irq12 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 45, i32 noundef ptrtoint (ptr @irq13 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 46, i32 noundef ptrtoint (ptr @irq14 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext 47, i32 noundef ptrtoint (ptr @irq15 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext -128, i32 noundef ptrtoint (ptr @isr128 to i32), i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 3, i8 noundef zeroext 1)
  br label %11

3:                                                ; preds = %1, %3
  %.067 = phi i32 [ 0, %1 ], [ %5, %3 ]
  %4 = trunc nuw i32 %.067 to i8
  tail call void @_ZN4INTR7set_idtEhjthhh(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext %4, i32 noundef 0, i16 noundef zeroext 8, i8 noundef zeroext 14, i8 noundef zeroext 0, i8 noundef zeroext 1)
  %5 = add nuw nsw i32 %.067, 1
  %exitcond.not = icmp eq i32 %5, 256
  br i1 %exitcond.not, label %2, label %3, !llvm.loop !12

6:                                                ; preds = %11
  tail call void @_ZN4INTR19init_interrupt_chipEv(ptr noundef nonnull align 1 dereferenceable(1) %0)
  tail call void @idt_load(i32 noundef ptrtoint (ptr @_ZN4INTR7idt_ptrE to i32))
  %7 = tail call noundef i32 @_ZN4APIC4initEv()
  %8 = tail call noundef nonnull align 1 dereferenceable(5) ptr @_ZN8KEYBOARD12get_instanceEv()
  %9 = tail call noundef i32 @_ZN8KEYBOARD4initEv(ptr noundef nonnull align 1 dereferenceable(5) %8)
  %10 = tail call i32 (ptr, ...) @info(ptr noundef nonnull @.str)
  ret i32 0

11:                                               ; preds = %2, %11
  %.08 = phi i32 [ 0, %2 ], [ %13, %11 ]
  %12 = trunc nuw i32 %.08 to i8
  tail call void @_ZN4INTR26register_interrupt_handlerEhPFvPNS_14intr_context_tEE(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef zeroext %12, ptr noundef nonnull @_ZL15handler_defaultPN4INTR14intr_context_tE)
  %13 = add nuw nsw i32 %.08, 1
  %exitcond9.not = icmp eq i32 %13, 256
  br i1 %exitcond9.not, label %6, label %11, !llvm.loop !14
}

declare void @isr0() #2

declare void @isr1() #2

declare void @isr2() #2

declare void @isr3() #2

declare void @isr4() #2

declare void @isr5() #2

declare void @isr6() #2

declare void @isr7() #2

declare void @isr8() #2

declare void @isr9() #2

declare void @isr10() #2

declare void @isr11() #2

declare void @isr12() #2

declare void @isr13() #2

declare void @isr14() #2

declare void @isr16() #2

declare void @isr17() #2

declare void @isr18() #2

declare void @isr19() #2

declare void @isr20() #2

declare void @irq0() #2

declare void @irq1() #2

declare void @irq2() #2

declare void @irq3() #2

declare void @irq4() #2

declare void @irq5() #2

declare void @irq6() #2

declare void @irq7() #2

declare void @irq8() #2

declare void @irq9() #2

declare void @irq10() #2

declare void @irq11() #2

declare void @irq12() #2

declare void @irq13() #2

declare void @irq14() #2

declare void @irq15() #2

declare void @isr128() #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4INTR26register_interrupt_handlerEhPFvPNS_14intr_context_tEE(ptr noundef nonnull align 1 dereferenceable(1), i8 noundef zeroext, ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL15handler_defaultPN4INTR14intr_context_tE(ptr noundef) #0

declare void @idt_load(i32 noundef) local_unnamed_addr #2

declare noundef i32 @_ZN4APIC4initEv() local_unnamed_addr #2

declare noundef nonnull align 1 dereferenceable(5) ptr @_ZN8KEYBOARD12get_instanceEv() local_unnamed_addr #2

declare noundef i32 @_ZN8KEYBOARD4initEv(ptr noundef nonnull align 1 dereferenceable(5)) local_unnamed_addr #2

declare i32 @info(ptr noundef, ...) local_unnamed_addr #2

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN4INTR9idt_ptr_tE", !7, i64 0, !10, i64 2}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 2}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass