; LLVM IR from clangen/musikcube :: src/3rdparty/win32_src/pdcurses (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 { i32, i32, [9 x i16], i32 }
%struct.MEVENT = type { i16, i32, i32, i32, i64 }
%struct.SCREEN = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i16, i32, i32, i32, i32, i32, i32, i64, i32, i32, ptr, i32, i32, i32, i8, i32, i64, i8, i8, %struct.MOUSE_STATUS, i16, i64, ptr, ptr, i8, i8, i32, i32, ptr, i32, i32, ptr, i32, i32, ptr }

@SP = external global ptr, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [91 x i8], align 1
@Mouse_status = external global %struct.MOUSE_STATUS, align 4
@__PRETTY_FUNCTION__.nc_getmouse = external hidden unnamed_addr constant [26 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@ungot = external hidden global i8, align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @request_mouse_pos() #1

; 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

; Function Attrs: nounwind uwtable
define dso_local i32 @nc_getmouse(ptr noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i16, align 2
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  store i64 0, ptr %5, align 8, !tbaa !9
  %9 = load ptr, ptr @SP, align 8, !tbaa !5
  %10 = icmp ne ptr %9, null
  br i1 %10, label %11, label %12

11:                                               ; preds = %1
  br label %13

12:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 326, ptr noundef @__PRETTY_FUNCTION__.nc_getmouse) #4
  unreachable

13:                                               ; preds = %11
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %17

16:                                               ; preds = %13
  br label %18

17:                                               ; preds = %13
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 327, ptr noundef @__PRETTY_FUNCTION__.nc_getmouse) #4
  unreachable

18:                                               ; preds = %16
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %24

21:                                               ; preds = %18
  %22 = load ptr, ptr @SP, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %25, label %24

24:                                               ; preds = %21, %18
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %191

25:                                               ; preds = %21
  store i8 0, ptr @ungot, align 1, !tbaa !11
  %26 = call i32 @request_mouse_pos()
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.MEVENT, ptr %27, i32 0, i32 0
  store i16 0, ptr %28, align 8, !tbaa !13
  %29 = load i32, ptr @Mouse_status, align 4, !tbaa !17
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.MEVENT, ptr %30, i32 0, i32 1
  store i32 %29, ptr %31, align 4, !tbaa !19
  %32 = load i32, ptr getelementptr inbounds (%struct.MOUSE_STATUS, ptr @Mouse_status, i32 0, i32 1), align 4, !tbaa !20
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.MEVENT, ptr %33, i32 0, i32 2
  store i32 %32, ptr %34, align 8, !tbaa !21
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.MEVENT, ptr %35, i32 0, i32 3
  store i32 0, ptr %36, align 4, !tbaa !22
  store i32 0, ptr %4, align 4, !tbaa !23
  br label %37

37:                                               ; preds = %111, %25
  %38 = load i32, ptr %4, align 4, !tbaa !23
  %39 = icmp slt i32 %38, 3
  br i1 %39, label %40, label %114

40:                                               ; preds = %37
  %41 = load i32, ptr getelementptr inbounds (%struct.MOUSE_STATUS, ptr @Mouse_status, i32 0, i32 3), align 4, !tbaa !24
  %42 = load i32, ptr %4, align 4, !tbaa !23
  %43 = shl i32 1, %42
  %44 = and i32 %41, %43
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %110

46:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %47 = load i32, ptr %4, align 4, !tbaa !23
  %48 = mul nsw i32 %47, 6
  store i32 %48, ptr %7, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #3
  %49 = load i32, ptr %4, align 4, !tbaa !23
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [9 x i16], ptr getelementptr inbounds (%struct.MOUSE_STATUS, ptr @Mouse_status, i32 0, i32 2), i64 0, i64 %50
  %52 = load i16, ptr %51, align 2, !tbaa !25
  %53 = sext i16 %52 to i32
  %54 = and i32 %53, 7
  %55 = trunc i32 %54 to i16
  store i16 %55, ptr %8, align 2, !tbaa !25
  %56 = load i16, ptr %8, align 2, !tbaa !25
  %57 = sext i16 %56 to i32
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %65

59:                                               ; preds = %46
  %60 = load i32, ptr %7, align 4, !tbaa !23
  %61 = zext i32 %60 to i64
  %62 = shl i64 1, %61
  %63 = load i64, ptr %5, align 8, !tbaa !9
  %64 = or i64 %63, %62
  store i64 %64, ptr %5, align 8, !tbaa !9
  br label %109

65:                                               ; preds = %46
  %66 = load i16, ptr %8, align 2, !tbaa !25
  %67 = sext i16 %66 to i32
  %68 = icmp eq i32 %67, 1
  br i1 %68, label %69, label %75

69:                                               ; preds = %65
  %70 = load i32, ptr %7, align 4, !tbaa !23
  %71 = zext i32 %70 to i64
  %72 = shl i64 2, %71
  %73 = load i64, ptr %5, align 8, !tbaa !9
  %74 = or i64 %73, %72
  store i64 %74, ptr %5, align 8, !tbaa !9
  br label %108

75:                                               ; preds = %65
  %76 = load i16, ptr %8, align 2, !tbaa !25
  %77 = sext i16 %76 to i32
  %78 = icmp eq i32 %77, 2
  br i1 %78, label %79, label %85

79:                                               ; preds = %75
  %80 = load i32, ptr %7, align 4, !tbaa !23
  %81 = zext i32 %80 to i64
  %82 = shl i64 4, %81
  %83 = load i64, ptr %5, align 8, !tbaa !9
  %84 = or i64 %83, %82
  store i64 %84, ptr %5, align 8, !tbaa !9
  br label %107

85:                                               ; preds = %75
  %86 = load i16, ptr %8, align 2, !tbaa !25
  %87 = sext i16 %86 to i32
  %88 = icmp eq i32 %87, 3
  br i1 %88, label %89, label %95

89:                                               ; preds = %85
  %90 = load i32, ptr %7, align 4, !tbaa !23
  %91 = zext i32 %90 to i64
  %92 = shl i64 8, %91
  %93 = load i64, ptr %5, align 8, !tbaa !9
  %94 = or i64 %93, %92
  store i64 %94, ptr %5, align 8, !tbaa !9
  br label %106

95:                                               ; preds = %85
  %96 = load i16, ptr %8, align 2, !tbaa !25
  %97 = sext i16 %96 to i32
  %98 = icmp eq i32 %97, 4
  br i1 %98, label %99, label %105

99:                                               ; preds = %95
  %100 = load i32, ptr %7, align 4, !tbaa !23
  %101 = zext i32 %100 to i64
  %102 = shl i64 16, %101
  %103 = load i64, ptr %5, align 8, !tbaa !9
  %104 = or i64 %103, %102
  store i64 %104, ptr %5, align 8, !tbaa !9
  br label %105

105:                                              ; preds = %99, %95
  br label %106

106:                                              ; preds = %105, %89
  br label %107

107:                                              ; preds = %106, %79
  br label %108

108:                                              ; preds = %107, %69
  br label %109

109:                                              ; preds = %108, %59
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %110

110:                                              ; preds = %109, %40
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %4, align 4, !tbaa !23
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %4, align 4, !tbaa !23
  br label %37, !llvm.loop !26

114:                                              ; preds = %37
  %115 = load i32, ptr getelementptr inbounds (%struct.MOUSE_STATUS, ptr @Mouse_status, i32 0, i32 3), align 4, !tbaa !24
  %116 = and i32 %115, 32
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %121

118:                                              ; preds = %114
  %119 = load i64, ptr %5, align 8, !tbaa !9
  %120 = or i64 %119, 524288
  store i64 %120, ptr %5, align 8, !tbaa !9
  br label %129

121:                                              ; preds = %114
  %122 = load i32, ptr getelementptr inbounds (%struct.MOUSE_STATUS, ptr @Mouse_status, i32 0, i32 3), align 4, !tbaa !24
  %123 = and i32 %122, 64
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %128

125:                                              ; preds = %121
  %126 = load i64, ptr %5, align 8, !tbaa !9
  %127 = or i64 %126, 33554432
  store i64 %127, ptr %5, align 8, !tbaa !9
  br label %128

128:                                              ; preds = %125, %121
  br label %129

129:                                              ; preds = %128, %118
  %130 = load i32, ptr getelementptr inbounds (%struct.MOUSE_STATUS, ptr @Mouse_status, i32 0, i32 3), align 4, !tbaa !24
  %131 = and i32 %130, 8
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %142

133:                                              ; preds = %129
  %134 = load ptr, ptr @SP, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.SCREEN, ptr %134, i32 0, i32 18
  %136 = load i64, ptr %135, align 8, !tbaa !28
  %137 = and i64 %136, 17179869184
  %138 = icmp ne i64 %137, 0
  br i1 %138, label %139, label %142

139:                                              ; preds = %133
  %140 = load i64, ptr %5, align 8, !tbaa !9
  %141 = or i64 %140, 17179869184
  store i64 %141, ptr %5, align 8, !tbaa !9
  br label %142

142:                                              ; preds = %139, %133, %129
  store i32 0, ptr %4, align 4, !tbaa !23
  br label %143

143:                                              ; preds = %180, %142
  %144 = load i32, ptr %4, align 4, !tbaa !23
  %145 = icmp slt i32 %144, 3
  br i1 %145, label %146, label %183

146:                                              ; preds = %143
  %147 = load i32, ptr %4, align 4, !tbaa !23
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [9 x i16], ptr getelementptr inbounds (%struct.MOUSE_STATUS, ptr @Mouse_status, i32 0, i32 2), i64 0, i64 %148
  %150 = load i16, ptr %149, align 2, !tbaa !25
  %151 = sext i16 %150 to i32
  %152 = and i32 %151, 8
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %154, label %157

154:                                              ; preds = %146
  %155 = load i64, ptr %5, align 8, !tbaa !9
  %156 = or i64 %155, 2147483648
  store i64 %156, ptr %5, align 8, !tbaa !9
  br label %157

157:                                              ; preds = %154, %146
  %158 = load i32, ptr %4, align 4, !tbaa !23
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [9 x i16], ptr getelementptr inbounds (%struct.MOUSE_STATUS, ptr @Mouse_status, i32 0, i32 2), i64 0, i64 %159
  %161 = load i16, ptr %160, align 2, !tbaa !25
  %162 = sext i16 %161 to i32
  %163 = and i32 %162, 16
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %168

165:                                              ; preds = %157
  %166 = load i64, ptr %5, align 8, !tbaa !9
  %167 = or i64 %166, 4294967296
  store i64 %167, ptr %5, align 8, !tbaa !9
  br label %168

168:                                              ; preds = %165, %157
  %169 = load i32, ptr %4, align 4, !tbaa !23
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [9 x i16], ptr getelementptr inbounds (%struct.MOUSE_STATUS, ptr @Mouse_status, i32 0, i32 2), i64 0, i64 %170
  %172 = load i16, ptr %171, align 2, !tbaa !25
  %173 = sext i16 %172 to i32
  %174 = and i32 %173, 32
  %175 = icmp ne i32 %174, 0
  br i1 %175, label %176, label %179

176:                                              ; preds = %168
  %177 = load i64, ptr %5, align 8, !tbaa !9
  %178 = or i64 %177, 8589934592
  store i64 %178, ptr %5, align 8, !tbaa !9
  br label %179

179:                                              ; preds = %176, %168
  br label %180

180:                                              ; preds = %179
  %181 = load i32, ptr %4, align 4, !tbaa !23
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %4, align 4, !tbaa !23
  br label %143, !llvm.loop !30

183:                                              ; preds = %143
  %184 = load i64, ptr %5, align 8, !tbaa !9
  %185 = load ptr, ptr @SP, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.SCREEN, ptr %185, i32 0, i32 18
  %187 = load i64, ptr %186, align 8, !tbaa !28
  %188 = and i64 %184, %187
  %189 = load ptr, ptr %3, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.MEVENT, ptr %189, i32 0, i32 4
  store i64 %188, ptr %190, align 8, !tbaa !31
  store i32 0, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %191

191:                                              ; preds = %183, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %192 = load i32, ptr %2, align 4
  ret i32 %192
}

attributes #0 = { noreturn nounwind "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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind }
attributes #4 = { noreturn 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"", !15, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !10, i64 16}
!15 = !{!"short", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!18, !16, i64 0}
!18 = !{!"", !16, i64 0, !16, i64 4, !7, i64 8, !16, i64 28}
!19 = !{!14, !16, i64 4}
!20 = !{!18, !16, i64 4}
!21 = !{!14, !16, i64 8}
!22 = !{!14, !16, i64 12}
!23 = !{!16, !16, i64 0}
!24 = !{!18, !16, i64 28}
!25 = !{!15, !15, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!29, !10, i64 40}
!29 = !{!"", !12, i64 0, !12, i64 1, !12, i64 2, !12, i64 3, !12, i64 4, !12, i64 5, !12, i64 6, !12, i64 7, !12, i64 8, !12, i64 9, !15, i64 10, !15, i64 12, !16, i64 16, !16, i64 20, !16, i64 24, !16, i64 28, !16, i64 32, !16, i64 36, !10, i64 40, !16, i64 48, !16, i64 52, !6, i64 56, !16, i64 64, !16, i64 68, !16, i64 72, !12, i64 76, !16, i64 80, !10, i64 88, !12, i64 96, !12, i64 97, !18, i64 100, !15, i64 132, !10, i64 136, !6, i64 144, !6, i64 152, !12, i64 160, !12, i64 161, !16, i64 164, !16, i64 168, !6, i64 176, !16, i64 184, !16, i64 188, !6, i64 192, !16, i64 200, !16, i64 204, !6, i64 208}
!30 = distinct !{!30, !27}
!31 = !{!14, !10, i64 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.MOUSE_STATUS = type { i32, i32, [9 x i16], i32 }

@SP = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [91 x i8], align 1
@Mouse_status = external local_unnamed_addr global %struct.MOUSE_STATUS, align 4
@__PRETTY_FUNCTION__.nc_getmouse = external hidden unnamed_addr constant [26 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@ungot = external hidden local_unnamed_addr global i8, align 1
@switch.table.nc_getmouse = private unnamed_addr constant [5 x i64] [i64 1, i64 2, i64 4, i64 8, i64 16], align 8

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @request_mouse_pos() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @nc_getmouse(ptr noundef writeonly %0) local_unnamed_addr #1 {
  %2 = load ptr, ptr @SP, align 8
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %3, label %4

3:                                                ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 326, ptr noundef nonnull @__PRETTY_FUNCTION__.nc_getmouse) #2
  unreachable

4:                                                ; preds = %1
  %.not45 = icmp eq ptr %0, null
  br i1 %.not45, label %5, label %6

5:                                                ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 327, ptr noundef nonnull @__PRETTY_FUNCTION__.nc_getmouse) #2
  unreachable

6:                                                ; preds = %4
  store i8 0, ptr @ungot, align 1, !tbaa !5
  %7 = tail call i32 @request_mouse_pos()
  store i16 0, ptr %0, align 8, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %0, i64 4
  %9 = load <2 x i32>, ptr @Mouse_status, align 4, !tbaa !14
  store <2 x i32> %9, ptr %8, align 4, !tbaa !14
  %10 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 0, ptr %10, align 4, !tbaa !15
  %11 = load i32, ptr getelementptr inbounds (i8, ptr @Mouse_status, i64 28), align 4, !tbaa !16
  %12 = and i32 %11, 1
  %.not53 = icmp eq i32 %12, 0
  br i1 %.not53, label %18, label %13

13:                                               ; preds = %6
  %14 = load i16, ptr getelementptr inbounds (i8, ptr @Mouse_status, i64 8), align 4, !tbaa !18
  %15 = and i16 %14, 7
  %16 = icmp ult i16 %15, 5
  br i1 %16, label %switch.lookup, label %18

switch.lookup:                                    ; preds = %13
  %17 = zext nneg i16 %15 to i64
  %switch.gep = getelementptr inbounds [5 x i64], ptr @switch.table.nc_getmouse, i64 0, i64 %17
  %switch.load = load i64, ptr %switch.gep, align 8
  br label %18

18:                                               ; preds = %switch.lookup, %13, %6
  %.2 = phi i64 [ 0, %6 ], [ 0, %13 ], [ %switch.load, %switch.lookup ]
  %19 = and i32 %11, 2
  %.not53.1 = icmp eq i32 %19, 0
  br i1 %.not53.1, label %33, label %20

20:                                               ; preds = %18
  %21 = load i16, ptr getelementptr inbounds (i8, ptr @Mouse_status, i64 10), align 2, !tbaa !18
  %22 = and i16 %21, 7
  switch i16 %22, label %33 [
    i16 0, label %31
    i16 1, label %29
    i16 2, label %27
    i16 3, label %25
    i16 4, label %23
  ]

23:                                               ; preds = %20
  %24 = or disjoint i64 %.2, 1024
  br label %33

25:                                               ; preds = %20
  %26 = or disjoint i64 %.2, 512
  br label %33

27:                                               ; preds = %20
  %28 = or disjoint i64 %.2, 256
  br label %33

29:                                               ; preds = %20
  %30 = or disjoint i64 %.2, 128
  br label %33

31:                                               ; preds = %20
  %32 = or disjoint i64 %.2, 64
  br label %33

33:                                               ; preds = %31, %29, %27, %25, %23, %20, %18
  %.2.1 = phi i64 [ %.2, %18 ], [ %32, %31 ], [ %30, %29 ], [ %28, %27 ], [ %26, %25 ], [ %24, %23 ], [ %.2, %20 ]
  %34 = and i32 %11, 4
  %.not53.2 = icmp eq i32 %34, 0
  br i1 %.not53.2, label %._crit_edge, label %35

35:                                               ; preds = %33
  %36 = load i16, ptr getelementptr inbounds (i8, ptr @Mouse_status, i64 12), align 4, !tbaa !18
  %37 = and i16 %36, 7
  switch i16 %37, label %._crit_edge [
    i16 0, label %46
    i16 1, label %44
    i16 2, label %42
    i16 3, label %40
    i16 4, label %38
  ]

38:                                               ; preds = %35
  %39 = or i64 %.2.1, 65536
  br label %._crit_edge

40:                                               ; preds = %35
  %41 = or i64 %.2.1, 32768
  br label %._crit_edge

42:                                               ; preds = %35
  %43 = or i64 %.2.1, 16384
  br label %._crit_edge

44:                                               ; preds = %35
  %45 = or i64 %.2.1, 8192
  br label %._crit_edge

46:                                               ; preds = %35
  %47 = or i64 %.2.1, 4096
  br label %._crit_edge

._crit_edge:                                      ; preds = %46, %44, %42, %40, %38, %35, %33
  %.2.2 = phi i64 [ %.2.1, %33 ], [ %47, %46 ], [ %45, %44 ], [ %43, %42 ], [ %41, %40 ], [ %39, %38 ], [ %.2.1, %35 ]
  %48 = and i32 %11, 32
  %.not46 = icmp eq i32 %48, 0
  %49 = shl i32 %11, 19
  %50 = and i32 %49, 33554432
  %narrow = select i1 %.not46, i32 %50, i32 524288
  %.3.v = zext nneg i32 %narrow to i64
  %.3 = or i64 %.2.2, %.3.v
  %51 = and i32 %11, 8
  %.not48 = icmp eq i32 %51, 0
  %.pre = load ptr, ptr @SP, align 8, !tbaa !19
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre, i64 40
  %.pre62 = load i64, ptr %.phi.trans.insert, align 8, !tbaa !21
  %52 = and i64 %.pre62, 17179869184
  %spec.select54 = select i1 %.not48, i64 0, i64 %52
  %.4 = or i64 %.3, %spec.select54
  %53 = load i16, ptr getelementptr inbounds (i8, ptr @Mouse_status, i64 8), align 4, !tbaa !18
  %54 = load i16, ptr getelementptr inbounds (i8, ptr @Mouse_status, i64 10), align 2, !tbaa !18
  %55 = or i16 %53, %54
  %56 = load i16, ptr getelementptr inbounds (i8, ptr @Mouse_status, i64 12), align 4, !tbaa !18
  %57 = or i16 %55, %56
  %58 = and i16 %57, 56
  %59 = zext nneg i16 %58 to i64
  %60 = shl nuw nsw i64 %59, 28
  %.8.2 = or i64 %60, %.4
  %61 = and i64 %.pre62, %.8.2
  %62 = getelementptr inbounds i8, ptr %0, i64 16
  store i64 %61, ptr %62, align 8, !tbaa !23
  ret i32 0
}

attributes #0 = { noreturn nounwind "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 = { 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 = { noreturn 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 = !{!"_Bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !13, i64 16}
!11 = !{!"short", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !12, i64 0}
!15 = !{!10, !12, i64 12}
!16 = !{!17, !12, i64 28}
!17 = !{!"", !12, i64 0, !12, i64 4, !7, i64 8, !12, i64 28}
!18 = !{!11, !11, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"any pointer", !7, i64 0}
!21 = !{!22, !13, i64 40}
!22 = !{!"", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !6, i64 4, !6, i64 5, !6, i64 6, !6, i64 7, !6, i64 8, !6, i64 9, !11, i64 10, !11, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !13, i64 40, !12, i64 48, !12, i64 52, !20, i64 56, !12, i64 64, !12, i64 68, !12, i64 72, !6, i64 76, !12, i64 80, !13, i64 88, !6, i64 96, !6, i64 97, !17, i64 100, !11, i64 132, !13, i64 136, !20, i64 144, !20, i64 152, !6, i64 160, !6, i64 161, !12, i64 164, !12, i64 168, !20, i64 176, !12, i64 184, !12, i64 188, !20, i64 192, !12, i64 200, !12, i64 204, !20, i64 208}
!23 = !{!10, !13, i64 16}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass