; LLVM IR from hadryansalles/Luz :: deps/imgui/imgui.ll (ZN7ImGuiIO14ClearInputKeysEv)

; 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, float, float, float, float, float, float, i8, i8, i8, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i16, i8, i8, i8, i8, i8, i8, i8, float, i32, i32, i32, i32, %struct.ImVec2, [666 x i32], [666 x i8], [16 x float], ptr, %struct.ImVec2, [5 x i8], float, float, i32, i32, i8, i8, i8, i8, i32, [666 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, [5 x float], [5 x float], [5 x %struct.ImVec2], [5 x float], float, i8, i8, i8, i8, i16, %struct.ImVector }
%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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7ImGuiIO14ClearInputKeysEv(ptr noundef nonnull align 8 dereferenceable(14616) %0) #4 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca %struct.ImVec2, align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %6 = load ptr, ptr %2, align 8
  %7 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 64
  %8 = getelementptr inbounds [666 x i8], ptr %7, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 666, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %9

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

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

13:                                               ; preds = %9
  %14 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 78
  %15 = load i32, ptr %3, align 4, !tbaa !9
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [666 x %struct.ImGuiKeyData], ptr %14, i64 0, i64 %16
  %18 = getelementptr inbounds %struct.ImGuiKeyData, ptr %17, i32 0, i32 0
  store i8 0, ptr %18, align 8, !tbaa !11
  %19 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 78
  %20 = load i32, ptr %3, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [666 x %struct.ImGuiKeyData], ptr %19, i64 0, i64 %21
  %23 = getelementptr inbounds %struct.ImGuiKeyData, ptr %22, i32 0, i32 1
  store float -1.000000e+00, ptr %23, align 4, !tbaa !15
  %24 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 78
  %25 = load i32, ptr %3, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [666 x %struct.ImGuiKeyData], ptr %24, i64 0, i64 %26
  %28 = getelementptr inbounds %struct.ImGuiKeyData, ptr %27, i32 0, i32 2
  store float -1.000000e+00, ptr %28, align 8, !tbaa !16
  br label %29

29:                                               ; preds = %13
  %30 = load i32, ptr %3, align 4, !tbaa !9
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %3, align 4, !tbaa !9
  br label %9, !llvm.loop !17

32:                                               ; preds = %12
  %33 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 76
  store i8 0, ptr %33, align 1, !tbaa !19
  %34 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 75
  store i8 0, ptr %34, align 2, !tbaa !25
  %35 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 74
  store i8 0, ptr %35, align 1, !tbaa !26
  %36 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 73
  store i8 0, ptr %36, align 8, !tbaa !27
  %37 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 77
  store i32 0, ptr %37, align 4, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %4, float noundef 0xC7EFFFFFE0000000, float noundef 0xC7EFFFFFE0000000)
  %38 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 67
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %38, ptr align 4 %4, i64 8, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %56, %32
  %40 = load i32, ptr %5, align 4, !tbaa !9
  %41 = icmp slt i32 %40, 5
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %39
  %44 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 68
  %45 = load i32, ptr %5, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [5 x i8], ptr %44, i64 0, i64 %46
  store i8 0, ptr %47, align 1, !tbaa !31
  %48 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 92
  %49 = load i32, ptr %5, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [5 x float], ptr %48, i64 0, i64 %50
  store float -1.000000e+00, ptr %51, align 4, !tbaa !30
  %52 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 91
  %53 = load i32, ptr %5, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [5 x float], ptr %52, i64 0, i64 %54
  store float -1.000000e+00, ptr %55, align 4, !tbaa !30
  br label %56

56:                                               ; preds = %43
  %57 = load i32, ptr %5, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %5, align 4, !tbaa !9
  br label %39, !llvm.loop !32

59:                                               ; preds = %42
  %60 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 70
  store float 0.000000e+00, ptr %60, align 4, !tbaa !33
  %61 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 69
  store float 0.000000e+00, ptr %61, align 8, !tbaa !34
  %62 = getelementptr inbounds %struct.ImGuiIO, ptr %6, i32 0, i32 101
  call void @_ZN8ImVectorItE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %62, i32 noundef 0)
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorItE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #5 align 2

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 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 }

!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, !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 = !{!20, !13, i64 3683}
!20 = !{!"_ZTS7ImGuiIO", !10, i64 0, !10, i64 4, !21, 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, !21, 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, !14, i64 96, !14, i64 100, !14, i64 104, !14, i64 108, !14, i64 112, !14, i64 116, !13, i64 120, !13, i64 121, !13, i64 122, !13, i64 123, !13, i64 124, !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, !22, i64 200, !13, i64 202, !13, i64 203, !13, i64 204, !13, i64 205, !13, i64 206, !13, i64 207, !13, i64 208, !14, i64 212, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !21, i64 232, !7, i64 240, !7, i64 2904, !7, i64 3572, !6, i64 3640, !21, i64 3648, !7, i64 3656, !14, i64 3664, !14, i64 3668, !23, i64 3672, !10, i64 3676, !13, i64 3680, !13, i64 3681, !13, i64 3682, !13, i64 3683, !10, i64 3684, !7, i64 3688, !13, i64 14344, !21, i64 14348, !7, i64 14356, !7, i64 14400, !7, i64 14440, !7, i64 14445, !7, i64 14450, !7, i64 14460, !7, i64 14470, !7, i64 14475, !7, i64 14480, !13, i64 14485, !7, i64 14488, !7, i64 14508, !7, i64 14528, !7, i64 14568, !14, i64 14588, !13, i64 14592, !13, i64 14593, !7, i64 14594, !13, i64 14595, !22, i64 14596, !24, i64 14600}
!21 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!22 = !{!"short", !7, i64 0}
!23 = !{!"_ZTS16ImGuiMouseSource", !7, i64 0}
!24 = !{!"_ZTS8ImVectorItE", !10, i64 0, !10, i64 4, !6, i64 8}
!25 = !{!20, !13, i64 3682}
!26 = !{!20, !13, i64 3681}
!27 = !{!20, !13, i64 3680}
!28 = !{!20, !10, i64 3684}
!29 = !{i64 0, i64 4, !30, i64 4, i64 4, !30}
!30 = !{!14, !14, i64 0}
!31 = !{!13, !13, i64 0}
!32 = distinct !{!32, !18}
!33 = !{!20, !14, i64 3668}
!34 = !{!20, !14, i64 3664}


; 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 }
%struct.ImGuiKeyData = type { i8, float, 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 nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7ImGuiIO14ClearInputKeysEv(ptr noundef nonnull align 8 dereferenceable(14616) %0) local_unnamed_addr #3 align 2 {
  %2 = alloca %struct.ImVec2, align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 2904
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(666) %3, i8 0, i64 666, i1 false)
  %4 = getelementptr inbounds i8, ptr %0, i64 3688
  br label %15

5:                                                ; preds = %15
  %6 = getelementptr inbounds i8, ptr %0, i64 3680
  store i64 0, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %2, float noundef 0xC7EFFFFFE0000000, float noundef 0xC7EFFFFFE0000000)
  %7 = getelementptr inbounds i8, ptr %0, i64 3648
  %8 = load i64, ptr %2, align 8
  store i64 %8, ptr %7, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %9 = getelementptr inbounds i8, ptr %0, i64 3656
  %10 = getelementptr inbounds i8, ptr %0, i64 14488
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(5) %9, i8 0, i64 5, i1 false), !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 14520
  store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, ptr %10, align 8, !tbaa !9
  store <2 x float> <float -1.000000e+00, float -1.000000e+00>, ptr %11, align 8, !tbaa !9
  %12 = getelementptr inbounds i8, ptr %0, i64 14504
  store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, ptr %12, align 8, !tbaa !9
  %13 = getelementptr inbounds i8, ptr %0, i64 3664
  store <2 x float> zeroinitializer, ptr %13, align 8, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %0, i64 14600
  call void @_ZN8ImVectorItE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef 0)
  ret void

15:                                               ; preds = %15, %1
  %indvars.iv = phi i64 [ 0, %1 ], [ %indvars.iv.next.2, %15 ]
  %16 = getelementptr inbounds [666 x %struct.ImGuiKeyData], ptr %4, i64 0, i64 %indvars.iv
  store i8 0, ptr %16, align 8, !tbaa !11
  %17 = getelementptr inbounds i8, ptr %16, i64 4
  store <2 x float> <float -1.000000e+00, float -1.000000e+00>, ptr %17, align 4, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = getelementptr inbounds [666 x %struct.ImGuiKeyData], ptr %4, i64 0, i64 %indvars.iv.next
  store i8 0, ptr %18, align 8, !tbaa !11
  %19 = getelementptr inbounds i8, ptr %18, i64 4
  store <2 x float> <float -1.000000e+00, float -1.000000e+00>, ptr %19, align 4, !tbaa !9
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %20 = getelementptr inbounds [666 x %struct.ImGuiKeyData], ptr %4, i64 0, i64 %indvars.iv.next.1
  store i8 0, ptr %20, align 8, !tbaa !11
  %21 = getelementptr inbounds i8, ptr %20, i64 4
  store <2 x float> <float -1.000000e+00, float -1.000000e+00>, ptr %21, align 4, !tbaa !9
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 666
  br i1 %exitcond.not.2, label %5, label %15, !llvm.loop !13
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorItE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #4 align 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #5 = { nounwind }

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

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


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