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

; 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.ImVector.2 = type { i32, i32, ptr }
%struct.ImDrawData = type { i8, i32, i32, i32, %struct.ImVector.11, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, ptr }
%struct.ImVector.11 = type { i32, i32, ptr }
%struct.ImVec2 = type { float, float }
%struct.ImDrawList = type <{ %struct.ImVector.0, %struct.ImVector.1, %struct.ImVector.2, i32, i32, ptr, ptr, ptr, ptr, %struct.ImVector.3, %struct.ImVector.4, %struct.ImVector, %struct.ImDrawCmdHeader, %struct.ImDrawListSplitter, float, [4 x i8] }>
%struct.ImVector.0 = type { i32, i32, ptr }
%struct.ImVector.1 = type { i32, i32, ptr }
%struct.ImVector.3 = type { i32, i32, ptr }
%struct.ImVector.4 = type { i32, i32, ptr }
%struct.ImVector = type { i32, i32, ptr }
%struct.ImDrawCmdHeader = type <{ %struct.ImVec4, ptr, i32, [4 x i8] }>
%struct.ImVec4 = type { float, float, float, float }
%struct.ImDrawListSplitter = type { i32, i32, %struct.ImVector.5 }
%struct.ImVector.5 = 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: 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) #1

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ImDrawData17DeIndexAllBuffersEv(ptr noundef nonnull align 8 dereferenceable(64) %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.ImVector.2, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #5
  call void @_ZN8ImVectorI10ImDrawVertEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %11 = getelementptr inbounds %struct.ImDrawData, ptr %10, i32 0, i32 2
  store i32 0, ptr %11, align 8, !tbaa !9
  %12 = getelementptr inbounds %struct.ImDrawData, ptr %10, i32 0, i32 3
  store i32 0, ptr %12, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !17
  br label %13

13:                                               ; preds = %87, %1
  %14 = load i32, ptr %4, align 4, !tbaa !17
  %15 = getelementptr inbounds %struct.ImDrawData, ptr %10, i32 0, i32 1
  %16 = load i32, ptr %15, align 4, !tbaa !18
  %17 = icmp slt i32 %14, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %13
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %91

19:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %20 = getelementptr inbounds %struct.ImDrawData, ptr %10, i32 0, i32 4
  %21 = load i32, ptr %4, align 4, !tbaa !17
  %22 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP10ImDrawListEixEi(ptr noundef nonnull align 8 dereferenceable(16) %20, i32 noundef %21)
          to label %23 unwind label %30

23:                                               ; preds = %19
  %24 = load ptr, ptr %22, align 8, !tbaa !5
  store ptr %24, ptr %6, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.ImDrawList, ptr %25, i32 0, i32 1
  %27 = invoke noundef zeroext i1 @_ZNK8ImVectorItE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16) %26)
          to label %28 unwind label %30

28:                                               ; preds = %23
  br i1 %27, label %29, label %34

29:                                               ; preds = %28
  store i32 4, ptr %5, align 4
  br label %84

30:                                               ; preds = %73, %70, %34, %23, %19
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %7, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %8, align 4
  br label %90

34:                                               ; preds = %28
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.ImDrawList, ptr %35, i32 0, i32 1
  %37 = getelementptr inbounds %struct.ImVector.1, ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 8, !tbaa !19
  invoke void @_ZN8ImVectorI10ImDrawVertE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %38)
          to label %39 unwind label %30

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !17
  br label %40

40:                                               ; preds = %63, %39
  %41 = load i32, ptr %9, align 4, !tbaa !17
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.ImDrawList, ptr %42, i32 0, i32 1
  %44 = getelementptr inbounds %struct.ImVector.1, ptr %43, i32 0, i32 0
  %45 = load i32, ptr %44, align 8, !tbaa !19
  %46 = icmp slt i32 %41, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %40
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %70

48:                                               ; preds = %40
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ImDrawList, ptr %49, i32 0, i32 2
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ImDrawList, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %9, align 4, !tbaa !17
  %54 = invoke noundef nonnull align 2 dereferenceable(2) ptr @_ZN8ImVectorItEixEi(ptr noundef nonnull align 8 dereferenceable(16) %52, i32 noundef %53)
          to label %55 unwind label %66

55:                                               ; preds = %48
  %56 = load i16, ptr %54, align 2, !tbaa !31
  %57 = zext i16 %56 to i32
  %58 = invoke noundef nonnull align 4 dereferenceable(20) ptr @_ZN8ImVectorI10ImDrawVertEixEi(ptr noundef nonnull align 8 dereferenceable(16) %50, i32 noundef %57)
          to label %59 unwind label %66

59:                                               ; preds = %55
  %60 = load i32, ptr %9, align 4, !tbaa !17
  %61 = invoke noundef nonnull align 4 dereferenceable(20) ptr @_ZN8ImVectorI10ImDrawVertEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %60)
          to label %62 unwind label %66

62:                                               ; preds = %59
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %61, ptr align 4 %58, i64 20, i1 false), !tbaa.struct !33
  br label %63

63:                                               ; preds = %62
  %64 = load i32, ptr %9, align 4, !tbaa !17
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %9, align 4, !tbaa !17
  br label %40, !llvm.loop !35

66:                                               ; preds = %59, %55, %48
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %7, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %90

70:                                               ; preds = %47
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.ImDrawList, ptr %71, i32 0, i32 2
  invoke void @_ZN8ImVectorI10ImDrawVertE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(16) %72, ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %73 unwind label %30

73:                                               ; preds = %70
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.ImDrawList, ptr %74, i32 0, i32 1
  invoke void @_ZN8ImVectorItE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %75, i32 noundef 0)
          to label %76 unwind label %30

76:                                               ; preds = %73
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.ImDrawList, ptr %77, i32 0, i32 2
  %79 = getelementptr inbounds %struct.ImVector.2, ptr %78, i32 0, i32 0
  %80 = load i32, ptr %79, align 8, !tbaa !37
  %81 = getelementptr inbounds %struct.ImDrawData, ptr %10, i32 0, i32 3
  %82 = load i32, ptr %81, align 4, !tbaa !16
  %83 = add nsw i32 %82, %80
  store i32 %83, ptr %81, align 4, !tbaa !16
  store i32 0, ptr %5, align 4
  br label %84

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

86:                                               ; preds = %84
  br label %87

87:                                               ; preds = %86, %84
  %88 = load i32, ptr %4, align 4, !tbaa !17
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %4, align 4, !tbaa !17
  br label %13, !llvm.loop !38

90:                                               ; preds = %66, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @_ZN8ImVectorI10ImDrawVertED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #5
  br label %92

91:                                               ; preds = %18
  call void @_ZN8ImVectorI10ImDrawVertED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #5
  ret void

92:                                               ; preds = %90
  %93 = load ptr, ptr %7, align 8
  %94 = load i32, ptr %8, align 4
  %95 = insertvalue { ptr, i32 } poison, ptr %93, 0
  %96 = insertvalue { ptr, i32 } %95, i32 %94, 1
  resume { ptr, i32 } %96

97:                                               ; preds = %84
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8ImVectorI10ImDrawVertEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP10ImDrawListEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8ImVectorItE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20) ptr @_ZN8ImVectorI10ImDrawVertEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZN8ImVectorItEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8ImVectorI10ImDrawVertED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 8}
!10 = !{!"_ZTS10ImDrawData", !11, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !13, i64 16, !14, i64 32, !14, i64 40, !14, i64 48, !6, i64 56}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTS8ImVectorIP10ImDrawListE", !12, i64 0, !12, i64 4, !6, i64 8}
!14 = !{!"_ZTS6ImVec2", !15, i64 0, !15, i64 4}
!15 = !{!"float", !7, i64 0}
!16 = !{!10, !12, i64 12}
!17 = !{!12, !12, i64 0}
!18 = !{!10, !12, i64 4}
!19 = !{!20, !12, i64 16}
!20 = !{!"_ZTS10ImDrawList", !21, i64 0, !22, i64 16, !23, i64 32, !12, i64 48, !12, i64 52, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !24, i64 88, !25, i64 104, !26, i64 120, !27, i64 136, !29, i64 168, !15, i64 192}
!21 = !{!"_ZTS8ImVectorI9ImDrawCmdE", !12, i64 0, !12, i64 4, !6, i64 8}
!22 = !{!"_ZTS8ImVectorItE", !12, i64 0, !12, i64 4, !6, i64 8}
!23 = !{!"_ZTS8ImVectorI10ImDrawVertE", !12, i64 0, !12, i64 4, !6, i64 8}
!24 = !{!"_ZTS8ImVectorI6ImVec4E", !12, i64 0, !12, i64 4, !6, i64 8}
!25 = !{!"_ZTS8ImVectorIPvE", !12, i64 0, !12, i64 4, !6, i64 8}
!26 = !{!"_ZTS8ImVectorI6ImVec2E", !12, i64 0, !12, i64 4, !6, i64 8}
!27 = !{!"_ZTS15ImDrawCmdHeader", !28, i64 0, !6, i64 16, !12, i64 24}
!28 = !{!"_ZTS6ImVec4", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12}
!29 = !{!"_ZTS18ImDrawListSplitter", !12, i64 0, !12, i64 4, !30, i64 8}
!30 = !{!"_ZTS8ImVectorI13ImDrawChannelE", !12, i64 0, !12, i64 4, !6, i64 8}
!31 = !{!32, !32, i64 0}
!32 = !{!"short", !7, i64 0}
!33 = !{i64 0, i64 4, !34, i64 4, i64 4, !34, i64 8, i64 4, !34, i64 12, i64 4, !34, i64 16, i64 4, !17}
!34 = !{!15, !15, i64 0}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!20, !12, i64 32}
!38 = distinct !{!38, !36}


; 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.ImVector.2 = type { i32, i32, ptr }

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ImDrawData17DeIndexAllBuffersEv(ptr noundef nonnull align 8 dereferenceable(64) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %struct.ImVector.2, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  call void @_ZN8ImVectorI10ImDrawVertEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 0, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 0, ptr %4, align 4, !tbaa !15
  %5 = getelementptr inbounds i8, ptr %0, i64 4
  %6 = load i32, ptr %5, align 4, !tbaa !16
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph21, label %._crit_edge22

.lr.ph21:                                         ; preds = %1
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  br label %9

._crit_edge22:                                    ; preds = %35, %1
  call void @_ZN8ImVectorI10ImDrawVertED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  ret void

9:                                                ; preds = %.lr.ph21, %35
  %.01719 = phi i32 [ 0, %.lr.ph21 ], [ %36, %35 ]
  %10 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP10ImDrawListEixEi(ptr noundef nonnull align 8 dereferenceable(16) %8, i32 noundef %.01719)
  %11 = load ptr, ptr %10, align 8, !tbaa !17
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  %13 = call noundef zeroext i1 @_ZNK8ImVectorItE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16) %12)
  br i1 %13, label %35, label %16

14:                                               ; preds = %._crit_edge, %16
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN8ImVectorI10ImDrawVertED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  resume { ptr, i32 } %15

16:                                               ; preds = %9
  %17 = load i32, ptr %12, align 8, !tbaa !18
  invoke void @_ZN8ImVectorI10ImDrawVertE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %17)
          to label %.preheader unwind label %14

.preheader:                                       ; preds = %16
  %18 = load i32, ptr %12, align 8, !tbaa !18
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %20 = getelementptr inbounds i8, ptr %11, i64 32
  br label %22

._crit_edge:                                      ; preds = %22, %.preheader
  %21 = getelementptr inbounds i8, ptr %11, i64 32
  call void @_ZN8ImVectorI10ImDrawVertE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %2)
  invoke void @_ZN8ImVectorItE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef 0)
          to label %31 unwind label %14

22:                                               ; preds = %.lr.ph, %22
  %.018 = phi i32 [ 0, %.lr.ph ], [ %28, %22 ]
  %23 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZN8ImVectorItEixEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef %.018)
  %24 = load i16, ptr %23, align 2, !tbaa !30
  %25 = zext i16 %24 to i32
  %26 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZN8ImVectorI10ImDrawVertEixEi(ptr noundef nonnull align 8 dereferenceable(16) %20, i32 noundef %25)
  %27 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZN8ImVectorI10ImDrawVertEixEi(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %.018)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %27, ptr noundef nonnull align 4 dereferenceable(20) %26, i64 20, i1 false), !tbaa.struct !32
  %28 = add nuw nsw i32 %.018, 1
  %29 = load i32, ptr %12, align 8, !tbaa !18
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %22, label %._crit_edge, !llvm.loop !35

31:                                               ; preds = %._crit_edge
  %32 = load i32, ptr %21, align 8, !tbaa !37
  %33 = load i32, ptr %4, align 4, !tbaa !15
  %34 = add nsw i32 %33, %32
  store i32 %34, ptr %4, align 4, !tbaa !15
  br label %35

35:                                               ; preds = %9, %31
  %36 = add nuw nsw i32 %.01719, 1
  %37 = load i32, ptr %5, align 4, !tbaa !16
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %9, label %._crit_edge22, !llvm.loop !38
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8ImVectorI10ImDrawVertEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP10ImDrawListEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8ImVectorItE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20) ptr @_ZN8ImVectorI10ImDrawVertEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZN8ImVectorItEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8ImVectorI10ImDrawVertED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 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 #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, !10, i64 8}
!6 = !{!"_ZTS10ImDrawData", !7, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !11, i64 16, !13, i64 32, !13, i64 40, !13, i64 48, !12, i64 56}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTS8ImVectorIP10ImDrawListE", !10, i64 0, !10, i64 4, !12, i64 8}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !8, i64 0}
!15 = !{!6, !10, i64 12}
!16 = !{!6, !10, i64 4}
!17 = !{!12, !12, i64 0}
!18 = !{!19, !10, i64 16}
!19 = !{!"_ZTS10ImDrawList", !20, i64 0, !21, i64 16, !22, i64 32, !10, i64 48, !10, i64 52, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !23, i64 88, !24, i64 104, !25, i64 120, !26, i64 136, !28, i64 168, !14, i64 192}
!20 = !{!"_ZTS8ImVectorI9ImDrawCmdE", !10, i64 0, !10, i64 4, !12, i64 8}
!21 = !{!"_ZTS8ImVectorItE", !10, i64 0, !10, i64 4, !12, i64 8}
!22 = !{!"_ZTS8ImVectorI10ImDrawVertE", !10, i64 0, !10, i64 4, !12, i64 8}
!23 = !{!"_ZTS8ImVectorI6ImVec4E", !10, i64 0, !10, i64 4, !12, i64 8}
!24 = !{!"_ZTS8ImVectorIPvE", !10, i64 0, !10, i64 4, !12, i64 8}
!25 = !{!"_ZTS8ImVectorI6ImVec2E", !10, i64 0, !10, i64 4, !12, i64 8}
!26 = !{!"_ZTS15ImDrawCmdHeader", !27, i64 0, !12, i64 16, !10, i64 24}
!27 = !{!"_ZTS6ImVec4", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12}
!28 = !{!"_ZTS18ImDrawListSplitter", !10, i64 0, !10, i64 4, !29, i64 8}
!29 = !{!"_ZTS8ImVectorI13ImDrawChannelE", !10, i64 0, !10, i64 4, !12, i64 8}
!30 = !{!31, !31, i64 0}
!31 = !{!"short", !8, i64 0}
!32 = !{i64 0, i64 4, !33, i64 4, i64 4, !33, i64 8, i64 4, !33, i64 12, i64 4, !33, i64 16, i64 4, !34}
!33 = !{!14, !14, i64 0}
!34 = !{!10, !10, i64 0}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!19, !10, i64 32}
!38 = distinct !{!38, !36}


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