; LLVM IR from xhub/reshop :: gui/external/imgui/imgui.ll (ZN7ImGuiIO15ClearInputMouseEv)

; 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.ImVec2 = type { float, float }
%struct.ImGuiIO = type { i32, i32, %struct.ImVec2, float, float, ptr, ptr, ptr, ptr, float, i8, ptr, %struct.ImVec2, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, float, float, float, float, float, float, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, float, i32, i32, i32, i32, %struct.ImVec2, ptr, %struct.ImVec2, [5 x i8], float, float, i32, i8, i8, i8, i8, i32, [154 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], i8, i8, [5 x float], [5 x float], [5 x float], float, i8, i8, i16, %struct.ImVector, ptr, ptr, ptr }
%struct.ImGuiKeyData = type { i8, float, float, float }
%struct.ImVector = type { i32, i32, ptr }

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #1 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7ImGuiIO15ClearInputMouseEv(ptr noundef nonnull align 8 dereferenceable(2976) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca %struct.ImVec2, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 655, ptr %3, align 4, !tbaa !9
  br label %8

8:                                                ; preds = %24, %1
  %9 = load i32, ptr %3, align 4, !tbaa !9
  %10 = icmp slt i32 %9, 662
  br i1 %10, label %12, label %11

11:                                               ; preds = %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %27

12:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %13 = getelementptr inbounds %struct.ImGuiIO, ptr %7, i32 0, i32 75
  %14 = load i32, ptr %3, align 4, !tbaa !9
  %15 = sub nsw i32 %14, 512
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [154 x %struct.ImGuiKeyData], ptr %13, i64 0, i64 %16
  store ptr %17, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.ImGuiKeyData, ptr %18, i32 0, i32 0
  store i8 0, ptr %19, align 4, !tbaa !11
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.ImGuiKeyData, ptr %20, i32 0, i32 1
  store float -1.000000e+00, ptr %21, align 4, !tbaa !15
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.ImGuiKeyData, ptr %22, i32 0, i32 2
  store float -1.000000e+00, ptr %23, align 4, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %24

24:                                               ; preds = %12
  %25 = load i32, ptr %3, align 4, !tbaa !9
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %3, align 4, !tbaa !9
  br label %8, !llvm.loop !17

27:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef 0xC7EFFFFFE0000000, float noundef 0xC7EFFFFFE0000000)
  %28 = getelementptr inbounds %struct.ImGuiIO, ptr %7, i32 0, i32 65
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %28, ptr align 4 %5, i64 8, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !21
  br label %29

29:                                               ; preds = %46, %27
  %30 = load i32, ptr %6, align 4, !tbaa !21
  %31 = icmp slt i32 %30, 5
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %49

33:                                               ; preds = %29
  %34 = getelementptr inbounds %struct.ImGuiIO, ptr %7, i32 0, i32 66
  %35 = load i32, ptr %6, align 4, !tbaa !21
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [5 x i8], ptr %34, i64 0, i64 %36
  store i8 0, ptr %37, align 1, !tbaa !23
  %38 = getelementptr inbounds %struct.ImGuiIO, ptr %7, i32 0, i32 90
  %39 = load i32, ptr %6, align 4, !tbaa !21
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [5 x float], ptr %38, i64 0, i64 %40
  store float -1.000000e+00, ptr %41, align 4, !tbaa !20
  %42 = getelementptr inbounds %struct.ImGuiIO, ptr %7, i32 0, i32 89
  %43 = load i32, ptr %6, align 4, !tbaa !21
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [5 x float], ptr %42, i64 0, i64 %44
  store float -1.000000e+00, ptr %45, align 4, !tbaa !20
  br label %46

46:                                               ; preds = %33
  %47 = load i32, ptr %6, align 4, !tbaa !21
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %6, align 4, !tbaa !21
  br label %29, !llvm.loop !24

49:                                               ; preds = %32
  %50 = getelementptr inbounds %struct.ImGuiIO, ptr %7, i32 0, i32 68
  store float 0.000000e+00, ptr %50, align 4, !tbaa !25
  %51 = getelementptr inbounds %struct.ImGuiIO, ptr %7, i32 0, i32 67
  store float 0.000000e+00, ptr %51, align 8, !tbaa !31
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { 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 = !{!"_ZTS8ImGuiKey", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS12ImGuiKeyData", !13, i64 0, !14, i64 4, !14, i64 8, !14, i64 12}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!12, !14, i64 4}
!16 = !{!12, !14, i64 8}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{i64 0, i64 4, !20, i64 4, i64 4, !20}
!20 = !{!14, !14, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = !{!13, !13, i64 0}
!24 = distinct !{!24, !18}
!25 = !{!26, !14, i64 244}
!26 = !{!"_ZTS7ImGuiIO", !22, i64 0, !22, i64 4, !27, i64 8, !14, i64 16, !14, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !14, i64 56, !13, i64 60, !6, i64 64, !27, i64 72, !13, i64 80, !13, i64 81, !13, i64 82, !13, i64 83, !13, i64 84, !13, i64 85, !13, i64 86, !13, i64 87, !13, i64 88, !13, i64 89, !13, i64 90, !13, i64 91, !13, i64 92, !13, i64 93, !13, i64 94, !13, i64 95, !13, i64 96, !14, i64 100, !14, i64 104, !14, i64 108, !14, i64 112, !14, i64 116, !14, i64 120, !13, i64 124, !13, i64 125, !13, i64 126, !13, i64 127, !13, i64 128, !13, i64 129, !13, i64 130, !13, i64 131, !13, i64 132, !13, i64 133, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !13, i64 176, !13, i64 177, !13, i64 178, !13, i64 179, !13, i64 180, !13, i64 181, !13, i64 182, !14, i64 184, !22, i64 188, !22, i64 192, !22, i64 196, !22, i64 200, !27, i64 204, !6, i64 216, !27, i64 224, !7, i64 232, !14, i64 240, !14, i64 244, !28, i64 248, !13, i64 252, !13, i64 253, !13, i64 254, !13, i64 255, !22, i64 256, !7, i64 260, !13, i64 2724, !27, i64 2728, !7, i64 2736, !7, i64 2776, !7, i64 2816, !7, i64 2821, !7, i64 2826, !7, i64 2836, !7, i64 2846, !7, i64 2851, !7, i64 2856, !13, i64 2861, !13, i64 2862, !7, i64 2864, !7, i64 2884, !7, i64 2904, !14, i64 2924, !13, i64 2928, !13, i64 2929, !29, i64 2930, !30, i64 2936, !6, i64 2952, !6, i64 2960, !6, i64 2968}
!27 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!28 = !{!"_ZTS16ImGuiMouseSource", !7, i64 0}
!29 = !{!"short", !7, i64 0}
!30 = !{!"_ZTS8ImVectorItE", !22, i64 0, !22, i64 4, !6, i64 8}
!31 = !{!26, !14, i64 240}


; 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.ImVec2 = type { float, float }

; 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 nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN7ImGuiIO15ClearInputMouseEv(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(2976) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %struct.ImVec2, align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 2548
  store i8 0, ptr %3, align 4, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 2552
  store <2 x float> <float -1.000000e+00, float -1.000000e+00>, ptr %4, align 8, !tbaa !11
  %5 = getelementptr inbounds i8, ptr %0, i64 2564
  store i8 0, ptr %5, align 4, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 2568
  store <2 x float> <float -1.000000e+00, float -1.000000e+00>, ptr %6, align 8, !tbaa !11
  %7 = getelementptr inbounds i8, ptr %0, i64 2580
  store i8 0, ptr %7, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 2584
  store <2 x float> <float -1.000000e+00, float -1.000000e+00>, ptr %8, align 8, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %0, i64 2596
  store i8 0, ptr %9, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 2600
  store <2 x float> <float -1.000000e+00, float -1.000000e+00>, ptr %10, align 8, !tbaa !11
  %11 = getelementptr inbounds i8, ptr %0, i64 2612
  store i8 0, ptr %11, align 4, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 2616
  store <2 x float> <float -1.000000e+00, float -1.000000e+00>, ptr %12, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %0, i64 2628
  store i8 0, ptr %13, align 4, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %0, i64 2632
  store <2 x float> <float -1.000000e+00, float -1.000000e+00>, ptr %14, align 8, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %0, i64 2644
  store i8 0, ptr %15, align 4, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 2648
  store <2 x float> <float -1.000000e+00, float -1.000000e+00>, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %2, float noundef 0xC7EFFFFFE0000000, float noundef 0xC7EFFFFFE0000000)
  %17 = getelementptr inbounds i8, ptr %0, i64 224
  %18 = load i64, ptr %2, align 8
  store i64 %18, ptr %17, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  %19 = getelementptr inbounds i8, ptr %0, i64 232
  %20 = getelementptr inbounds i8, ptr %0, i64 2864
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(5) %19, i8 0, i64 5, i1 false), !tbaa !12
  %21 = getelementptr inbounds i8, ptr %0, i64 2896
  store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, ptr %20, align 8, !tbaa !11
  store <2 x float> <float -1.000000e+00, float -1.000000e+00>, ptr %21, align 8, !tbaa !11
  %22 = getelementptr inbounds i8, ptr %0, i64 2880
  store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, ptr %22, align 8, !tbaa !11
  %23 = getelementptr inbounds i8, ptr %0, i64 240
  store <2 x float> zeroinitializer, ptr %23, align 8, !tbaa !11
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS12ImGuiKeyData", !7, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass