; LLVM IR from Razakhel/RaZ :: extern/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.1 = type { i32, i32, ptr }
%struct.ImDrawData = type { i8, i32, i32, i32, ptr, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2 }
%struct.ImVec2 = type { float, float }
%struct.ImDrawList = type <{ %struct.ImVector, %struct.ImVector.0, %struct.ImVector.1, i32, i32, ptr, ptr, ptr, ptr, %struct.ImVector.2, %struct.ImVector.3, %struct.ImVector.4, %struct.ImDrawCmdHeader, %struct.ImDrawListSplitter, float, [4 x i8] }>
%struct.ImVector = type { i32, i32, ptr }
%struct.ImVector.0 = type { i32, i32, ptr }
%struct.ImVector.2 = type { i32, i32, ptr }
%struct.ImVector.3 = type { i32, i32, ptr }
%struct.ImVector.4 = 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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorIjE6resizeEi(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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ImDrawData17DeIndexAllBuffersEv(ptr noundef nonnull align 8 dereferenceable(48) %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.ImVector.1, 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 !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !16
  br label %13

13:                                               ; preds = %87, %1
  %14 = load i32, ptr %4, align 4, !tbaa !16
  %15 = getelementptr inbounds %struct.ImDrawData, ptr %10, i32 0, i32 1
  %16 = load i32, ptr %15, align 4, !tbaa !17
  %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 ptr, ptr %20, align 8, !tbaa !18
  %22 = load i32, ptr %4, align 4, !tbaa !16
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds ptr, ptr %21, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  store ptr %25, ptr %6, align 8, !tbaa !5
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.ImDrawList, ptr %26, i32 0, i32 1
  %28 = invoke noundef zeroext i1 @_ZNK8ImVectorIjE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16) %27)
          to label %29 unwind label %31

29:                                               ; preds = %19
  br i1 %28, label %30, label %35

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

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

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

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

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

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

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

56:                                               ; preds = %49
  %57 = load i32, ptr %55, align 4, !tbaa !16
  %58 = invoke noundef nonnull align 4 dereferenceable(20) ptr @_ZN8ImVectorI10ImDrawVertEixEi(ptr noundef nonnull align 8 dereferenceable(16) %51, i32 noundef %57)
          to label %59 unwind label %66

59:                                               ; preds = %56
  %60 = load i32, ptr %9, align 4, !tbaa !16
  %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 !31
  br label %63

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

66:                                               ; preds = %59, %56, %49
  %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 = %48
  %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 %31

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 @_ZN8ImVectorIjE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %75, i32 noundef 0)
          to label %76 unwind label %31

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.1, ptr %78, i32 0, i32 0
  %80 = load i32, ptr %79, align 8, !tbaa !35
  %81 = getelementptr inbounds %struct.ImDrawData, ptr %10, i32 0, i32 3
  %82 = load i32, ptr %81, align 4, !tbaa !15
  %83 = add nsw i32 %82, %80
  store i32 %83, ptr %81, align 4, !tbaa !15
  store i32 0, ptr %5, align 4
  br label %84

84:                                               ; preds = %76, %30
  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 !16
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %4, align 4, !tbaa !16
  br label %13, !llvm.loop !36

90:                                               ; preds = %66, %31
  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 zeroext i1 @_ZNK8ImVectorIjE5emptyEv(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 4 dereferenceable(4) ptr @_ZN8ImVectorIjEixEi(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, !6, i64 16, !13, i64 24, !13, i64 32, !13, i64 40}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !7, i64 0}
!15 = !{!10, !12, i64 12}
!16 = !{!12, !12, i64 0}
!17 = !{!10, !12, i64 4}
!18 = !{!10, !6, i64 16}
!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, !14, i64 192}
!21 = !{!"_ZTS8ImVectorI9ImDrawCmdE", !12, i64 0, !12, i64 4, !6, i64 8}
!22 = !{!"_ZTS8ImVectorIjE", !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", !14, i64 0, !14, i64 4, !14, i64 8, !14, 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 = !{i64 0, i64 4, !32, i64 4, i64 4, !32, i64 8, i64 4, !32, i64 12, i64 4, !32, i64 16, i64 4, !16}
!32 = !{!14, !14, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!20, !12, i64 32}
!36 = distinct !{!36, !34}


; 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.1 = 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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorIjE6resizeEi(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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ImDrawData17DeIndexAllBuffersEv(ptr nocapture noundef nonnull align 8 dereferenceable(48) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %struct.ImVector.1, 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 !14
  %5 = getelementptr inbounds i8, ptr %0, i64 4
  %6 = load i32, ptr %5, align 4, !tbaa !15
  %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
  %indvars.iv = phi i64 [ 0, %.lr.ph21 ], [ %indvars.iv.next, %35 ]
  %10 = load ptr, ptr %8, align 8, !tbaa !16
  %11 = getelementptr inbounds ptr, ptr %10, i64 %indvars.iv
  %12 = load ptr, ptr %11, align 8, !tbaa !17
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = call noundef zeroext i1 @_ZNK8ImVectorIjE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  br i1 %14, label %35, label %17

15:                                               ; preds = %._crit_edge, %17
  %16 = 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 } %16

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

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

.lr.ph:                                           ; preds = %.preheader
  %21 = getelementptr inbounds i8, ptr %12, i64 32
  br label %23

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

23:                                               ; preds = %.lr.ph, %23
  %.018 = phi i32 [ 0, %.lr.ph ], [ %28, %23 ]
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8ImVectorIjEixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %.018)
  %25 = load i32, ptr %24, align 4, !tbaa !30
  %26 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZN8ImVectorI10ImDrawVertEixEi(ptr noundef nonnull align 8 dereferenceable(16) %21, 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 !31
  %28 = add nuw nsw i32 %.018, 1
  %29 = load i32, ptr %13, align 8, !tbaa !18
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %23, label %._crit_edge, !llvm.loop !33

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

35:                                               ; preds = %9, %31
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %36 = load i32, ptr %5, align 4, !tbaa !15
  %37 = sext i32 %36 to i64
  %38 = icmp slt i64 %indvars.iv.next, %37
  br i1 %38, label %9, label %._crit_edge22, !llvm.loop !36
}

; 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 zeroext i1 @_ZNK8ImVectorIjE5emptyEv(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 4 dereferenceable(4) ptr @_ZN8ImVectorIjEixEi(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, !12, i64 24, !12, i64 32, !12, i64 40}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_ZTS6ImVec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !8, i64 0}
!14 = !{!6, !10, i64 12}
!15 = !{!6, !10, i64 4}
!16 = !{!6, !11, i64 16}
!17 = !{!11, !11, i64 0}
!18 = !{!19, !10, i64 16}
!19 = !{!"_ZTS10ImDrawList", !20, i64 0, !21, i64 16, !22, i64 32, !10, i64 48, !10, i64 52, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !23, i64 88, !24, i64 104, !25, i64 120, !26, i64 136, !28, i64 168, !13, i64 192}
!20 = !{!"_ZTS8ImVectorI9ImDrawCmdE", !10, i64 0, !10, i64 4, !11, i64 8}
!21 = !{!"_ZTS8ImVectorIjE", !10, i64 0, !10, i64 4, !11, i64 8}
!22 = !{!"_ZTS8ImVectorI10ImDrawVertE", !10, i64 0, !10, i64 4, !11, i64 8}
!23 = !{!"_ZTS8ImVectorI6ImVec4E", !10, i64 0, !10, i64 4, !11, i64 8}
!24 = !{!"_ZTS8ImVectorIPvE", !10, i64 0, !10, i64 4, !11, i64 8}
!25 = !{!"_ZTS8ImVectorI6ImVec2E", !10, i64 0, !10, i64 4, !11, i64 8}
!26 = !{!"_ZTS15ImDrawCmdHeader", !27, i64 0, !11, i64 16, !10, i64 24}
!27 = !{!"_ZTS6ImVec4", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!28 = !{!"_ZTS18ImDrawListSplitter", !10, i64 0, !10, i64 4, !29, i64 8}
!29 = !{!"_ZTS8ImVectorI13ImDrawChannelE", !10, i64 0, !10, i64 4, !11, i64 8}
!30 = !{!10, !10, i64 0}
!31 = !{i64 0, i64 4, !32, i64 4, i64 4, !32, i64 8, i64 4, !32, i64 12, i64 4, !32, i64 16, i64 4, !30}
!32 = !{!13, !13, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!19, !10, i64 32}
!36 = distinct !{!36, !34}


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