; LLVM IR from jan-van-bergen/GPU-Raytracer :: include/Imgui/imgui_impl_sdl.ll (Z27ImGui_ImplSDL2_ProcessEventPK9SDL_Event)

; 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.SDL_MouseMotionEvent = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.SDL_MouseWheelEvent = type { i32, i32, i32, i32, i32, i32, i32, float, float }
%struct.SDL_MouseButtonEvent = type { i32, i32, i32, i32, i8, i8, i8, i8, i32, i32 }
%struct.ImGui_ImplSDL2_Data = type <{ ptr, ptr, i64, i32, [4 x i8], [9 x ptr], ptr, i8, [7 x i8] }>
%struct.SDL_TextInputEvent = type { i32, i32, i32, [32 x i8] }
%struct.SDL_KeyboardEvent = type { i32, i32, i32, i8, i8, i8, i8, %struct.SDL_Keysym }
%struct.SDL_Keysym = type { i32, i32, i16, i32 }
%struct.SDL_WindowEvent = type { i32, i32, i32, i8, i8, i8, i8, i32, i32 }

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z27ImGui_ImplSDL2_ProcessEventPK9SDL_Event(ptr noundef %0) #0 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %11 = call noundef nonnull align 8 dereferenceable(14160) ptr @_ZN5ImGui5GetIOEv()
  store ptr %11, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %12 = call noundef ptr @_ZL29ImGui_ImplSDL2_GetBackendDatav()
  store ptr %12, ptr %5, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = load i32, ptr %13, align 8, !tbaa !9
  switch i32 %14, label %173 [
    i32 1024, label %15
    i32 1027, label %25
    i32 1025, label %57
    i32 1026, label %57
    i32 771, label %112
    i32 768, label %117
    i32 769, label %117
    i32 512, label %147
  ]

15:                                               ; preds = %1
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.SDL_MouseMotionEvent, ptr %17, i32 0, i32 5
  %19 = load i32, ptr %18, align 4, !tbaa !9
  %20 = sitofp i32 %19 to float
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.SDL_MouseMotionEvent, ptr %21, i32 0, i32 6
  %23 = load i32, ptr %22, align 8, !tbaa !9
  %24 = sitofp i32 %23 to float
  call void @_ZN7ImGuiIO16AddMousePosEventEff(ptr noundef nonnull align 8 dereferenceable(14160) %16, float noundef %20, float noundef %24)
  store i1 true, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %174

25:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.SDL_MouseWheelEvent, ptr %26, i32 0, i32 4
  %28 = load i32, ptr %27, align 8, !tbaa !9
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %30, label %31

30:                                               ; preds = %25
  br label %38

31:                                               ; preds = %25
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.SDL_MouseWheelEvent, ptr %32, i32 0, i32 4
  %34 = load i32, ptr %33, align 8, !tbaa !9
  %35 = icmp slt i32 %34, 0
  %36 = zext i1 %35 to i64
  %37 = select i1 %35, float -1.000000e+00, float 0.000000e+00
  br label %38

38:                                               ; preds = %31, %30
  %39 = phi float [ 1.000000e+00, %30 ], [ %37, %31 ]
  store float %39, ptr %7, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.SDL_MouseWheelEvent, ptr %40, i32 0, i32 5
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %44, label %45

44:                                               ; preds = %38
  br label %52

45:                                               ; preds = %38
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.SDL_MouseWheelEvent, ptr %46, i32 0, i32 5
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = icmp slt i32 %48, 0
  %50 = zext i1 %49 to i64
  %51 = select i1 %49, float -1.000000e+00, float 0.000000e+00
  br label %52

52:                                               ; preds = %45, %44
  %53 = phi float [ 1.000000e+00, %44 ], [ %51, %45 ]
  store float %53, ptr %8, align 4, !tbaa !10
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = load float, ptr %7, align 4, !tbaa !10
  %56 = load float, ptr %8, align 4, !tbaa !10
  call void @_ZN7ImGuiIO18AddMouseWheelEventEff(ptr noundef nonnull align 8 dereferenceable(14160) %54, float noundef %55, float noundef %56)
  store i1 true, ptr %2, align 1
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %174

57:                                               ; preds = %1, %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 -1, ptr %9, align 4, !tbaa !12
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.SDL_MouseButtonEvent, ptr %58, i32 0, i32 4
  %60 = load i8, ptr %59, align 8, !tbaa !9
  %61 = zext i8 %60 to i32
  %62 = icmp eq i32 %61, 1
  br i1 %62, label %63, label %64

63:                                               ; preds = %57
  store i32 0, ptr %9, align 4, !tbaa !12
  br label %64

64:                                               ; preds = %63, %57
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.SDL_MouseButtonEvent, ptr %65, i32 0, i32 4
  %67 = load i8, ptr %66, align 8, !tbaa !9
  %68 = zext i8 %67 to i32
  %69 = icmp eq i32 %68, 3
  br i1 %69, label %70, label %71

70:                                               ; preds = %64
  store i32 1, ptr %9, align 4, !tbaa !12
  br label %71

71:                                               ; preds = %70, %64
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.SDL_MouseButtonEvent, ptr %72, i32 0, i32 4
  %74 = load i8, ptr %73, align 8, !tbaa !9
  %75 = zext i8 %74 to i32
  %76 = icmp eq i32 %75, 2
  br i1 %76, label %77, label %78

77:                                               ; preds = %71
  store i32 2, ptr %9, align 4, !tbaa !12
  br label %78

78:                                               ; preds = %77, %71
  %79 = load i32, ptr %9, align 4, !tbaa !12
  %80 = icmp eq i32 %79, -1
  br i1 %80, label %81, label %82

81:                                               ; preds = %78
  store i32 2, ptr %6, align 4
  br label %110

82:                                               ; preds = %78
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = load i32, ptr %9, align 4, !tbaa !12
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = load i32, ptr %85, align 8, !tbaa !9
  %87 = icmp eq i32 %86, 1025
  call void @_ZN7ImGuiIO19AddMouseButtonEventEib(ptr noundef nonnull align 8 dereferenceable(14160) %83, i32 noundef %84, i1 noundef zeroext %87)
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = load i32, ptr %88, align 8, !tbaa !9
  %90 = icmp eq i32 %89, 1025
  br i1 %90, label %91, label %98

91:                                               ; preds = %82
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.ImGui_ImplSDL2_Data, ptr %92, i32 0, i32 3
  %94 = load i32, ptr %93, align 8, !tbaa !14
  %95 = load i32, ptr %9, align 4, !tbaa !12
  %96 = shl i32 1, %95
  %97 = or i32 %94, %96
  br label %106

98:                                               ; preds = %82
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.ImGui_ImplSDL2_Data, ptr %99, i32 0, i32 3
  %101 = load i32, ptr %100, align 8, !tbaa !14
  %102 = load i32, ptr %9, align 4, !tbaa !12
  %103 = shl i32 1, %102
  %104 = xor i32 %103, -1
  %105 = and i32 %101, %104
  br label %106

106:                                              ; preds = %98, %91
  %107 = phi i32 [ %97, %91 ], [ %105, %98 ]
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.ImGui_ImplSDL2_Data, ptr %108, i32 0, i32 3
  store i32 %107, ptr %109, align 8, !tbaa !14
  store i1 true, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %110

110:                                              ; preds = %106, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  %111 = load i32, ptr %6, align 4
  switch i32 %111, label %174 [
    i32 2, label %173
  ]

112:                                              ; preds = %1
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.SDL_TextInputEvent, ptr %114, i32 0, i32 3
  %116 = getelementptr inbounds [32 x i8], ptr %115, i64 0, i64 0
  call void @_ZN7ImGuiIO22AddInputCharactersUTF8EPKc(ptr noundef nonnull align 8 dereferenceable(14160) %113, ptr noundef %116)
  store i1 true, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %174

117:                                              ; preds = %1, %1
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.SDL_KeyboardEvent, ptr %118, i32 0, i32 7
  %120 = getelementptr inbounds %struct.SDL_Keysym, ptr %119, i32 0, i32 2
  %121 = load i16, ptr %120, align 8, !tbaa !9
  %122 = zext i16 %121 to i32
  call void @_ZL33ImGui_ImplSDL2_UpdateKeyModifiers10SDL_Keymod(i32 noundef %122)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.SDL_KeyboardEvent, ptr %123, i32 0, i32 7
  %125 = getelementptr inbounds %struct.SDL_Keysym, ptr %124, i32 0, i32 1
  %126 = load i32, ptr %125, align 4, !tbaa !9
  %127 = call noundef i32 @_ZL32ImGui_ImplSDL2_KeycodeToImGuiKeyi(i32 noundef %126)
  store i32 %127, ptr %10, align 4, !tbaa !12
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = load i32, ptr %10, align 4, !tbaa !12
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = load i32, ptr %130, align 8, !tbaa !9
  %132 = icmp eq i32 %131, 768
  call void @_ZN7ImGuiIO11AddKeyEventEib(ptr noundef nonnull align 8 dereferenceable(14160) %128, i32 noundef %129, i1 noundef zeroext %132)
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = load i32, ptr %10, align 4, !tbaa !12
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.SDL_KeyboardEvent, ptr %135, i32 0, i32 7
  %137 = getelementptr inbounds %struct.SDL_Keysym, ptr %136, i32 0, i32 1
  %138 = load i32, ptr %137, align 4, !tbaa !9
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.SDL_KeyboardEvent, ptr %139, i32 0, i32 7
  %141 = getelementptr inbounds %struct.SDL_Keysym, ptr %140, i32 0, i32 0
  %142 = load i32, ptr %141, align 8, !tbaa !9
  %143 = load ptr, ptr %3, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.SDL_KeyboardEvent, ptr %143, i32 0, i32 7
  %145 = getelementptr inbounds %struct.SDL_Keysym, ptr %144, i32 0, i32 0
  %146 = load i32, ptr %145, align 8, !tbaa !9
  call void @_ZN7ImGuiIO21SetKeyEventNativeDataEiiii(ptr noundef nonnull align 8 dereferenceable(14160) %133, i32 noundef %134, i32 noundef %138, i32 noundef %142, i32 noundef %146)
  store i1 true, ptr %2, align 1
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %174

147:                                              ; preds = %1
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.SDL_WindowEvent, ptr %148, i32 0, i32 3
  %150 = load i8, ptr %149, align 4, !tbaa !9
  %151 = zext i8 %150 to i32
  %152 = icmp eq i32 %151, 11
  br i1 %152, label %153, label %155

153:                                              ; preds = %147
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN7ImGuiIO16AddMousePosEventEff(ptr noundef nonnull align 8 dereferenceable(14160) %154, float noundef 0xC7EFFFFFE0000000, float noundef 0xC7EFFFFFE0000000)
  br label %155

155:                                              ; preds = %153, %147
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.SDL_WindowEvent, ptr %156, i32 0, i32 3
  %158 = load i8, ptr %157, align 4, !tbaa !9
  %159 = zext i8 %158 to i32
  %160 = icmp eq i32 %159, 12
  br i1 %160, label %161, label %163

161:                                              ; preds = %155
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN7ImGuiIO13AddFocusEventEb(ptr noundef nonnull align 8 dereferenceable(14160) %162, i1 noundef zeroext true)
  br label %172

163:                                              ; preds = %155
  %164 = load ptr, ptr %3, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.SDL_WindowEvent, ptr %164, i32 0, i32 3
  %166 = load i8, ptr %165, align 4, !tbaa !9
  %167 = zext i8 %166 to i32
  %168 = icmp eq i32 %167, 13
  br i1 %168, label %169, label %171

169:                                              ; preds = %163
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN7ImGuiIO13AddFocusEventEb(ptr noundef nonnull align 8 dereferenceable(14160) %170, i1 noundef zeroext false)
  br label %171

171:                                              ; preds = %169, %163
  br label %172

172:                                              ; preds = %171, %161
  store i1 true, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %174

173:                                              ; preds = %110, %1
  store i1 false, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %174

174:                                              ; preds = %173, %172, %117, %112, %110, %52, %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %175 = load i1, ptr %2, align 1
  ret i1 %175
}

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

declare noundef nonnull align 8 dereferenceable(14160) ptr @_ZN5ImGui5GetIOEv() #2

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL29ImGui_ImplSDL2_GetBackendDatav() #0

declare void @_ZN7ImGuiIO16AddMousePosEventEff(ptr noundef nonnull align 8 dereferenceable(14160), float noundef, float noundef) #2

declare void @_ZN7ImGuiIO18AddMouseWheelEventEff(ptr noundef nonnull align 8 dereferenceable(14160), float noundef, float noundef) #2

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

declare void @_ZN7ImGuiIO19AddMouseButtonEventEib(ptr noundef nonnull align 8 dereferenceable(14160), i32 noundef, i1 noundef zeroext) #2

declare void @_ZN7ImGuiIO22AddInputCharactersUTF8EPKc(ptr noundef nonnull align 8 dereferenceable(14160), ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL33ImGui_ImplSDL2_UpdateKeyModifiers10SDL_Keymod(i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL32ImGui_ImplSDL2_KeycodeToImGuiKeyi(i32 noundef) #3

declare void @_ZN7ImGuiIO11AddKeyEventEib(ptr noundef nonnull align 8 dereferenceable(14160), i32 noundef, i1 noundef zeroext) #2

declare void @_ZN7ImGuiIO21SetKeyEventNativeDataEiiii(ptr noundef nonnull align 8 dereferenceable(14160), i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare void @_ZN7ImGuiIO13AddFocusEventEb(ptr noundef nonnull align 8 dereferenceable(14160), i1 noundef zeroext) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !13, i64 24}
!15 = !{!"_ZTS19ImGui_ImplSDL2_Data", !6, i64 0, !6, i64 8, !16, i64 16, !13, i64 24, !7, i64 32, !6, i64 104, !17, i64 112}
!16 = !{!"long", !7, i64 0}
!17 = !{!"bool", !7, i64 0}


; 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"

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z27ImGui_ImplSDL2_ProcessEventPK9SDL_Event(ptr noundef %0) local_unnamed_addr #0 {
  %2 = tail call noundef nonnull align 8 dereferenceable(14160) ptr @_ZN5ImGui5GetIOEv()
  %3 = tail call noundef ptr @_ZL29ImGui_ImplSDL2_GetBackendDatav()
  %4 = load i32, ptr %0, align 8, !tbaa !5
  switch i32 %4, label %.critedge [
    i32 1024, label %5
    i32 1027, label %12
    i32 1025, label %23
    i32 1026, label %23
    i32 771, label %42
    i32 768, label %44
    i32 769, label %44
    i32 512, label %56
  ]

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 20
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = sitofp i32 %7 to float
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = sitofp i32 %10 to float
  tail call void @_ZN7ImGuiIO16AddMousePosEventEff(ptr noundef nonnull align 8 dereferenceable(14160) %2, float noundef %8, float noundef %11)
  br label %.critedge

12:                                               ; preds = %1
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = load i32, ptr %13, align 8, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  %.not = icmp eq i32 %14, 0
  %16 = select i1 %.not, float 0.000000e+00, float -1.000000e+00
  %17 = select i1 %15, float 1.000000e+00, float %16
  %18 = getelementptr inbounds i8, ptr %0, i64 20
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 0
  %.not48 = icmp eq i32 %19, 0
  %21 = select i1 %.not48, float 0.000000e+00, float -1.000000e+00
  %22 = select i1 %20, float 1.000000e+00, float %21
  tail call void @_ZN7ImGuiIO18AddMouseWheelEventEff(ptr noundef nonnull align 8 dereferenceable(14160) %2, float noundef %17, float noundef %22)
  br label %.critedge

23:                                               ; preds = %1, %1
  %24 = getelementptr inbounds i8, ptr %0, i64 16
  %25 = load i8, ptr %24, align 8, !tbaa !5
  %26 = icmp ne i8 %25, 1
  %spec.store.select = sext i1 %26 to i32
  %27 = icmp eq i8 %25, 3
  %spec.store.select1 = select i1 %27, i32 1, i32 %spec.store.select
  %28 = icmp eq i8 %25, 2
  %spec.store.select2 = select i1 %28, i32 2, i32 %spec.store.select1
  %29 = icmp eq i32 %spec.store.select2, -1
  br i1 %29, label %.critedge, label %30

30:                                               ; preds = %23
  %31 = icmp eq i32 %4, 1025
  tail call void @_ZN7ImGuiIO19AddMouseButtonEventEib(ptr noundef nonnull align 8 dereferenceable(14160) %2, i32 noundef %spec.store.select2, i1 noundef zeroext %31)
  %32 = load i32, ptr %0, align 8, !tbaa !5
  %33 = icmp eq i32 %32, 1025
  %34 = getelementptr inbounds i8, ptr %3, i64 24
  %35 = load i32, ptr %34, align 8, !tbaa !8
  %36 = shl nuw nsw i32 1, %spec.store.select2
  %37 = or i32 %35, %36
  %38 = xor i32 %36, -1
  %39 = and i32 %35, %38
  %40 = select i1 %33, i32 %37, i32 %39
  %41 = getelementptr inbounds i8, ptr %3, i64 24
  store i32 %40, ptr %41, align 8, !tbaa !8
  br label %.critedge

42:                                               ; preds = %1
  %43 = getelementptr inbounds i8, ptr %0, i64 12
  tail call void @_ZN7ImGuiIO22AddInputCharactersUTF8EPKc(ptr noundef nonnull align 8 dereferenceable(14160) %2, ptr noundef nonnull %43)
  br label %.critedge

44:                                               ; preds = %1, %1
  %45 = getelementptr inbounds i8, ptr %0, i64 16
  %46 = getelementptr inbounds i8, ptr %0, i64 24
  %47 = load i16, ptr %46, align 8, !tbaa !5
  %48 = zext i16 %47 to i32
  tail call void @_ZL33ImGui_ImplSDL2_UpdateKeyModifiers10SDL_Keymod(i32 noundef %48)
  %49 = getelementptr inbounds i8, ptr %0, i64 20
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = tail call noundef i32 @_ZL32ImGui_ImplSDL2_KeycodeToImGuiKeyi(i32 noundef %50)
  %52 = load i32, ptr %0, align 8, !tbaa !5
  %53 = icmp eq i32 %52, 768
  tail call void @_ZN7ImGuiIO11AddKeyEventEib(ptr noundef nonnull align 8 dereferenceable(14160) %2, i32 noundef %51, i1 noundef zeroext %53)
  %54 = load i32, ptr %49, align 4, !tbaa !5
  %55 = load i32, ptr %45, align 8, !tbaa !5
  tail call void @_ZN7ImGuiIO21SetKeyEventNativeDataEiiii(ptr noundef nonnull align 8 dereferenceable(14160) %2, i32 noundef %51, i32 noundef %54, i32 noundef %55, i32 noundef %55)
  br label %.critedge

56:                                               ; preds = %1
  %57 = getelementptr inbounds i8, ptr %0, i64 12
  %58 = load i8, ptr %57, align 4, !tbaa !5
  %59 = icmp eq i8 %58, 11
  br i1 %59, label %60, label %61

60:                                               ; preds = %56
  tail call void @_ZN7ImGuiIO16AddMousePosEventEff(ptr noundef nonnull align 8 dereferenceable(14160) %2, float noundef 0xC7EFFFFFE0000000, float noundef 0xC7EFFFFFE0000000)
  %.pr = load i8, ptr %57, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %60, %56
  %62 = phi i8 [ %.pr, %60 ], [ %58, %56 ]
  switch i8 %62, label %.critedge [
    i8 12, label %63
    i8 13, label %64
  ]

63:                                               ; preds = %61
  tail call void @_ZN7ImGuiIO13AddFocusEventEb(ptr noundef nonnull align 8 dereferenceable(14160) %2, i1 noundef zeroext true)
  br label %.critedge

64:                                               ; preds = %61
  tail call void @_ZN7ImGuiIO13AddFocusEventEb(ptr noundef nonnull align 8 dereferenceable(14160) %2, i1 noundef zeroext false)
  br label %.critedge

.critedge:                                        ; preds = %1, %23, %30, %63, %64, %61, %44, %42, %12, %5
  %.1 = phi i1 [ true, %44 ], [ true, %42 ], [ true, %30 ], [ true, %12 ], [ true, %5 ], [ true, %61 ], [ true, %64 ], [ true, %63 ], [ false, %23 ], [ false, %1 ]
  ret i1 %.1
}

declare noundef nonnull align 8 dereferenceable(14160) ptr @_ZN5ImGui5GetIOEv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL29ImGui_ImplSDL2_GetBackendDatav() local_unnamed_addr #0

declare void @_ZN7ImGuiIO16AddMousePosEventEff(ptr noundef nonnull align 8 dereferenceable(14160), float noundef, float noundef) local_unnamed_addr #1

declare void @_ZN7ImGuiIO18AddMouseWheelEventEff(ptr noundef nonnull align 8 dereferenceable(14160), float noundef, float noundef) local_unnamed_addr #1

declare void @_ZN7ImGuiIO19AddMouseButtonEventEib(ptr noundef nonnull align 8 dereferenceable(14160), i32 noundef, i1 noundef zeroext) local_unnamed_addr #1

declare void @_ZN7ImGuiIO22AddInputCharactersUTF8EPKc(ptr noundef nonnull align 8 dereferenceable(14160), ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL33ImGui_ImplSDL2_UpdateKeyModifiers10SDL_Keymod(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL32ImGui_ImplSDL2_KeycodeToImGuiKeyi(i32 noundef) local_unnamed_addr #2

declare void @_ZN7ImGuiIO11AddKeyEventEib(ptr noundef nonnull align 8 dereferenceable(14160), i32 noundef, i1 noundef zeroext) local_unnamed_addr #1

declare void @_ZN7ImGuiIO21SetKeyEventNativeDataEiiii(ptr noundef nonnull align 8 dereferenceable(14160), i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @_ZN7ImGuiIO13AddFocusEventEb(ptr noundef nonnull align 8 dereferenceable(14160), i1 noundef zeroext) local_unnamed_addr #1

attributes #0 = { 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 #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 = { 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" }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !12, i64 24}
!9 = !{!"_ZTS19ImGui_ImplSDL2_Data", !10, i64 0, !10, i64 8, !11, i64 16, !12, i64 24, !6, i64 32, !10, i64 104, !13, i64 112}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"long", !6, i64 0}
!12 = !{!"int", !6, i64 0}
!13 = !{!"bool", !6, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass