; LLVM IR from xing1357/SimpleOS :: src (mouse)

; 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.MOUSE_STATUS = type { i8 }

@g_mouse_x_pos = external dso_local global i32, align 4
@g_mouse_y_pos = external dso_local global i32, align 4
@prev_x = external dso_local global i32, align 4
@prev_y = external dso_local global i32, align 4
@g_status = external dso_local global %struct.MOUSE_STATUS, align 1
@mouse_handler.mouse_cycle = external hidden global i8, align 1
@mouse_handler.mouse_byte = external hidden global [3 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @mouse_read() #1

; Function Attrs: nounwind uwtable
declare dso_local void @get_mouse_status(i8 noundef signext, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @mouse_handler(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load i32, ptr @prev_x, align 4, !tbaa !9
  %8 = load i32, ptr @prev_y, align 4, !tbaa !9
  %9 = call i32 @vbe_rgb(i8 noundef zeroext 0, i8 noundef zeroext 0, i8 noundef zeroext 0)
  call void @bitmap_draw_char(i8 noundef signext 88, i32 noundef %7, i32 noundef %8, i32 noundef %9)
  %10 = load i8, ptr @mouse_handler.mouse_cycle, align 1, !tbaa !11
  %11 = zext i8 %10 to i32
  switch i32 %11, label %84 [
    i32 0, label %12
    i32 1, label %17
    i32 2, label %21
  ]

12:                                               ; preds = %1
  %13 = call zeroext i8 @mouse_read()
  store i8 %13, ptr @mouse_handler.mouse_byte, align 1, !tbaa !11
  %14 = load i8, ptr @mouse_handler.mouse_byte, align 1, !tbaa !11
  call void @get_mouse_status(i8 noundef signext %14, ptr noundef @g_status)
  %15 = load i8, ptr @mouse_handler.mouse_cycle, align 1, !tbaa !11
  %16 = add i8 %15, 1
  store i8 %16, ptr @mouse_handler.mouse_cycle, align 1, !tbaa !11
  br label %84

17:                                               ; preds = %1
  %18 = call zeroext i8 @mouse_read()
  store i8 %18, ptr getelementptr inbounds ([3 x i8], ptr @mouse_handler.mouse_byte, i64 0, i64 1), align 1, !tbaa !11
  %19 = load i8, ptr @mouse_handler.mouse_cycle, align 1, !tbaa !11
  %20 = add i8 %19, 1
  store i8 %20, ptr @mouse_handler.mouse_cycle, align 1, !tbaa !11
  br label %84

21:                                               ; preds = %1
  %22 = call zeroext i8 @mouse_read()
  store i8 %22, ptr getelementptr inbounds ([3 x i8], ptr @mouse_handler.mouse_byte, i64 0, i64 2), align 1, !tbaa !11
  %23 = load i32, ptr @g_mouse_x_pos, align 4, !tbaa !9
  %24 = load i8, ptr getelementptr inbounds ([3 x i8], ptr @mouse_handler.mouse_byte, i64 0, i64 1), align 1, !tbaa !11
  %25 = sext i8 %24 to i32
  %26 = add nsw i32 %23, %25
  store i32 %26, ptr @g_mouse_x_pos, align 4, !tbaa !9
  %27 = load i32, ptr @g_mouse_y_pos, align 4, !tbaa !9
  %28 = load i8, ptr getelementptr inbounds ([3 x i8], ptr @mouse_handler.mouse_byte, i64 0, i64 2), align 1, !tbaa !11
  %29 = sext i8 %28 to i32
  %30 = sub nsw i32 %27, %29
  store i32 %30, ptr @g_mouse_y_pos, align 4, !tbaa !9
  %31 = load i32, ptr @g_mouse_x_pos, align 4, !tbaa !9
  %32 = icmp slt i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %21
  store i32 0, ptr @g_mouse_x_pos, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %33, %21
  %35 = load i32, ptr @g_mouse_y_pos, align 4, !tbaa !9
  %36 = icmp slt i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %34
  store i32 0, ptr @g_mouse_y_pos, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %37, %34
  %39 = load i32, ptr @g_mouse_x_pos, align 4, !tbaa !9
  %40 = icmp sgt i32 %39, ptrtoint (ptr @vbe_get_width to i32)
  br i1 %40, label %41, label %42

41:                                               ; preds = %38
  store i32 sub nsw (i32 ptrtoint (ptr @vbe_get_width to i32), i32 1), ptr @g_mouse_x_pos, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %41, %38
  %43 = load i32, ptr @g_mouse_y_pos, align 4, !tbaa !9
  %44 = icmp sgt i32 %43, ptrtoint (ptr @vbe_get_height to i32)
  br i1 %44, label %45, label %46

45:                                               ; preds = %42
  store i32 sub nsw (i32 ptrtoint (ptr @vbe_get_height to i32), i32 1), ptr @g_mouse_y_pos, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %45, %42
  %47 = load i32, ptr @g_mouse_x_pos, align 4, !tbaa !9
  %48 = load i32, ptr @g_mouse_y_pos, align 4, !tbaa !9
  %49 = call i32 @vbe_rgb(i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext -1)
  call void @bitmap_draw_char(i8 noundef signext 88, i32 noundef %47, i32 noundef %48, i32 noundef %49)
  %50 = load i32, ptr @g_mouse_x_pos, align 4, !tbaa !9
  store i32 %50, ptr @prev_x, align 4, !tbaa !9
  %51 = load i32, ptr @g_mouse_y_pos, align 4, !tbaa !9
  store i32 %51, ptr @prev_y, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %80, %46
  %53 = load i32, ptr %3, align 4, !tbaa !9
  %54 = icmp slt i32 %53, 8
  br i1 %54, label %56, label %55

55:                                               ; preds = %52
  store i32 3, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %83

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %76, %56
  %58 = load i32, ptr %5, align 4, !tbaa !9
  %59 = icmp slt i32 %58, 8
  br i1 %59, label %61, label %60

60:                                               ; preds = %57
  store i32 6, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %79

61:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %62 = load i32, ptr @prev_x, align 4, !tbaa !9
  %63 = load i32, ptr %3, align 4, !tbaa !9
  %64 = add nsw i32 %62, %63
  %65 = load i32, ptr @prev_y, align 4, !tbaa !9
  %66 = load i32, ptr %5, align 4, !tbaa !9
  %67 = add nsw i32 %65, %66
  %68 = call i32 @vbe_getpixel(i32 noundef %64, i32 noundef %67)
  store i32 %68, ptr %6, align 4, !tbaa !9
  %69 = load i32, ptr @prev_x, align 4, !tbaa !9
  %70 = load i32, ptr %3, align 4, !tbaa !9
  %71 = add nsw i32 %69, %70
  %72 = load i32, ptr @prev_y, align 4, !tbaa !9
  %73 = load i32, ptr %5, align 4, !tbaa !9
  %74 = add nsw i32 %72, %73
  %75 = call i32 @vbe_rgb(i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext -1)
  call void @vbe_putpixel(i32 noundef %71, i32 noundef %74, i32 noundef %75)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %76

76:                                               ; preds = %61
  %77 = load i32, ptr %5, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %5, align 4, !tbaa !9
  br label %57, !llvm.loop !12

79:                                               ; preds = %60
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %3, align 4, !tbaa !9
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %3, align 4, !tbaa !9
  br label %52, !llvm.loop !14

83:                                               ; preds = %55
  store i8 0, ptr @mouse_handler.mouse_cycle, align 1, !tbaa !11
  br label %84

84:                                               ; preds = %83, %17, %12, %1
  call void @isr_end_interrupt(i32 noundef 44)
  ret void
}

declare void @bitmap_draw_char(i8 noundef signext, i32 noundef, i32 noundef, i32 noundef) #2

declare i32 @vbe_rgb(i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) #2

declare i32 @vbe_get_width(...) #2

declare i32 @vbe_get_height(...) #2

declare i32 @vbe_getpixel(i32 noundef, i32 noundef) #2

declare void @vbe_putpixel(i32 noundef, i32 noundef, i32 noundef) #2

declare void @isr_end_interrupt(i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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" }
attributes #3 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


; 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.MOUSE_STATUS = type { i8 }

@g_mouse_x_pos = external dso_local local_unnamed_addr global i32, align 4
@g_mouse_y_pos = external dso_local local_unnamed_addr global i32, align 4
@prev_x = external dso_local local_unnamed_addr global i32, align 4
@prev_y = external dso_local local_unnamed_addr global i32, align 4
@g_status = external dso_local global %struct.MOUSE_STATUS, align 1
@mouse_handler.mouse_cycle = external hidden local_unnamed_addr global i8, align 1
@mouse_handler.mouse_byte = external hidden local_unnamed_addr global [3 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @mouse_read() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @get_mouse_status(i8 noundef signext, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @mouse_handler(ptr nocapture noundef readnone %0) local_unnamed_addr #0 {
  %2 = load i32, ptr @prev_x, align 4, !tbaa !5
  %3 = load i32, ptr @prev_y, align 4, !tbaa !5
  %4 = tail call i32 @vbe_rgb(i8 noundef zeroext 0, i8 noundef zeroext 0, i8 noundef zeroext 0) #2
  tail call void @bitmap_draw_char(i8 noundef signext 88, i32 noundef %2, i32 noundef %3, i32 noundef %4) #2
  %5 = load i8, ptr @mouse_handler.mouse_cycle, align 1, !tbaa !9
  switch i8 %5, label %121 [
    i8 0, label %6
    i8 1, label %10
    i8 2, label %14
  ]

6:                                                ; preds = %1
  %7 = tail call zeroext i8 @mouse_read()
  store i8 %7, ptr @mouse_handler.mouse_byte, align 1, !tbaa !9
  tail call void @get_mouse_status(i8 noundef signext %7, ptr noundef nonnull @g_status)
  %8 = load i8, ptr @mouse_handler.mouse_cycle, align 1, !tbaa !9
  %9 = add i8 %8, 1
  br label %.sink.split

10:                                               ; preds = %1
  %11 = tail call zeroext i8 @mouse_read()
  store i8 %11, ptr getelementptr inbounds (i8, ptr @mouse_handler.mouse_byte, i64 1), align 1, !tbaa !9
  %12 = load i8, ptr @mouse_handler.mouse_cycle, align 1, !tbaa !9
  %13 = add i8 %12, 1
  br label %.sink.split

14:                                               ; preds = %1
  %15 = tail call zeroext i8 @mouse_read()
  store i8 %15, ptr getelementptr inbounds (i8, ptr @mouse_handler.mouse_byte, i64 2), align 1, !tbaa !9
  %16 = load i32, ptr @g_mouse_x_pos, align 4, !tbaa !5
  %17 = load i8, ptr getelementptr inbounds (i8, ptr @mouse_handler.mouse_byte, i64 1), align 1, !tbaa !9
  %18 = sext i8 %17 to i32
  %19 = add nsw i32 %16, %18
  store i32 %19, ptr @g_mouse_x_pos, align 4, !tbaa !5
  %20 = load i32, ptr @g_mouse_y_pos, align 4, !tbaa !5
  %21 = sext i8 %15 to i32
  %22 = sub nsw i32 %20, %21
  store i32 %22, ptr @g_mouse_y_pos, align 4, !tbaa !5
  %23 = icmp slt i32 %19, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %14
  store i32 0, ptr @g_mouse_x_pos, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %24, %14
  %26 = phi i32 [ 0, %24 ], [ %19, %14 ]
  %27 = icmp slt i32 %22, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  store i32 0, ptr @g_mouse_y_pos, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %28, %25
  %30 = phi i32 [ 0, %28 ], [ %22, %25 ]
  %31 = icmp sgt i32 %26, ptrtoint (ptr @vbe_get_width to i32)
  br i1 %31, label %32, label %33

32:                                               ; preds = %29
  store i32 sub (i32 ptrtoint (ptr @vbe_get_width to i32), i32 1), ptr @g_mouse_x_pos, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %32, %29
  %34 = phi i32 [ sub (i32 ptrtoint (ptr @vbe_get_width to i32), i32 1), %32 ], [ %26, %29 ]
  %35 = icmp sgt i32 %30, ptrtoint (ptr @vbe_get_height to i32)
  br i1 %35, label %36, label %37

36:                                               ; preds = %33
  store i32 sub (i32 ptrtoint (ptr @vbe_get_height to i32), i32 1), ptr @g_mouse_y_pos, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %36, %33
  %38 = phi i32 [ sub (i32 ptrtoint (ptr @vbe_get_height to i32), i32 1), %36 ], [ %30, %33 ]
  %39 = tail call i32 @vbe_rgb(i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext -1) #2
  tail call void @bitmap_draw_char(i8 noundef signext 88, i32 noundef %34, i32 noundef %38, i32 noundef %39) #2
  %40 = load i32, ptr @g_mouse_x_pos, align 4, !tbaa !5
  store i32 %40, ptr @prev_x, align 4, !tbaa !5
  %41 = load i32, ptr @g_mouse_y_pos, align 4, !tbaa !5
  store i32 %41, ptr @prev_y, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %37, %.preheader
  %.010 = phi i32 [ 0, %37 ], [ %120, %.preheader ]
  %42 = load i32, ptr @prev_x, align 4, !tbaa !5
  %43 = add nsw i32 %42, %.010
  %44 = load i32, ptr @prev_y, align 4, !tbaa !5
  %45 = tail call i32 @vbe_getpixel(i32 noundef %43, i32 noundef %44) #2
  %46 = load i32, ptr @prev_x, align 4, !tbaa !5
  %47 = add nsw i32 %46, %.010
  %48 = load i32, ptr @prev_y, align 4, !tbaa !5
  %49 = tail call i32 @vbe_rgb(i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext -1) #2
  tail call void @vbe_putpixel(i32 noundef %47, i32 noundef %48, i32 noundef %49) #2
  %50 = load i32, ptr @prev_x, align 4, !tbaa !5
  %51 = add nsw i32 %50, %.010
  %52 = load i32, ptr @prev_y, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  %54 = tail call i32 @vbe_getpixel(i32 noundef %51, i32 noundef %53) #2
  %55 = load i32, ptr @prev_x, align 4, !tbaa !5
  %56 = add nsw i32 %55, %.010
  %57 = load i32, ptr @prev_y, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  %59 = tail call i32 @vbe_rgb(i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext -1) #2
  tail call void @vbe_putpixel(i32 noundef %56, i32 noundef %58, i32 noundef %59) #2
  %60 = load i32, ptr @prev_x, align 4, !tbaa !5
  %61 = add nsw i32 %60, %.010
  %62 = load i32, ptr @prev_y, align 4, !tbaa !5
  %63 = add nsw i32 %62, 2
  %64 = tail call i32 @vbe_getpixel(i32 noundef %61, i32 noundef %63) #2
  %65 = load i32, ptr @prev_x, align 4, !tbaa !5
  %66 = add nsw i32 %65, %.010
  %67 = load i32, ptr @prev_y, align 4, !tbaa !5
  %68 = add nsw i32 %67, 2
  %69 = tail call i32 @vbe_rgb(i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext -1) #2
  tail call void @vbe_putpixel(i32 noundef %66, i32 noundef %68, i32 noundef %69) #2
  %70 = load i32, ptr @prev_x, align 4, !tbaa !5
  %71 = add nsw i32 %70, %.010
  %72 = load i32, ptr @prev_y, align 4, !tbaa !5
  %73 = add nsw i32 %72, 3
  %74 = tail call i32 @vbe_getpixel(i32 noundef %71, i32 noundef %73) #2
  %75 = load i32, ptr @prev_x, align 4, !tbaa !5
  %76 = add nsw i32 %75, %.010
  %77 = load i32, ptr @prev_y, align 4, !tbaa !5
  %78 = add nsw i32 %77, 3
  %79 = tail call i32 @vbe_rgb(i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext -1) #2
  tail call void @vbe_putpixel(i32 noundef %76, i32 noundef %78, i32 noundef %79) #2
  %80 = load i32, ptr @prev_x, align 4, !tbaa !5
  %81 = add nsw i32 %80, %.010
  %82 = load i32, ptr @prev_y, align 4, !tbaa !5
  %83 = add nsw i32 %82, 4
  %84 = tail call i32 @vbe_getpixel(i32 noundef %81, i32 noundef %83) #2
  %85 = load i32, ptr @prev_x, align 4, !tbaa !5
  %86 = add nsw i32 %85, %.010
  %87 = load i32, ptr @prev_y, align 4, !tbaa !5
  %88 = add nsw i32 %87, 4
  %89 = tail call i32 @vbe_rgb(i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext -1) #2
  tail call void @vbe_putpixel(i32 noundef %86, i32 noundef %88, i32 noundef %89) #2
  %90 = load i32, ptr @prev_x, align 4, !tbaa !5
  %91 = add nsw i32 %90, %.010
  %92 = load i32, ptr @prev_y, align 4, !tbaa !5
  %93 = add nsw i32 %92, 5
  %94 = tail call i32 @vbe_getpixel(i32 noundef %91, i32 noundef %93) #2
  %95 = load i32, ptr @prev_x, align 4, !tbaa !5
  %96 = add nsw i32 %95, %.010
  %97 = load i32, ptr @prev_y, align 4, !tbaa !5
  %98 = add nsw i32 %97, 5
  %99 = tail call i32 @vbe_rgb(i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext -1) #2
  tail call void @vbe_putpixel(i32 noundef %96, i32 noundef %98, i32 noundef %99) #2
  %100 = load i32, ptr @prev_x, align 4, !tbaa !5
  %101 = add nsw i32 %100, %.010
  %102 = load i32, ptr @prev_y, align 4, !tbaa !5
  %103 = add nsw i32 %102, 6
  %104 = tail call i32 @vbe_getpixel(i32 noundef %101, i32 noundef %103) #2
  %105 = load i32, ptr @prev_x, align 4, !tbaa !5
  %106 = add nsw i32 %105, %.010
  %107 = load i32, ptr @prev_y, align 4, !tbaa !5
  %108 = add nsw i32 %107, 6
  %109 = tail call i32 @vbe_rgb(i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext -1) #2
  tail call void @vbe_putpixel(i32 noundef %106, i32 noundef %108, i32 noundef %109) #2
  %110 = load i32, ptr @prev_x, align 4, !tbaa !5
  %111 = add nsw i32 %110, %.010
  %112 = load i32, ptr @prev_y, align 4, !tbaa !5
  %113 = add nsw i32 %112, 7
  %114 = tail call i32 @vbe_getpixel(i32 noundef %111, i32 noundef %113) #2
  %115 = load i32, ptr @prev_x, align 4, !tbaa !5
  %116 = add nsw i32 %115, %.010
  %117 = load i32, ptr @prev_y, align 4, !tbaa !5
  %118 = add nsw i32 %117, 7
  %119 = tail call i32 @vbe_rgb(i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext -1) #2
  tail call void @vbe_putpixel(i32 noundef %116, i32 noundef %118, i32 noundef %119) #2
  %120 = add nuw nsw i32 %.010, 1
  %exitcond.not = icmp eq i32 %120, 8
  br i1 %exitcond.not, label %.sink.split, label %.preheader, !llvm.loop !10

.sink.split:                                      ; preds = %.preheader, %6, %10
  %.sink = phi i8 [ %13, %10 ], [ %9, %6 ], [ 0, %.preheader ]
  store i8 %.sink, ptr @mouse_handler.mouse_cycle, align 1, !tbaa !9
  br label %121

121:                                              ; preds = %.sink.split, %1
  tail call void @isr_end_interrupt(i32 noundef 44) #2
  ret void
}

declare void @bitmap_draw_char(i8 noundef signext, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare i32 @vbe_rgb(i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #1

declare i32 @vbe_get_width(...) #1

declare i32 @vbe_get_height(...) #1

declare i32 @vbe_getpixel(i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @vbe_putpixel(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @isr_end_interrupt(i32 noundef) local_unnamed_addr #1

attributes #0 = { 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 = { "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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass