; LLVM IR from yangfengzzz/DigitalVox4 :: vox.render/gui/imgui.ll (ZN7ImGuiIO17AddKeyAnalogEventEibf)

; 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, [6 x 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, [7 x i8], ptr, %struct.ImVector.1, %struct.ImVector.1, %struct.ImVector.1, %struct.ImVector.2, %struct.ImGuiStorage, i32, %struct.ImVec2, [4 x i8], ptr, ptr, ptr, ptr, ptr, %struct.ImVec2, float, i32, i32, i32, i8, i8, i8, i8, float, float, i32, i32, float, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, %struct.ImBitArray, %struct.ImVec2, [4 x i8], ptr, i32, i32, i32, i8, i8, [2 x i8], ptr, i32, float, i32, %struct.ImGuiNextItemData, %struct.ImGuiLastItemData, [4 x i8], %struct.ImGuiNextWindowData, %struct.ImVector.4, %struct.ImVector.5, %struct.ImVector.6, %struct.ImVector.7, %struct.ImVector.8, %struct.ImVector.9, %struct.ImVector.10, %struct.ImVector.10, i32, [4 x i8], %struct.ImVector.11, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i32, %struct.ImRect, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, %struct.ImRect, %struct.ImRect, i32, i32, i32, [4 x i8], %struct.ImGuiNavItemData, %struct.ImGuiNavItemData, %struct.ImGuiNavItemData, %struct.ImGuiNavItemData, ptr, ptr, ptr, float, float, i8, [3 x i8], float, i32, i8, i8, i8, i8, i32, i32, i32, [4 x i8], %struct.ImGuiPayload, %struct.ImRect, i32, i32, float, i32, i32, i32, i32, [4 x i8], %struct.ImVector.12, [16 x i8], i32, [4 x i8], %struct.ImVector.13, ptr, i32, [4 x i8], %struct.ImVector.14, %struct.ImPool, %struct.ImVector.16, %struct.ImVector.17, ptr, %struct.ImPool.18, %struct.ImVector.20, %struct.ImVector.21, %struct.ImVec2, %struct.ImGuiInputTextState, %struct.ImFont, i32, i32, float, float, i32, %struct.ImVec4, %struct.ImGuiComboPreviewData, float, i8, i8, [2 x i8], float, float, float, float, i16, i16, float, [4 x i8], %struct.ImVector.22, %struct.ImVector.7, %struct.ImGuiPlatformImeData, %struct.ImGuiPlatformImeData, i8, i8, [2 x i8], float, %struct.ImGuiTextBuffer, %struct.ImVector.24, %struct.ImChunkStream, %struct.ImChunkStream.25, %struct.ImVector.26, i32, i8, [3 x i8], i32, [4 x i8], ptr, %struct.ImGuiTextBuffer, ptr, ptr, float, i8, [3 x i8], i32, i32, i32, i8, [3 x i8], i32, %struct.ImGuiMetricsConfig, [4 x i8], %struct.ImGuiStackTool, [120 x float], i32, i32, float, i32, i32, i32, [3073 x i8], [7 x i8] }>
%struct.ImGuiIO = type { i32, i32, %struct.ImVec2, float, float, ptr, ptr, float, float, float, float, float, ptr, ptr, float, i8, ptr, %struct.ImVec2, 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, [641 x i32], [512 x i8], %struct.ImVec2, [5 x i8], float, float, i8, i8, i8, i8, [20 x float], i32, i32, [641 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], [20 x float], [20 x float], float, 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, [48 x %struct.ImVec2], float, [64 x i8], ptr }
%struct.ImVector.1 = type { i32, i32, ptr }
%struct.ImVector.2 = type { i32, i32, ptr }
%struct.ImGuiStorage = type { %struct.ImVector.3 }
%struct.ImVector.3 = type { i32, i32, ptr }
%struct.ImBitArray = type { [5 x i32] }
%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.4 = type { i32, i32, ptr }
%struct.ImVector.5 = type { i32, i32, ptr }
%struct.ImVector.6 = type { i32, i32, ptr }
%struct.ImVector.8 = type { i32, i32, ptr }
%struct.ImVector.9 = type { i32, i32, ptr }
%struct.ImVector.10 = type { i32, i32, ptr }
%struct.ImVector.11 = 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.12 = type { i32, i32, ptr }
%struct.ImVector.13 = type { i32, i32, ptr }
%struct.ImVector.14 = type { i32, i32, ptr }
%struct.ImPool = type { %struct.ImVector.15, %struct.ImGuiStorage, i32, i32 }
%struct.ImVector.15 = type { i32, i32, ptr }
%struct.ImVector.16 = type { i32, i32, ptr }
%struct.ImVector.17 = type { i32, i32, ptr }
%struct.ImPool.18 = type { %struct.ImVector.19, %struct.ImGuiStorage, i32, i32 }
%struct.ImVector.19 = type { i32, i32, ptr }
%struct.ImVector.20 = type { i32, i32, ptr }
%struct.ImVector.21 = type { i32, i32, ptr }
%struct.ImVec2 = type { float, float }
%struct.ImGuiInputTextState = type <{ i32, i32, i32, [4 x i8], %struct.ImVector, %struct.ImVector.22, %struct.ImVector.22, 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.16, float, float, %struct.ImVector, %struct.ImVector.23, ptr, ptr, ptr, i16, i16, i16, i16, i8, [3 x i8], float, float, float, i32, [2 x i8], [2 x i8] }>
%struct.ImVector.23 = 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.22 = type { i32, i32, ptr }
%struct.ImVector.7 = type { i32, i32, ptr }
%struct.ImGuiPlatformImeData = type { i8, %struct.ImVec2, float }
%struct.ImVector.24 = type { i32, i32, ptr }
%struct.ImChunkStream = type { %struct.ImVector.22 }
%struct.ImChunkStream.25 = type { %struct.ImVector.22 }
%struct.ImVector.26 = type { i32, i32, ptr }
%struct.ImGuiTextBuffer = type { %struct.ImVector.22 }
%struct.ImGuiMetricsConfig = type { i8, i8, i8, i8, i8, i8, i32, i32 }
%struct.ImGuiStackTool = type { i32, i32, i32, %struct.ImVector.27 }
%struct.ImVector.27 = type { i32, i32, ptr }

@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 [82 x i8], align 1
@__PRETTY_FUNCTION__._ZN7ImGuiIO17AddKeyAnalogEventEibf = external hidden unnamed_addr constant [55 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [191 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [135 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
define dso_local void @_ZN7ImGuiIO17AddKeyAnalogEventEibf(ptr noundef nonnull align 8 dereferenceable(14080) %0, i32 noundef %1, i1 noundef zeroext %2, float noundef %3) #4 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca float, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.ImGuiInputEvent, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  %12 = zext i1 %2 to i8
  store i8 %12, ptr %7, align 1, !tbaa !11
  store float %3, ptr %8, align 4, !tbaa !13
  %13 = load ptr, ptr %5, align 8
  %14 = load i32, ptr %6, align 4, !tbaa !9
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %17

16:                                               ; preds = %4
  br label %104

17:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %18 = load ptr, ptr @GImGui, align 8, !tbaa !5
  store ptr %18, ptr %9, align 8, !tbaa !5
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.ImGuiContext, ptr %19, i32 0, i32 3
  %21 = icmp eq ptr %20, %13
  br i1 %21, label %22, label %23

22:                                               ; preds = %17
  br label %23

23:                                               ; preds = %22, %17
  %24 = phi i1 [ false, %17 ], [ true, %22 ]
  br i1 %24, label %25, label %26

25:                                               ; preds = %23
  br label %28

26:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 1267, ptr noundef @__PRETTY_FUNCTION__._ZN7ImGuiIO17AddKeyAnalogEventEibf) #7
  unreachable

27:                                               ; No predecessors!
  br label %28

28:                                               ; preds = %27, %25
  %29 = load i32, ptr %6, align 4, !tbaa !9
  %30 = call noundef zeroext i1 @_ZN5ImGui10IsNamedKeyEi(i32 noundef %29)
  br i1 %30, label %31, label %32

31:                                               ; preds = %28
  br label %34

32:                                               ; preds = %28
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.4, i32 noundef 1268, ptr noundef @__PRETTY_FUNCTION__._ZN7ImGuiIO17AddKeyAnalogEventEibf) #7
  unreachable

33:                                               ; No predecessors!
  br label %34

34:                                               ; preds = %33, %31
  %35 = getelementptr inbounds %struct.ImGuiIO, ptr %13, i32 0, i32 82
  %36 = load i8, ptr %35, align 1, !tbaa !15
  %37 = sext i8 %36 to i32
  %38 = icmp eq i32 %37, -1
  br i1 %38, label %44, label %39

39:                                               ; preds = %34
  %40 = getelementptr inbounds %struct.ImGuiIO, ptr %13, i32 0, i32 82
  %41 = load i8, ptr %40, align 1, !tbaa !15
  %42 = sext i8 %41 to i32
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %45

44:                                               ; preds = %39, %34
  br label %45

45:                                               ; preds = %44, %39
  %46 = phi i1 [ false, %39 ], [ true, %44 ]
  br i1 %46, label %47, label %48

47:                                               ; preds = %45
  br label %50

48:                                               ; preds = %45
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.4, i32 noundef 1272, ptr noundef @__PRETTY_FUNCTION__._ZN7ImGuiIO17AddKeyAnalogEventEibf) #7
  unreachable

49:                                               ; No predecessors!
  br label %50

50:                                               ; preds = %49, %47
  %51 = getelementptr inbounds %struct.ImGuiIO, ptr %13, i32 0, i32 82
  %52 = load i8, ptr %51, align 1, !tbaa !15
  %53 = sext i8 %52 to i32
  %54 = icmp eq i32 %53, -1
  br i1 %54, label %55, label %78

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 512, ptr %10, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %74, %55
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = icmp slt i32 %57, 641
  br i1 %58, label %60, label %59

59:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %77

60:                                               ; preds = %56
  %61 = getelementptr inbounds %struct.ImGuiIO, ptr %13, i32 0, i32 50
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [641 x i32], ptr %61, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = icmp eq i32 %65, -1
  br i1 %66, label %67, label %68

67:                                               ; preds = %60
  br label %68

68:                                               ; preds = %67, %60
  %69 = phi i1 [ false, %60 ], [ true, %67 ]
  br i1 %69, label %70, label %71

70:                                               ; preds = %68
  br label %73

71:                                               ; preds = %68
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.4, i32 noundef 1275, ptr noundef @__PRETTY_FUNCTION__._ZN7ImGuiIO17AddKeyAnalogEventEibf) #7
  unreachable

72:                                               ; No predecessors!
  br label %73

73:                                               ; preds = %72, %70
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %10, align 4, !tbaa !9
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %10, align 4, !tbaa !9
  br label %56, !llvm.loop !20

77:                                               ; preds = %59
  br label %78

78:                                               ; preds = %77, %50
  %79 = getelementptr inbounds %struct.ImGuiIO, ptr %13, i32 0, i32 82
  store i8 0, ptr %79, align 1, !tbaa !15
  %80 = load i32, ptr %6, align 4, !tbaa !9
  %81 = call noundef zeroext i1 @_ZN5ImGui12IsGamepadKeyEi(i32 noundef %80)
  br i1 %81, label %82, label %84

82:                                               ; preds = %78
  %83 = getelementptr inbounds %struct.ImGuiIO, ptr %13, i32 0, i32 83
  store i8 0, ptr %83, align 2, !tbaa !22
  br label %84

84:                                               ; preds = %82, %78
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #6
  call void @_ZN15ImGuiInputEventC2Ev(ptr noundef nonnull align 4 dereferenceable(21) %11)
  %85 = getelementptr inbounds %struct.ImGuiInputEvent, ptr %11, i32 0, i32 0
  store i32 4, ptr %85, align 4, !tbaa !23
  %86 = load i32, ptr %6, align 4, !tbaa !9
  %87 = call noundef zeroext i1 @_ZN5ImGui12IsGamepadKeyEi(i32 noundef %86)
  %88 = zext i1 %87 to i64
  %89 = select i1 %87, i32 3, i32 2
  %90 = getelementptr inbounds %struct.ImGuiInputEvent, ptr %11, i32 0, i32 1
  store i32 %89, ptr %90, align 4, !tbaa !27
  %91 = load i32, ptr %6, align 4, !tbaa !9
  %92 = getelementptr inbounds %struct.ImGuiInputEvent, ptr %11, i32 0, i32 2
  %93 = getelementptr inbounds %struct.ImGuiInputEventKey, ptr %92, i32 0, i32 0
  store i32 %91, ptr %93, align 4, !tbaa !28
  %94 = load i8, ptr %7, align 1, !tbaa !11, !range !29, !noundef !30
  %95 = trunc i8 %94 to i1
  %96 = getelementptr inbounds %struct.ImGuiInputEvent, ptr %11, i32 0, i32 2
  %97 = getelementptr inbounds %struct.ImGuiInputEventKey, ptr %96, i32 0, i32 1
  %98 = zext i1 %95 to i8
  store i8 %98, ptr %97, align 4, !tbaa !28
  %99 = load float, ptr %8, align 4, !tbaa !13
  %100 = getelementptr inbounds %struct.ImGuiInputEvent, ptr %11, i32 0, i32 2
  %101 = getelementptr inbounds %struct.ImGuiInputEventKey, ptr %100, i32 0, i32 2
  store float %99, ptr %101, align 4, !tbaa !28
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.ImGuiContext, ptr %102, i32 0, i32 4
  call void @_ZN8ImVectorI15ImGuiInputEventE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %103, ptr noundef nonnull align 4 dereferenceable(21) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %104

104:                                              ; preds = %84, %16
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5ImGui10IsNamedKeyEi(i32 noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5ImGui12IsGamepadKeyEi(i32 noundef) #5

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 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { 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, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!16, !7, i64 14057}
!16 = !{!"_ZTS7ImGuiIO", !10, i64 0, !10, i64 4, !17, i64 8, !14, i64 16, !14, i64 20, !6, i64 24, !6, i64 32, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !14, i64 56, !6, i64 64, !6, i64 72, !14, i64 80, !12, i64 84, !6, i64 88, !17, i64 96, !12, i64 104, !12, i64 105, !12, i64 106, !12, i64 107, !12, i64 108, !12, i64 109, !12, i64 110, !14, i64 112, !6, 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, !12, i64 200, !12, i64 201, !12, i64 202, !12, i64 203, !12, i64 204, !12, i64 205, !12, i64 206, !14, i64 208, !10, i64 212, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !17, i64 232, !7, i64 240, !7, i64 2804, !17, i64 3316, !7, i64 3324, !14, i64 3332, !14, i64 3336, !12, i64 3340, !12, i64 3341, !12, i64 3342, !12, i64 3343, !7, i64 3344, !10, i64 3424, !10, i64 3428, !7, i64 3432, !12, i64 13688, !17, i64 13692, !7, i64 13700, !7, i64 13744, !7, i64 13784, !7, i64 13789, !7, i64 13794, !7, i64 13804, !7, i64 13814, !7, i64 13819, !7, i64 13824, !7, i64 13832, !7, i64 13852, !7, i64 13872, !7, i64 13892, !7, i64 13972, !14, i64 14052, !12, i64 14056, !7, i64 14057, !12, i64 14058, !18, i64 14060, !19, i64 14064}
!17 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!18 = !{!"short", !7, i64 0}
!19 = !{!"_ZTS8ImVectorItE", !10, i64 0, !10, i64 4, !6, i64 8}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!16, !12, i64 14058}
!23 = !{!24, !25, i64 0}
!24 = !{!"_ZTS15ImGuiInputEvent", !25, i64 0, !26, i64 4, !7, i64 8, !12, i64 20}
!25 = !{!"_ZTS19ImGuiInputEventType", !7, i64 0}
!26 = !{!"_ZTS16ImGuiInputSource", !7, i64 0}
!27 = !{!24, !26, i64 4}
!28 = !{!7, !7, i64 0}
!29 = !{i8 0, i8 2}
!30 = !{}


; 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 [82 x i8], align 1
@__PRETTY_FUNCTION__._ZN7ImGuiIO17AddKeyAnalogEventEibf = external hidden unnamed_addr constant [55 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [191 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [135 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
define dso_local void @_ZN7ImGuiIO17AddKeyAnalogEventEibf(ptr noundef nonnull align 8 dereferenceable(14080) %0, i32 noundef %1, i1 noundef zeroext %2, float noundef %3) local_unnamed_addr #4 align 2 {
  %5 = alloca %struct.ImGuiInputEvent, align 4
  %6 = zext i1 %2 to i8
  %7 = icmp eq i32 %1, 0
  br i1 %7, label %45, label %8

8:                                                ; preds = %4
  %9 = load ptr, ptr @GImGui, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 8
  %11 = icmp eq ptr %10, %0
  br i1 %11, label %13, label %12

12:                                               ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 1267, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7ImGuiIO17AddKeyAnalogEventEibf) #6
  unreachable

13:                                               ; preds = %8
  %14 = tail call noundef zeroext i1 @_ZN5ImGui10IsNamedKeyEi(i32 noundef %1)
  br i1 %14, label %16, label %15

15:                                               ; preds = %13
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.4, i32 noundef 1268, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7ImGuiIO17AddKeyAnalogEventEibf) #6
  unreachable

16:                                               ; preds = %13
  %17 = getelementptr inbounds i8, ptr %0, i64 14057
  %18 = load i8, ptr %17, align 1, !tbaa !9
  switch i8 %18, label %.critedge [
    i8 -1, label %.preheader
    i8 0, label %.loopexit
  ]

.preheader:                                       ; preds = %16
  %19 = getelementptr inbounds i8, ptr %0, i64 240
  br label %29

.critedge:                                        ; preds = %16
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.4, i32 noundef 1272, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7ImGuiIO17AddKeyAnalogEventEibf) #6
  unreachable

20:                                               ; preds = %29
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = getelementptr inbounds [641 x i32], ptr %19, i64 0, i64 %indvars.iv.next
  %22 = load i32, ptr %21, align 4, !tbaa !17
  %23 = icmp eq i32 %22, -1
  br i1 %23, label %24, label %33

24:                                               ; preds = %20
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %25 = getelementptr inbounds [641 x i32], ptr %19, i64 0, i64 %indvars.iv.next.1
  %26 = load i32, ptr %25, align 4, !tbaa !17
  %27 = icmp eq i32 %26, -1
  br i1 %27, label %28, label %33

28:                                               ; preds = %24
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 641
  br i1 %exitcond.not.2, label %.loopexit, label %29, !llvm.loop !18

29:                                               ; preds = %28, %.preheader
  %indvars.iv = phi i64 [ 512, %.preheader ], [ %indvars.iv.next.2, %28 ]
  %30 = getelementptr inbounds [641 x i32], ptr %19, i64 0, i64 %indvars.iv
  %31 = load i32, ptr %30, align 4, !tbaa !17
  %32 = icmp eq i32 %31, -1
  br i1 %32, label %20, label %33

33:                                               ; preds = %24, %20, %29
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.4, i32 noundef 1275, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7ImGuiIO17AddKeyAnalogEventEibf) #6
  unreachable

.loopexit:                                        ; preds = %28, %16
  store i8 0, ptr %17, align 1, !tbaa !9
  %34 = tail call noundef zeroext i1 @_ZN5ImGui12IsGamepadKeyEi(i32 noundef %1)
  br i1 %34, label %35, label %37

35:                                               ; preds = %.loopexit
  %36 = getelementptr inbounds i8, ptr %0, i64 14058
  store i8 0, ptr %36, align 2, !tbaa !20
  br label %37

37:                                               ; preds = %35, %.loopexit
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  call void @_ZN15ImGuiInputEventC2Ev(ptr noundef nonnull align 4 dereferenceable(21) %5)
  store i32 4, ptr %5, align 4, !tbaa !21
  %38 = call noundef zeroext i1 @_ZN5ImGui12IsGamepadKeyEi(i32 noundef %1)
  %39 = select i1 %38, i32 3, i32 2
  %40 = getelementptr inbounds i8, ptr %5, i64 4
  store i32 %39, ptr %40, align 4, !tbaa !25
  %41 = getelementptr inbounds i8, ptr %5, i64 8
  store i32 %1, ptr %41, align 4, !tbaa !26
  %42 = getelementptr inbounds i8, ptr %5, i64 12
  store i8 %6, ptr %42, align 4, !tbaa !26
  %43 = getelementptr inbounds i8, ptr %5, i64 16
  store float %3, ptr %43, align 4, !tbaa !26
  %44 = getelementptr inbounds i8, ptr %9, i64 14088
  call void @_ZN8ImVectorI15ImGuiInputEventE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 4 dereferenceable(21) %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  br label %45

45:                                               ; preds = %4, %37
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5ImGui10IsNamedKeyEi(i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5ImGui12IsGamepadKeyEi(i32 noundef) local_unnamed_addr #5

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 = { inlinehint 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 #6 = { noreturn nounwind }
attributes #7 = { 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, !7, i64 14057}
!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, !6, i64 64, !6, i64 72, !13, i64 80, !14, i64 84, !6, i64 88, !12, i64 96, !14, i64 104, !14, i64 105, !14, i64 106, !14, i64 107, !14, i64 108, !14, i64 109, !14, i64 110, !13, i64 112, !6, 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, !14, i64 200, !14, i64 201, !14, i64 202, !14, i64 203, !14, i64 204, !14, i64 205, !14, i64 206, !13, i64 208, !11, i64 212, !11, i64 216, !11, i64 220, !11, i64 224, !11, i64 228, !12, i64 232, !7, i64 240, !7, i64 2804, !12, i64 3316, !7, i64 3324, !13, i64 3332, !13, i64 3336, !14, i64 3340, !14, i64 3341, !14, i64 3342, !14, i64 3343, !7, i64 3344, !11, i64 3424, !11, i64 3428, !7, i64 3432, !14, i64 13688, !12, i64 13692, !7, i64 13700, !7, i64 13744, !7, i64 13784, !7, i64 13789, !7, i64 13794, !7, i64 13804, !7, i64 13814, !7, i64 13819, !7, i64 13824, !7, i64 13832, !7, i64 13852, !7, i64 13872, !7, i64 13892, !7, i64 13972, !13, i64 14052, !14, i64 14056, !7, i64 14057, !14, i64 14058, !15, i64 14060, !16, i64 14064}
!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 = !{!11, !11, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!10, !14, i64 14058}
!21 = !{!22, !23, i64 0}
!22 = !{!"_ZTS15ImGuiInputEvent", !23, i64 0, !24, i64 4, !7, i64 8, !14, i64 20}
!23 = !{!"_ZTS19ImGuiInputEventType", !7, i64 0}
!24 = !{!"_ZTS16ImGuiInputSource", !7, i64 0}
!25 = !{!22, !24, i64 4}
!26 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass