; LLVM IR from l1mey112/yr11-physics-applied :: cimgui/imgui/imgui.ll (ZN7ImGuiIO19AddMouseButtonEventEib)

; 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.ImGuiInputEvent = type <{ i32, i32, %union.anon, i8, [3 x i8] }>
%union.anon = type { %struct.ImGuiInputEventKey }
%struct.ImGuiInputEventKey = type { i32, i8, float }
%struct.ImGuiContext = type { i8, i8, %struct.ImGuiIO, %struct.ImVector.0, %struct.ImVector.0, %struct.ImGuiStyle, ptr, float, float, %struct.ImDrawListSharedData, double, i32, i32, i32, i8, i8, i8, i8, i8, ptr, %struct.ImVector.2, %struct.ImVector.2, %struct.ImVector.2, %struct.ImVector.3, %struct.ImGuiStorage, i32, %struct.ImVec2, ptr, ptr, ptr, ptr, ptr, %struct.ImVec2, i32, float, %struct.ImVec2, %struct.ImVec2, i32, i32, i32, i8, i8, float, float, i32, i32, float, i8, i8, i8, i8, i8, i8, %struct.ImVec2, ptr, i32, i32, i32, i8, i8, ptr, i32, float, [140 x %struct.ImGuiKeyOwnerData], %struct.ImGuiKeyRoutingTable, i32, i8, i32, i32, i32, i32, %struct.ImGuiNextItemData, %struct.ImGuiLastItemData, %struct.ImGuiNextWindowData, %struct.ImVector.6, %struct.ImVector.7, %struct.ImVector.8, %struct.ImVector.9, %struct.ImVector.10, %struct.ImVector.11, %struct.ImVector.12, %struct.ImVector.12, i32, %struct.ImVector.13, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i32, %struct.ImRect, i8, i8, i8, i32, i32, i32, i32, i32, i32, %struct.ImRect, %struct.ImRect, i32, i32, i32, %struct.ImGuiNavItemData, %struct.ImGuiNavItemData, %struct.ImGuiNavItemData, %struct.ImGuiNavItemData, i32, i32, ptr, ptr, ptr, float, float, i8, %struct.ImVec2, %struct.ImVec2, float, i32, i8, i8, i8, i32, i32, i32, [4 x i8], %struct.ImGuiPayload, %struct.ImRect, i32, i32, float, i32, i32, i32, i32, %struct.ImVector.14, [16 x i8], i32, %struct.ImVector.15, ptr, i32, %struct.ImVector.16, %struct.ImPool, %struct.ImVector.18, %struct.ImVector.19, ptr, %struct.ImPool.20, %struct.ImVector.22, %struct.ImVector.23, i32, i32, float, float, %struct.ImVec2, %struct.ImGuiInputTextState, %struct.ImFont, i32, i32, float, float, i32, %struct.ImVec4, %struct.ImGuiComboPreviewData, float, float, i8, i8, float, float, float, float, i16, i16, %struct.ImVector.24, %struct.ImVector.9, %struct.ImGuiPlatformImeData, %struct.ImGuiPlatformImeData, i8, i8, float, %struct.ImGuiTextBuffer, %struct.ImVector.26, %struct.ImChunkStream, %struct.ImChunkStream.27, %struct.ImVector.28, i32, [7 x ptr], i8, i32, ptr, %struct.ImGuiTextBuffer, ptr, ptr, float, i8, i32, i32, i32, i32, %struct.ImGuiTextBuffer, %struct.ImGuiTextIndex, i8, i8, i8, i32, %struct.ImGuiMetricsConfig, %struct.ImGuiStackTool, [60 x float], i32, i32, float, i32, i32, i32, %struct.ImVector.24 }
%struct.ImGuiIO = type { i32, i32, %struct.ImVec2, float, float, ptr, ptr, float, float, float, float, float, float, float, ptr, ptr, float, i8, ptr, %struct.ImVec2, i8, i8, i8, i8, i8, i8, i8, i8, float, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, float, i32, i32, i32, i32, i32, %struct.ImVec2, [652 x i32], [652 x i8], [16 x float], %struct.ImVec2, [5 x i8], float, float, i8, i8, i8, i8, i32, [652 x %struct.ImGuiKeyData], i8, %struct.ImVec2, [5 x %struct.ImVec2], [5 x double], [5 x i8], [5 x i8], [5 x i16], [5 x i16], [5 x i8], [5 x i8], [5 x i8], [5 x float], [5 x float], [5 x float], float, i8, i8, i8, i8, i16, %struct.ImVector }
%struct.ImGuiKeyData = type { i8, float, float, float }
%struct.ImVector = type { i32, i32, ptr }
%struct.ImVector.0 = type { i32, i32, ptr }
%struct.ImGuiStyle = type { float, float, %struct.ImVec2, float, float, %struct.ImVec2, %struct.ImVec2, i32, float, float, float, float, %struct.ImVec2, float, float, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, float, float, float, float, float, float, float, float, float, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, i8, i8, i8, float, float, [53 x %struct.ImVec4] }
%struct.ImDrawListSharedData = type { %struct.ImVec2, ptr, float, float, float, %struct.ImVec4, i32, %struct.ImVector.1, [48 x %struct.ImVec2], float, [64 x i8], ptr }
%struct.ImVector.1 = type { i32, i32, ptr }
%struct.ImVector.2 = type { i32, i32, ptr }
%struct.ImVector.3 = type { i32, i32, ptr }
%struct.ImGuiStorage = type { %struct.ImVector.4 }
%struct.ImVector.4 = type { i32, i32, ptr }
%struct.ImGuiKeyOwnerData = type <{ i32, i32, i8, i8, [2 x i8] }>
%struct.ImGuiKeyRoutingTable = type { [140 x i16], %struct.ImVector.5, %struct.ImVector.5 }
%struct.ImVector.5 = type { i32, i32, ptr }
%struct.ImGuiNextItemData = type <{ i32, float, i32, i32, i8, [3 x i8] }>
%struct.ImGuiLastItemData = type { i32, i32, i32, %struct.ImRect, %struct.ImRect, %struct.ImRect }
%struct.ImGuiNextWindowData = type <{ i32, i32, i32, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, i8, [3 x i8], %struct.ImRect, [4 x i8], ptr, ptr, float, %struct.ImVec2, [4 x i8] }>
%struct.ImVector.6 = type { i32, i32, ptr }
%struct.ImVector.7 = type { i32, i32, ptr }
%struct.ImVector.8 = type { i32, i32, ptr }
%struct.ImVector.10 = type { i32, i32, ptr }
%struct.ImVector.11 = type { i32, i32, ptr }
%struct.ImVector.12 = type { i32, i32, ptr }
%struct.ImVector.13 = type { i32, i32, ptr }
%struct.ImGuiNavItemData = type { ptr, i32, i32, %struct.ImRect, i32, float, float, float }
%struct.ImGuiPayload = type <{ ptr, i32, i32, i32, i32, [33 x i8], i8, i8, [5 x i8] }>
%struct.ImRect = type { %struct.ImVec2, %struct.ImVec2 }
%struct.ImVector.14 = type { i32, i32, ptr }
%struct.ImVector.15 = type { i32, i32, ptr }
%struct.ImVector.16 = type { i32, i32, ptr }
%struct.ImPool = type { %struct.ImVector.17, %struct.ImGuiStorage, i32, i32 }
%struct.ImVector.17 = type { i32, i32, ptr }
%struct.ImVector.18 = type { i32, i32, ptr }
%struct.ImVector.19 = type { i32, i32, ptr }
%struct.ImPool.20 = type { %struct.ImVector.21, %struct.ImGuiStorage, i32, i32 }
%struct.ImVector.21 = type { i32, i32, ptr }
%struct.ImVector.22 = type { i32, i32, ptr }
%struct.ImVector.23 = type { i32, i32, ptr }
%struct.ImVec2 = type { float, float }
%struct.ImGuiInputTextState = type <{ ptr, i32, i32, i32, [4 x i8], %struct.ImVector, %struct.ImVector.24, %struct.ImVector.24, i8, [3 x i8], i32, float, %"struct.ImStb::STB_TexteditState", float, i8, i8, i8, i8, i32, [4 x i8] }>
%"struct.ImStb::STB_TexteditState" = type { i32, i32, i32, i8, i32, i8, i8, i8, i8, i8, i8, i8, float, %"struct.ImStb::StbUndoState" }
%"struct.ImStb::StbUndoState" = type { [99 x %"struct.ImStb::StbUndoRecord"], [999 x i16], i16, i16, i32, i32 }
%"struct.ImStb::StbUndoRecord" = type { i32, i32, i32, i32 }
%struct.ImFont = type <{ %struct.ImVector.18, float, float, %struct.ImVector, %struct.ImVector.25, ptr, ptr, ptr, i16, i16, i16, i16, i8, [3 x i8], float, float, float, i32, [2 x i8], [2 x i8] }>
%struct.ImVector.25 = type { i32, i32, ptr }
%struct.ImVec4 = type { float, float, float, float }
%struct.ImGuiComboPreviewData = type { %struct.ImRect, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, i32 }
%struct.ImVector.9 = type { i32, i32, ptr }
%struct.ImGuiPlatformImeData = type { i8, %struct.ImVec2, float }
%struct.ImVector.26 = type { i32, i32, ptr }
%struct.ImChunkStream = type { %struct.ImVector.24 }
%struct.ImChunkStream.27 = type { %struct.ImVector.24 }
%struct.ImVector.28 = type { i32, i32, ptr }
%struct.ImGuiTextBuffer = type { %struct.ImVector.24 }
%struct.ImGuiTextIndex = type <{ %struct.ImVector.10, i32, [4 x i8] }>
%struct.ImGuiMetricsConfig = type { i8, i8, i8, i8, i8, i8, i8, i32, i32 }
%struct.ImGuiStackTool = type { i32, i32, i32, %struct.ImVector.29, i8, float }
%struct.ImVector.29 = type { i32, i32, ptr }
%struct.ImVector.24 = type { i32, i32, ptr }
%struct.ImGuiInputEventMouseButton = type { i32, i8 }

@GImGui = external dso_local global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [86 x i8], align 1
@__PRETTY_FUNCTION__._ZN7ImGuiIO19AddMouseButtonEventEib = external hidden unnamed_addr constant [45 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [59 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN15ImGuiInputEventC2Ev(ptr noundef nonnull align 4 dereferenceable(21)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorI15ImGuiInputEventE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(21)) #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL20FindLatestInputEvent19ImGuiInputEventTypei(i32 noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7ImGuiIO19AddMouseButtonEventEib(ptr noundef nonnull align 8 dereferenceable(14264) %0, i32 noundef %1, i1 noundef zeroext %2) #4 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca %struct.ImGuiInputEvent, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %12 = zext i1 %2 to i8
  store i8 %12, ptr %6, align 1, !tbaa !11
  %13 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %14 = load ptr, ptr @GImGui, align 8, !tbaa !5
  store ptr %14, ptr %7, align 8, !tbaa !5
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.ImGuiContext, ptr %15, i32 0, i32 2
  %17 = icmp eq ptr %16, %13
  br i1 %17, label %18, label %19

18:                                               ; preds = %3
  br label %19

19:                                               ; preds = %18, %3
  %20 = phi i1 [ false, %3 ], [ true, %18 ]
  br i1 %20, label %21, label %22

21:                                               ; preds = %19
  br label %24

22:                                               ; preds = %19
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 1452, ptr noundef @__PRETTY_FUNCTION__._ZN7ImGuiIO19AddMouseButtonEventEib) #6
  unreachable

23:                                               ; No predecessors!
  br label %24

24:                                               ; preds = %23, %21
  %25 = load i32, ptr %5, align 4, !tbaa !9
  %26 = icmp sge i32 %25, 0
  br i1 %26, label %27, label %30

27:                                               ; preds = %24
  %28 = load i32, ptr %5, align 4, !tbaa !9
  %29 = icmp slt i32 %28, 5
  br label %30

30:                                               ; preds = %27, %24
  %31 = phi i1 [ false, %24 ], [ %29, %27 ]
  br i1 %31, label %32, label %33

32:                                               ; preds = %30
  br label %35

33:                                               ; preds = %30
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.4, i32 noundef 1453, ptr noundef @__PRETTY_FUNCTION__._ZN7ImGuiIO19AddMouseButtonEventEib) #6
  unreachable

34:                                               ; No predecessors!
  br label %35

35:                                               ; preds = %34, %32
  %36 = getelementptr inbounds %struct.ImGuiIO, ptr %13, i32 0, i32 82
  %37 = load i8, ptr %36, align 1, !tbaa !13, !range !19, !noundef !20
  %38 = trunc i8 %37 to i1
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i32 1, ptr %8, align 4
  br label %85

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = call noundef ptr @_ZL20FindLatestInputEvent19ImGuiInputEventTypei(i32 noundef 3, i32 noundef %41)
  store ptr %42, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #5
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %51

45:                                               ; preds = %40
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ImGuiInputEvent, ptr %46, i32 0, i32 2
  %48 = getelementptr inbounds %struct.ImGuiInputEventMouseButton, ptr %47, i32 0, i32 1
  %49 = load i8, ptr %48, align 4, !tbaa !21, !range !19, !noundef !20
  %50 = trunc i8 %49 to i1
  br label %60

51:                                               ; preds = %40
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.ImGuiContext, ptr %52, i32 0, i32 2
  %54 = getelementptr inbounds %struct.ImGuiIO, ptr %53, i32 0, i32 57
  %55 = load i32, ptr %5, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [5 x i8], ptr %54, i64 0, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !11, !range !19, !noundef !20
  %59 = trunc i8 %58 to i1
  br label %60

60:                                               ; preds = %51, %45
  %61 = phi i1 [ %50, %45 ], [ %59, %51 ]
  %62 = zext i1 %61 to i8
  store i8 %62, ptr %10, align 1, !tbaa !11
  %63 = load i8, ptr %10, align 1, !tbaa !11, !range !19, !noundef !20
  %64 = trunc i8 %63 to i1
  %65 = zext i1 %64 to i32
  %66 = load i8, ptr %6, align 1, !tbaa !11, !range !19, !noundef !20
  %67 = trunc i8 %66 to i1
  %68 = zext i1 %67 to i32
  %69 = icmp eq i32 %65, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %60
  store i32 1, ptr %8, align 4
  br label %84

71:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #5
  call void @_ZN15ImGuiInputEventC2Ev(ptr noundef nonnull align 4 dereferenceable(21) %11)
  %72 = getelementptr inbounds %struct.ImGuiInputEvent, ptr %11, i32 0, i32 0
  store i32 3, ptr %72, align 4, !tbaa !22
  %73 = getelementptr inbounds %struct.ImGuiInputEvent, ptr %11, i32 0, i32 1
  store i32 1, ptr %73, align 4, !tbaa !26
  %74 = load i32, ptr %5, align 4, !tbaa !9
  %75 = getelementptr inbounds %struct.ImGuiInputEvent, ptr %11, i32 0, i32 2
  %76 = getelementptr inbounds %struct.ImGuiInputEventMouseButton, ptr %75, i32 0, i32 0
  store i32 %74, ptr %76, align 4, !tbaa !21
  %77 = load i8, ptr %6, align 1, !tbaa !11, !range !19, !noundef !20
  %78 = trunc i8 %77 to i1
  %79 = getelementptr inbounds %struct.ImGuiInputEvent, ptr %11, i32 0, i32 2
  %80 = getelementptr inbounds %struct.ImGuiInputEventMouseButton, ptr %79, i32 0, i32 1
  %81 = zext i1 %78 to i8
  store i8 %81, ptr %80, align 4, !tbaa !21
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.ImGuiContext, ptr %82, i32 0, i32 3
  call void @_ZN8ImVectorI15ImGuiInputEventE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %83, ptr noundef nonnull align 4 dereferenceable(21) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  store i32 0, ptr %8, align 4
  br label %84

84:                                               ; preds = %71, %70
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %85

85:                                               ; preds = %84, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %86 = load i32, ptr %8, align 4
  switch i32 %86, label %88 [
    i32 0, label %87
    i32 1, label %87
  ]

87:                                               ; preds = %85, %85
  ret void

88:                                               ; preds = %85
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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" }
attributes #3 = { inlinehint 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !12, i64 14241}
!14 = !{!"_ZTS7ImGuiIO", !10, i64 0, !10, i64 4, !15, i64 8, !16, i64 16, !16, i64 20, !6, i64 24, !6, i64 32, !16, i64 40, !16, i64 44, !16, i64 48, !16, i64 52, !16, i64 56, !16, i64 60, !16, i64 64, !6, i64 72, !6, i64 80, !16, i64 88, !12, i64 92, !6, i64 96, !15, i64 104, !12, i64 112, !12, i64 113, !12, i64 114, !12, i64 115, !12, i64 116, !12, i64 117, !12, i64 118, !12, i64 119, !16, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !12, i64 208, !12, i64 209, !12, i64 210, !12, i64 211, !12, i64 212, !12, i64 213, !12, i64 214, !16, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !10, i64 232, !10, i64 236, !15, i64 240, !7, i64 248, !7, i64 2856, !7, i64 3508, !15, i64 3572, !7, i64 3580, !16, i64 3588, !16, i64 3592, !12, i64 3596, !12, i64 3597, !12, i64 3598, !12, i64 3599, !10, i64 3600, !7, i64 3604, !12, i64 14036, !15, i64 14040, !7, i64 14048, !7, i64 14088, !7, i64 14128, !7, i64 14133, !7, i64 14138, !7, i64 14148, !7, i64 14158, !7, i64 14163, !7, i64 14168, !7, i64 14176, !7, i64 14196, !7, i64 14216, !16, i64 14236, !12, i64 14240, !12, i64 14241, !7, i64 14242, !12, i64 14243, !17, i64 14244, !18, i64 14248}
!15 = !{!"_ZTS6ImVec2", !16, i64 0, !16, i64 4}
!16 = !{!"float", !7, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = !{!"_ZTS8ImVectorItE", !10, i64 0, !10, i64 4, !6, i64 8}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !24, i64 0}
!23 = !{!"_ZTS15ImGuiInputEvent", !24, i64 0, !25, i64 4, !7, i64 8, !12, i64 20}
!24 = !{!"_ZTS19ImGuiInputEventType", !7, i64 0}
!25 = !{!"_ZTS16ImGuiInputSource", !7, i64 0}
!26 = !{!23, !25, i64 4}


; 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.ImGuiInputEvent = type <{ i32, i32, %union.anon, i8, [3 x i8] }>
%union.anon = type { %struct.ImGuiInputEventKey }
%struct.ImGuiInputEventKey = type { i32, i8, float }

@GImGui = external dso_local local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [86 x i8], align 1
@__PRETTY_FUNCTION__._ZN7ImGuiIO19AddMouseButtonEventEib = external hidden unnamed_addr constant [45 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [59 x i8], align 1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN15ImGuiInputEventC2Ev(ptr noundef nonnull align 4 dereferenceable(21)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorI15ImGuiInputEventE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(21)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL20FindLatestInputEvent19ImGuiInputEventTypei(i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7ImGuiIO19AddMouseButtonEventEib(ptr noundef nonnull readonly align 8 dereferenceable(14264) %0, i32 noundef %1, i1 noundef zeroext %2) local_unnamed_addr #4 align 2 {
  %4 = alloca %struct.ImGuiInputEvent, align 4
  %5 = zext i1 %2 to i8
  %6 = load ptr, ptr @GImGui, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 8
  %8 = icmp eq ptr %7, %0
  br i1 %8, label %10, label %9

9:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 1452, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7ImGuiIO19AddMouseButtonEventEib) #5
  unreachable

10:                                               ; preds = %3
  %11 = icmp ult i32 %1, 5
  br i1 %11, label %13, label %12

12:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.4, i32 noundef 1453, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7ImGuiIO19AddMouseButtonEventEib) #5
  unreachable

13:                                               ; preds = %10
  %14 = getelementptr inbounds i8, ptr %0, i64 14241
  %15 = load i8, ptr %14, align 1, !tbaa !9, !range !17, !noundef !18
  %16 = trunc nuw i8 %15 to i1
  br i1 %16, label %17, label %29

17:                                               ; preds = %13
  %18 = tail call noundef ptr @_ZL20FindLatestInputEvent19ImGuiInputEventTypei(i32 noundef 3, i32 noundef %1)
  %.not = icmp eq ptr %18, null
  %19 = getelementptr inbounds i8, ptr %18, i64 12
  %20 = getelementptr inbounds i8, ptr %6, i64 3588
  %21 = zext nneg i32 %1 to i64
  %22 = getelementptr inbounds [5 x i8], ptr %20, i64 0, i64 %21
  %.in.in = select i1 %.not, ptr %22, ptr %19
  %.in = load i8, ptr %.in.in, align 1, !tbaa !19, !range !17, !noundef !18
  %23 = icmp eq i8 %.in, %5
  br i1 %23, label %29, label %24

24:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @_ZN15ImGuiInputEventC2Ev(ptr noundef nonnull align 4 dereferenceable(21) %4)
  store i32 3, ptr %4, align 4, !tbaa !20
  %25 = getelementptr inbounds i8, ptr %4, i64 4
  store i32 1, ptr %25, align 4, !tbaa !24
  %26 = getelementptr inbounds i8, ptr %4, i64 8
  store i32 %1, ptr %26, align 4, !tbaa !19
  %27 = getelementptr inbounds i8, ptr %4, i64 12
  store i8 %5, ptr %27, align 4, !tbaa !19
  %28 = getelementptr inbounds i8, ptr %6, i64 14272
  call void @_ZN8ImVectorI15ImGuiInputEventE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(21) %4)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  br label %29

29:                                               ; preds = %24, %17, %13
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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" }
attributes #3 = { inlinehint 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 #4 = { 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 #5 = { noreturn nounwind }
attributes #6 = { 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, !14, i64 14241}
!10 = !{!"_ZTS7ImGuiIO", !11, i64 0, !11, i64 4, !12, i64 8, !13, i64 16, !13, i64 20, !6, i64 24, !6, i64 32, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !6, i64 72, !6, i64 80, !13, i64 88, !14, i64 92, !6, i64 96, !12, i64 104, !14, i64 112, !14, i64 113, !14, i64 114, !14, i64 115, !14, i64 116, !14, i64 117, !14, i64 118, !14, i64 119, !13, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !14, i64 208, !14, i64 209, !14, i64 210, !14, i64 211, !14, i64 212, !14, i64 213, !14, i64 214, !13, i64 216, !11, i64 220, !11, i64 224, !11, i64 228, !11, i64 232, !11, i64 236, !12, i64 240, !7, i64 248, !7, i64 2856, !7, i64 3508, !12, i64 3572, !7, i64 3580, !13, i64 3588, !13, i64 3592, !14, i64 3596, !14, i64 3597, !14, i64 3598, !14, i64 3599, !11, i64 3600, !7, i64 3604, !14, i64 14036, !12, i64 14040, !7, i64 14048, !7, i64 14088, !7, i64 14128, !7, i64 14133, !7, i64 14138, !7, i64 14148, !7, i64 14158, !7, i64 14163, !7, i64 14168, !7, i64 14176, !7, i64 14196, !7, i64 14216, !13, i64 14236, !14, i64 14240, !14, i64 14241, !7, i64 14242, !14, i64 14243, !15, i64 14244, !16, i64 14248}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTS6ImVec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!"_ZTS8ImVectorItE", !11, i64 0, !11, i64 4, !6, i64 8}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !22, i64 0}
!21 = !{!"_ZTS15ImGuiInputEvent", !22, i64 0, !23, i64 4, !7, i64 8, !14, i64 20}
!22 = !{!"_ZTS19ImGuiInputEventType", !7, i64 0}
!23 = !{!"_ZTS16ImGuiInputSource", !7, i64 0}
!24 = !{!21, !23, i64 4}


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