; LLVM IR from christoskaramou/PhasmaEngine :: PhasmaEditor/Include/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.13, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, ptr }
%struct.ImVector.13 = 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, %struct.ImVector, %struct.ImDrawCmdHeader, %struct.ImDrawListSplitter, %struct.ImVector.4, %struct.ImVector.5, %struct.ImVector.6, float, ptr }
%struct.ImVector.0 = type { i32, i32, ptr }
%struct.ImVector.1 = type { i32, i32, ptr }
%struct.ImVector = type { i32, i32, ptr }
%struct.ImDrawCmdHeader = type <{ %struct.ImVec4, i64, i32, [4 x i8] }>
%struct.ImVec4 = type { float, float, float, float }
%struct.ImDrawListSplitter = type { i32, i32, %struct.ImVector.3 }
%struct.ImVector.3 = type { i32, i32, ptr }
%struct.ImVector.4 = type { i32, i32, ptr }
%struct.ImVector.5 = type { i32, i32, ptr }
%struct.ImVector.6 = 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 nounwind uwtable
declare dso_local void @_ZN8ImVectorI10ImDrawVertEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ImDrawData17DeIndexAllBuffersEv(ptr noundef nonnull align 8 dereferenceable(64) %0) #4 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 = %86, %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 %90

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 @_ZNK8ImVectorIjE5emptyEv(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 %83

30:                                               ; preds = %72, %69, %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 %89

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 = %62, %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 %69

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 4 dereferenceable(4) ptr @_ZN8ImVectorIjEixEi(ptr noundef nonnull align 8 dereferenceable(16) %52, i32 noundef %53)
          to label %55 unwind label %65

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

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

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

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

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

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

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

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

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

85:                                               ; preds = %83
  br label %86

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

89:                                               ; preds = %65, %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 %91

90:                                               ; 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

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

96:                                               ; preds = %83
  unreachable
}

; 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) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8ImVectorIjE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 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) #2 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) #2 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)) #2 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 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 = { 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, !24, i64 80, !25, i64 96, !28, i64 128, !30, i64 152, !31, i64 168, !32, i64 184, !15, i64 200, !6, i64 208}
!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 = !{!"_ZTS8ImVectorI6ImVec2E", !12, i64 0, !12, i64 4, !6, i64 8}
!25 = !{!"_ZTS15ImDrawCmdHeader", !26, i64 0, !27, i64 16, !12, i64 24}
!26 = !{!"_ZTS6ImVec4", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12}
!27 = !{!"long long", !7, i64 0}
!28 = !{!"_ZTS18ImDrawListSplitter", !12, i64 0, !12, i64 4, !29, i64 8}
!29 = !{!"_ZTS8ImVectorI13ImDrawChannelE", !12, i64 0, !12, i64 4, !6, i64 8}
!30 = !{!"_ZTS8ImVectorI6ImVec4E", !12, i64 0, !12, i64 4, !6, i64 8}
!31 = !{!"_ZTS8ImVectorIyE", !12, i64 0, !12, i64 4, !6, i64 8}
!32 = !{!"_ZTS8ImVectorIhE", !12, i64 0, !12, i64 4, !6, i64 8}
!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 nounwind uwtable
declare dso_local void @_ZN8ImVectorI10ImDrawVertEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ImDrawData17DeIndexAllBuffersEv(ptr noundef nonnull align 8 dereferenceable(64) %0) local_unnamed_addr #4 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 = %34, %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, %34
  %.01719 = phi i32 [ 0, %.lr.ph21 ], [ %35, %34 ]
  %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 @_ZNK8ImVectorIjE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16) %12)
  br i1 %13, label %34, 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 @_ZN8ImVectorIjE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef 0)
          to label %30 unwind label %14

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

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

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

; 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 #2 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 #2 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 #2 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 #2 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 #2 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 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 = { 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, !23, i64 80, !24, i64 96, !27, i64 128, !29, i64 152, !30, i64 168, !31, i64 184, !14, i64 200, !12, i64 208}
!20 = !{!"_ZTS8ImVectorI9ImDrawCmdE", !10, i64 0, !10, i64 4, !12, i64 8}
!21 = !{!"_ZTS8ImVectorIjE", !10, i64 0, !10, i64 4, !12, i64 8}
!22 = !{!"_ZTS8ImVectorI10ImDrawVertE", !10, i64 0, !10, i64 4, !12, i64 8}
!23 = !{!"_ZTS8ImVectorI6ImVec2E", !10, i64 0, !10, i64 4, !12, i64 8}
!24 = !{!"_ZTS15ImDrawCmdHeader", !25, i64 0, !26, i64 16, !10, i64 24}
!25 = !{!"_ZTS6ImVec4", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12}
!26 = !{!"long long", !8, i64 0}
!27 = !{!"_ZTS18ImDrawListSplitter", !10, i64 0, !10, i64 4, !28, i64 8}
!28 = !{!"_ZTS8ImVectorI13ImDrawChannelE", !10, i64 0, !10, i64 4, !12, i64 8}
!29 = !{!"_ZTS8ImVectorI6ImVec4E", !10, i64 0, !10, i64 4, !12, i64 8}
!30 = !{!"_ZTS8ImVectorIyE", !10, i64 0, !10, i64 4, !12, i64 8}
!31 = !{!"_ZTS8ImVectorIhE", !10, i64 0, !10, i64 4, !12, i64 8}
!32 = !{!10, !10, 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, !32}
!34 = !{!14, !14, 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