; LLVM IR from Eukky/TRender :: lib/imgui/imgui_draw.ll (Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv)

; 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"

%class.ImVector.11 = type { i32, i32, ptr }
%struct.ImFontAtlas = type <{ i32, [4 x i8], ptr, i32, i32, ptr, ptr, i32, i32, %struct.ImVec2, %struct.ImVec2, %class.ImVector.8, %class.ImVector.9, %class.ImVector.10, [1 x i32], [4 x i8] }>
%struct.ImVec2 = type { float, float }
%class.ImVector.8 = type { i32, i32, ptr }
%class.ImVector.9 = type { i32, i32, ptr }
%class.ImVector.10 = type { i32, i32, ptr }
%"struct.ImFontAtlas::CustomRect" = type { i32, i16, i16, i16, i16, float, %struct.ImVec2, ptr }
%struct.stbrp_rect = type { i32, i16, i16, i16, i16, i32 }

@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv = external hidden unnamed_addr constant [60 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [82 x i8], align 1

; 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 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) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv(ptr noundef %0, ptr noundef %1) #4 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %class.ImVector.11, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %12, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.ImFontAtlas, ptr %13, i32 0, i32 12
  store ptr %14, ptr %6, align 8, !tbaa !5
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = getelementptr inbounds %class.ImVector.9, ptr %15, i32 0, i32 0
  %17 = load i32, ptr %16, align 8, !tbaa !9
  %18 = icmp sge i32 %17, 1
  br i1 %18, label %19, label %20

19:                                               ; preds = %2
  br label %22

20:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.31, ptr noundef @.str.1, i32 noundef 1942, ptr noundef @__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv) #7
  unreachable

21:                                               ; No predecessors!
  br label %22

22:                                               ; preds = %21, %19
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  call void @_ZN8ImVectorI10stbrp_rectEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %class.ImVector.9, ptr %23, i32 0, i32 0
  %25 = load i32, ptr %24, align 8, !tbaa !9
  invoke void @_ZN8ImVectorI10stbrp_rectE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %25)
          to label %26 unwind label %41

26:                                               ; preds = %22
  %27 = getelementptr inbounds %class.ImVector.11, ptr %7, i32 0, i32 2
  %28 = load ptr, ptr %27, align 8, !tbaa !12
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.ImVector.9, ptr %29, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = mul i64 16, %32
  call void @llvm.memset.p0.i64(ptr align 4 %28, i8 0, i64 %33, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !14
  br label %34

34:                                               ; preds = %66, %26
  %35 = load i32, ptr %10, align 4, !tbaa !14
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %class.ImVector.9, ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 8, !tbaa !9
  %39 = icmp slt i32 %35, %38
  br i1 %39, label %45, label %40

40:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %73

41:                                               ; preds = %76, %73, %22
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %8, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %9, align 4
  br label %179

45:                                               ; preds = %34
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = load i32, ptr %10, align 4, !tbaa !14
  %48 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorIN11ImFontAtlas10CustomRectEEixEi(ptr noundef nonnull align 8 dereferenceable(16) %46, i32 noundef %47)
          to label %49 unwind label %69

49:                                               ; preds = %45
  %50 = getelementptr inbounds %"struct.ImFontAtlas::CustomRect", ptr %48, i32 0, i32 1
  %51 = load i16, ptr %50, align 4, !tbaa !15
  %52 = load i32, ptr %10, align 4, !tbaa !14
  %53 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %52)
          to label %54 unwind label %69

54:                                               ; preds = %49
  %55 = getelementptr inbounds %struct.stbrp_rect, ptr %53, i32 0, i32 1
  store i16 %51, ptr %55, align 4, !tbaa !20
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = load i32, ptr %10, align 4, !tbaa !14
  %58 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorIN11ImFontAtlas10CustomRectEEixEi(ptr noundef nonnull align 8 dereferenceable(16) %56, i32 noundef %57)
          to label %59 unwind label %69

59:                                               ; preds = %54
  %60 = getelementptr inbounds %"struct.ImFontAtlas::CustomRect", ptr %58, i32 0, i32 2
  %61 = load i16, ptr %60, align 2, !tbaa !22
  %62 = load i32, ptr %10, align 4, !tbaa !14
  %63 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %62)
          to label %64 unwind label %69

64:                                               ; preds = %59
  %65 = getelementptr inbounds %struct.stbrp_rect, ptr %63, i32 0, i32 2
  store i16 %61, ptr %65, align 2, !tbaa !23
  br label %66

66:                                               ; preds = %64
  %67 = load i32, ptr %10, align 4, !tbaa !14
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %10, align 4, !tbaa !14
  br label %34, !llvm.loop !24

69:                                               ; preds = %59, %54, %49, %45
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %8, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %179

73:                                               ; preds = %40
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 0)
          to label %76 unwind label %41

76:                                               ; preds = %73
  %77 = getelementptr inbounds %class.ImVector.11, ptr %7, i32 0, i32 0
  %78 = load i32, ptr %77, align 8, !tbaa !26
  %79 = invoke noundef i32 @_ZL16stbrp_pack_rectsP13stbrp_contextP10stbrp_recti(ptr noundef %74, ptr noundef %75, i32 noundef %78)
          to label %80 unwind label %41

80:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !14
  br label %81

81:                                               ; preds = %175, %80
  %82 = load i32, ptr %11, align 4, !tbaa !14
  %83 = getelementptr inbounds %class.ImVector.11, ptr %7, i32 0, i32 0
  %84 = load i32, ptr %83, align 8, !tbaa !26
  %85 = icmp slt i32 %82, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %178

87:                                               ; preds = %81
  %88 = load i32, ptr %11, align 4, !tbaa !14
  %89 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %88)
          to label %90 unwind label %148

90:                                               ; preds = %87
  %91 = getelementptr inbounds %struct.stbrp_rect, ptr %89, i32 0, i32 5
  %92 = load i32, ptr %91, align 4, !tbaa !27
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %174

94:                                               ; preds = %90
  %95 = load i32, ptr %11, align 4, !tbaa !14
  %96 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %95)
          to label %97 unwind label %148

97:                                               ; preds = %94
  %98 = getelementptr inbounds %struct.stbrp_rect, ptr %96, i32 0, i32 3
  %99 = load i16, ptr %98, align 4, !tbaa !28
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = load i32, ptr %11, align 4, !tbaa !14
  %102 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorIN11ImFontAtlas10CustomRectEEixEi(ptr noundef nonnull align 8 dereferenceable(16) %100, i32 noundef %101)
          to label %103 unwind label %148

103:                                              ; preds = %97
  %104 = getelementptr inbounds %"struct.ImFontAtlas::CustomRect", ptr %102, i32 0, i32 3
  store i16 %99, ptr %104, align 8, !tbaa !29
  %105 = load i32, ptr %11, align 4, !tbaa !14
  %106 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %105)
          to label %107 unwind label %148

107:                                              ; preds = %103
  %108 = getelementptr inbounds %struct.stbrp_rect, ptr %106, i32 0, i32 4
  %109 = load i16, ptr %108, align 2, !tbaa !30
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = load i32, ptr %11, align 4, !tbaa !14
  %112 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorIN11ImFontAtlas10CustomRectEEixEi(ptr noundef nonnull align 8 dereferenceable(16) %110, i32 noundef %111)
          to label %113 unwind label %148

113:                                              ; preds = %107
  %114 = getelementptr inbounds %"struct.ImFontAtlas::CustomRect", ptr %112, i32 0, i32 4
  store i16 %109, ptr %114, align 2, !tbaa !31
  %115 = load i32, ptr %11, align 4, !tbaa !14
  %116 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %115)
          to label %117 unwind label %148

117:                                              ; preds = %113
  %118 = getelementptr inbounds %struct.stbrp_rect, ptr %116, i32 0, i32 1
  %119 = load i16, ptr %118, align 4, !tbaa !20
  %120 = zext i16 %119 to i32
  %121 = load ptr, ptr %6, align 8, !tbaa !5
  %122 = load i32, ptr %11, align 4, !tbaa !14
  %123 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorIN11ImFontAtlas10CustomRectEEixEi(ptr noundef nonnull align 8 dereferenceable(16) %121, i32 noundef %122)
          to label %124 unwind label %148

124:                                              ; preds = %117
  %125 = getelementptr inbounds %"struct.ImFontAtlas::CustomRect", ptr %123, i32 0, i32 1
  %126 = load i16, ptr %125, align 4, !tbaa !15
  %127 = zext i16 %126 to i32
  %128 = icmp eq i32 %120, %127
  br i1 %128, label %129, label %144

129:                                              ; preds = %124
  %130 = load i32, ptr %11, align 4, !tbaa !14
  %131 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %130)
          to label %132 unwind label %148

132:                                              ; preds = %129
  %133 = getelementptr inbounds %struct.stbrp_rect, ptr %131, i32 0, i32 2
  %134 = load i16, ptr %133, align 2, !tbaa !23
  %135 = zext i16 %134 to i32
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = load i32, ptr %11, align 4, !tbaa !14
  %138 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorIN11ImFontAtlas10CustomRectEEixEi(ptr noundef nonnull align 8 dereferenceable(16) %136, i32 noundef %137)
          to label %139 unwind label %148

139:                                              ; preds = %132
  %140 = getelementptr inbounds %"struct.ImFontAtlas::CustomRect", ptr %138, i32 0, i32 2
  %141 = load i16, ptr %140, align 2, !tbaa !22
  %142 = zext i16 %141 to i32
  %143 = icmp eq i32 %135, %142
  br label %144

144:                                              ; preds = %139, %124
  %145 = phi i1 [ false, %124 ], [ %143, %139 ]
  br i1 %145, label %146, label %147

146:                                              ; preds = %144
  br label %153

147:                                              ; preds = %144
  call void @__assert_fail(ptr noundef @.str.32, ptr noundef @.str.1, i32 noundef 1958, ptr noundef @__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv) #7
  unreachable

148:                                              ; preds = %165, %159, %153, %132, %129, %117, %113, %107, %103, %97, %94, %87
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %8, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %179

152:                                              ; No predecessors!
  br label %153

153:                                              ; preds = %152, %146
  %154 = load ptr, ptr %3, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.ImFontAtlas, ptr %154, i32 0, i32 8
  %156 = load i32, ptr %155, align 4, !tbaa !32
  %157 = load i32, ptr %11, align 4, !tbaa !14
  %158 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %157)
          to label %159 unwind label %148

159:                                              ; preds = %153
  %160 = getelementptr inbounds %struct.stbrp_rect, ptr %158, i32 0, i32 4
  %161 = load i16, ptr %160, align 2, !tbaa !30
  %162 = zext i16 %161 to i32
  %163 = load i32, ptr %11, align 4, !tbaa !14
  %164 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %163)
          to label %165 unwind label %148

165:                                              ; preds = %159
  %166 = getelementptr inbounds %struct.stbrp_rect, ptr %164, i32 0, i32 2
  %167 = load i16, ptr %166, align 2, !tbaa !23
  %168 = zext i16 %167 to i32
  %169 = add nsw i32 %162, %168
  %170 = invoke noundef i32 @_ZL5ImMaxIiET_S0_S0_(i32 noundef %156, i32 noundef %169)
          to label %171 unwind label %148

171:                                              ; preds = %165
  %172 = load ptr, ptr %3, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.ImFontAtlas, ptr %172, i32 0, i32 8
  store i32 %170, ptr %173, align 4, !tbaa !32
  br label %174

174:                                              ; preds = %171, %90
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %11, align 4, !tbaa !14
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %11, align 4, !tbaa !14
  br label %81, !llvm.loop !36

178:                                              ; preds = %86
  call void @_ZN8ImVectorI10stbrp_rectED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void

179:                                              ; preds = %148, %69, %41
  call void @_ZN8ImVectorI10stbrp_rectED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %180

180:                                              ; preds = %179
  %181 = load ptr, ptr %8, align 8
  %182 = load i32, ptr %9, align 4
  %183 = insertvalue { ptr, i32 } poison, ptr %181, 0
  %184 = insertvalue { ptr, i32 } %183, i32 %182, 1
  resume { ptr, i32 } %184
}

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL16stbrp_pack_rectsP13stbrp_contextP10stbrp_recti(ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL5ImMaxIiET_S0_S0_(i32 noundef, i32 noundef) #3

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { noreturn nounwind "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 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 #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 }
attributes #7 = { noreturn 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, !11, i64 0}
!10 = !{!"_ZTS8ImVectorIN11ImFontAtlas10CustomRectEE", !11, i64 0, !11, i64 4, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 8}
!13 = !{!"_ZTS8ImVectorI10stbrp_rectE", !11, i64 0, !11, i64 4, !6, i64 8}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !17, i64 4}
!16 = !{!"_ZTSN11ImFontAtlas10CustomRectE", !11, i64 0, !17, i64 4, !17, i64 6, !17, i64 8, !17, i64 10, !18, i64 12, !19, i64 16, !6, i64 24}
!17 = !{!"short", !7, i64 0}
!18 = !{!"float", !7, i64 0}
!19 = !{!"_ZTS6ImVec2", !18, i64 0, !18, i64 4}
!20 = !{!21, !17, i64 4}
!21 = !{!"_ZTS10stbrp_rect", !11, i64 0, !17, i64 4, !17, i64 6, !17, i64 8, !17, i64 10, !11, i64 12}
!22 = !{!16, !17, i64 6}
!23 = !{!21, !17, i64 6}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!13, !11, i64 0}
!27 = !{!21, !11, i64 12}
!28 = !{!21, !17, i64 8}
!29 = !{!16, !17, i64 8}
!30 = !{!21, !17, i64 10}
!31 = !{!16, !17, i64 10}
!32 = !{!33, !11, i64 44}
!33 = !{!"_ZTS11ImFontAtlas", !11, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 44, !19, i64 48, !19, i64 56, !34, i64 64, !10, i64 80, !35, i64 96, !7, i64 112}
!34 = !{!"_ZTS8ImVectorIP6ImFontE", !11, i64 0, !11, i64 4, !6, i64 8}
!35 = !{!"_ZTS8ImVectorI12ImFontConfigE", !11, i64 0, !11, i64 4, !6, i64 8}
!36 = distinct !{!36, !25}


; 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"

%class.ImVector.11 = type { i32, i32, ptr }

@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv = external hidden unnamed_addr constant [60 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [82 x i8], align 1

; 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 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) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv(ptr noundef %0, ptr noundef %1) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.ImVector.11, align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 80
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %8, label %7

7:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.31, ptr noundef nonnull @.str.1, i32 noundef 1942, ptr noundef nonnull @__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv) #6
  unreachable

8:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  call void @_ZN8ImVectorI10stbrp_rectEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %9 = load i32, ptr %4, align 8, !tbaa !5
  invoke void @_ZN8ImVectorI10stbrp_rectE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %9)
          to label %10 unwind label %24

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %13 = load i32, ptr %4, align 8, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = shl nsw i64 %14, 4
  call void @llvm.memset.p0.i64(ptr align 4 %12, i8 0, i64 %15, i1 false)
  %16 = load i32, ptr %4, align 8, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %10
  %18 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef 0)
  %19 = load i32, ptr %3, align 8, !tbaa !13
  %20 = invoke noundef i32 @_ZL16stbrp_pack_rectsP13stbrp_contextP10stbrp_recti(ptr noundef %1, ptr noundef nonnull %18, i32 noundef %19)
          to label %.preheader unwind label %24

.preheader:                                       ; preds = %._crit_edge
  %21 = load i32, ptr %3, align 8, !tbaa !13
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph38, label %._crit_edge39

.lr.ph38:                                         ; preds = %.preheader
  %23 = getelementptr inbounds i8, ptr %0, i64 44
  br label %39

24:                                               ; preds = %._crit_edge, %8
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN8ImVectorI10stbrp_rectED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  resume { ptr, i32 } %25

.lr.ph:                                           ; preds = %10, %.lr.ph
  %.03536 = phi i32 [ %36, %.lr.ph ], [ 0, %10 ]
  %26 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorIN11ImFontAtlas10CustomRectEEixEi(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %.03536)
  %27 = getelementptr inbounds i8, ptr %26, i64 4
  %28 = load i16, ptr %27, align 4, !tbaa !14
  %29 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.03536)
  %30 = getelementptr inbounds i8, ptr %29, i64 4
  store i16 %28, ptr %30, align 4, !tbaa !19
  %31 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorIN11ImFontAtlas10CustomRectEEixEi(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %.03536)
  %32 = getelementptr inbounds i8, ptr %31, i64 6
  %33 = load i16, ptr %32, align 2, !tbaa !21
  %34 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.03536)
  %35 = getelementptr inbounds i8, ptr %34, i64 6
  store i16 %33, ptr %35, align 2, !tbaa !22
  %36 = add nuw nsw i32 %.03536, 1
  %37 = load i32, ptr %4, align 8, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %.lr.ph, label %._crit_edge, !llvm.loop !23

._crit_edge39:                                    ; preds = %81, %.preheader
  call void @_ZN8ImVectorI10stbrp_rectED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  ret void

39:                                               ; preds = %.lr.ph38, %81
  %.037 = phi i32 [ 0, %.lr.ph38 ], [ %82, %81 ]
  %40 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.037)
  %41 = getelementptr inbounds i8, ptr %40, i64 12
  %42 = load i32, ptr %41, align 4, !tbaa !25
  %.not = icmp eq i32 %42, 0
  br i1 %.not, label %81, label %43

43:                                               ; preds = %39
  %44 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.037)
  %45 = getelementptr inbounds i8, ptr %44, i64 8
  %46 = load i16, ptr %45, align 4, !tbaa !26
  %47 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorIN11ImFontAtlas10CustomRectEEixEi(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %.037)
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  store i16 %46, ptr %48, align 8, !tbaa !27
  %49 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.037)
  %50 = getelementptr inbounds i8, ptr %49, i64 10
  %51 = load i16, ptr %50, align 2, !tbaa !28
  %52 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorIN11ImFontAtlas10CustomRectEEixEi(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %.037)
  %53 = getelementptr inbounds i8, ptr %52, i64 10
  store i16 %51, ptr %53, align 2, !tbaa !29
  %54 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.037)
  %55 = getelementptr inbounds i8, ptr %54, i64 4
  %56 = load i16, ptr %55, align 4, !tbaa !19
  %57 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorIN11ImFontAtlas10CustomRectEEixEi(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %.037)
  %58 = getelementptr inbounds i8, ptr %57, i64 4
  %59 = load i16, ptr %58, align 4, !tbaa !14
  %60 = icmp eq i16 %56, %59
  br i1 %60, label %61, label %.critedge

61:                                               ; preds = %43
  %62 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.037)
  %63 = getelementptr inbounds i8, ptr %62, i64 6
  %64 = load i16, ptr %63, align 2, !tbaa !22
  %65 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorIN11ImFontAtlas10CustomRectEEixEi(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %.037)
  %66 = getelementptr inbounds i8, ptr %65, i64 6
  %67 = load i16, ptr %66, align 2, !tbaa !21
  %68 = icmp eq i16 %64, %67
  br i1 %68, label %69, label %.critedge

.critedge:                                        ; preds = %43, %61
  call void @__assert_fail(ptr noundef nonnull @.str.32, ptr noundef nonnull @.str.1, i32 noundef 1958, ptr noundef nonnull @__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv) #6
  unreachable

69:                                               ; preds = %61
  %70 = load i32, ptr %23, align 4, !tbaa !30
  %71 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.037)
  %72 = getelementptr inbounds i8, ptr %71, i64 10
  %73 = load i16, ptr %72, align 2, !tbaa !28
  %74 = zext i16 %73 to i32
  %75 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.037)
  %76 = getelementptr inbounds i8, ptr %75, i64 6
  %77 = load i16, ptr %76, align 2, !tbaa !22
  %78 = zext i16 %77 to i32
  %79 = add nuw nsw i32 %78, %74
  %80 = call noundef i32 @_ZL5ImMaxIiET_S0_S0_(i32 noundef %70, i32 noundef %79)
  store i32 %80, ptr %23, align 4, !tbaa !30
  br label %81

81:                                               ; preds = %39, %69
  %82 = add nuw nsw i32 %.037, 1
  %83 = load i32, ptr %3, align 8, !tbaa !13
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %39, label %._crit_edge39, !llvm.loop !34
}

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL16stbrp_pack_rectsP13stbrp_contextP10stbrp_recti(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL5ImMaxIiET_S0_S0_(i32 noundef, i32 noundef) local_unnamed_addr #3

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS8ImVectorIN11ImFontAtlas10CustomRectEE", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTS8ImVectorI10stbrp_rectE", !7, i64 0, !7, i64 4, !10, i64 8}
!13 = !{!12, !7, i64 0}
!14 = !{!15, !16, i64 4}
!15 = !{!"_ZTSN11ImFontAtlas10CustomRectE", !7, i64 0, !16, i64 4, !16, i64 6, !16, i64 8, !16, i64 10, !17, i64 12, !18, i64 16, !10, i64 24}
!16 = !{!"short", !8, i64 0}
!17 = !{!"float", !8, i64 0}
!18 = !{!"_ZTS6ImVec2", !17, i64 0, !17, i64 4}
!19 = !{!20, !16, i64 4}
!20 = !{!"_ZTS10stbrp_rect", !7, i64 0, !16, i64 4, !16, i64 6, !16, i64 8, !16, i64 10, !7, i64 12}
!21 = !{!15, !16, i64 6}
!22 = !{!20, !16, i64 6}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!20, !7, i64 12}
!26 = !{!20, !16, i64 8}
!27 = !{!15, !16, i64 8}
!28 = !{!20, !16, i64 10}
!29 = !{!15, !16, i64 10}
!30 = !{!31, !7, i64 44}
!31 = !{!"_ZTS11ImFontAtlas", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 20, !10, i64 24, !10, i64 32, !7, i64 40, !7, i64 44, !18, i64 48, !18, i64 56, !32, i64 64, !6, i64 80, !33, i64 96, !8, i64 112}
!32 = !{!"_ZTS8ImVectorIP6ImFontE", !7, i64 0, !7, i64 4, !10, i64 8}
!33 = !{!"_ZTS8ImVectorI12ImFontConfigE", !7, i64 0, !7, i64 4, !10, i64 8}
!34 = distinct !{!34, !24}


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