; LLVM IR from hadryansalles/Luz :: deps/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"

%struct.ImVector.12 = type { i32, i32, ptr }
%struct.ImFontAtlas = type <{ i32, [4 x i8], ptr, i32, i32, i8, [7 x i8], ptr, i8, i8, [6 x i8], ptr, ptr, i32, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVector.8, %struct.ImVector.9, %struct.ImVector.10, [64 x %struct.ImVec4], ptr, i32, i32, i32, [4 x i8] }>
%struct.ImVec2 = type { float, float }
%struct.ImVector.8 = type { i32, i32, ptr }
%struct.ImVector.9 = type { i32, i32, ptr }
%struct.ImVector.10 = type { i32, i32, ptr }
%struct.ImVec4 = type { float, float, float, float }
%struct.ImFontAtlasCustomRect = type { i16, i16, i16, i16, i32, float, %struct.ImVec2, ptr }
%struct.stbrp_rect = type { i32, i32, i32, i32, i32, i32 }

@.str.1 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv = external hidden unnamed_addr constant [60 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.37 = 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

; 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 %struct.ImVector.12, 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
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %15, label %16

15:                                               ; preds = %2
  br label %18

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

17:                                               ; No predecessors!
  br label %18

18:                                               ; preds = %17, %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.ImFontAtlas, ptr %19, i32 0, i32 18
  store ptr %20, ptr %6, align 8, !tbaa !5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.ImVector.9, ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !9
  %24 = icmp sge i32 %23, 1
  br i1 %24, label %25, label %26

25:                                               ; preds = %18
  br label %28

26:                                               ; preds = %18
  call void @__assert_fail(ptr noundef @.str.36, ptr noundef @.str.1, i32 noundef 2754, ptr noundef @__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv) #7
  unreachable

27:                                               ; No predecessors!
  br label %28

28:                                               ; preds = %27, %25
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.ImVector.9, ptr %29, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !9
  %32 = icmp slt i32 %31, 1
  br i1 %32, label %33, label %34

33:                                               ; preds = %28
  unreachable

34:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  call void @_ZN8ImVectorI10stbrp_rectEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.ImVector.9, ptr %35, i32 0, i32 0
  %37 = load i32, ptr %36, align 8, !tbaa !9
  invoke void @_ZN8ImVectorI10stbrp_rectE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %37)
          to label %38 unwind label %51

38:                                               ; preds = %34
  %39 = getelementptr inbounds %struct.ImVector.12, ptr %7, i32 0, i32 2
  %40 = load ptr, ptr %39, align 8, !tbaa !12
  %41 = invoke noundef i32 @_ZNK8ImVectorI10stbrp_rectE13size_in_bytesEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %42 unwind label %51

42:                                               ; preds = %38
  %43 = sext i32 %41 to i64
  call void @llvm.memset.p0.i64(ptr align 4 %40, i8 0, i64 %43, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !14
  br label %44

44:                                               ; preds = %78, %42
  %45 = load i32, ptr %10, align 4, !tbaa !14
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ImVector.9, ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !9
  %49 = icmp slt i32 %45, %48
  br i1 %49, label %55, label %50

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

51:                                               ; preds = %88, %85, %38, %34
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %8, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %9, align 4
  br label %189

55:                                               ; preds = %44
  %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 @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %56, i32 noundef %57)
          to label %59 unwind label %81

59:                                               ; preds = %55
  %60 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %58, i32 0, i32 0
  %61 = load i16, ptr %60, align 8, !tbaa !15
  %62 = zext i16 %61 to i32
  %63 = load i32, ptr %10, align 4, !tbaa !14
  %64 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %63)
          to label %65 unwind label %81

65:                                               ; preds = %59
  %66 = getelementptr inbounds %struct.stbrp_rect, ptr %64, i32 0, i32 1
  store i32 %62, ptr %66, align 4, !tbaa !20
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = load i32, ptr %10, align 4, !tbaa !14
  %69 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %67, i32 noundef %68)
          to label %70 unwind label %81

70:                                               ; preds = %65
  %71 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %69, i32 0, i32 1
  %72 = load i16, ptr %71, align 2, !tbaa !22
  %73 = zext i16 %72 to i32
  %74 = load i32, ptr %10, align 4, !tbaa !14
  %75 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %74)
          to label %76 unwind label %81

76:                                               ; preds = %70
  %77 = getelementptr inbounds %struct.stbrp_rect, ptr %75, i32 0, i32 2
  store i32 %73, ptr %77, align 4, !tbaa !23
  br label %78

78:                                               ; preds = %76
  %79 = load i32, ptr %10, align 4, !tbaa !14
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %10, align 4, !tbaa !14
  br label %44, !llvm.loop !24

81:                                               ; preds = %70, %65, %59, %55
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %8, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %189

85:                                               ; preds = %50
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 0)
          to label %88 unwind label %51

88:                                               ; preds = %85
  %89 = getelementptr inbounds %struct.ImVector.12, ptr %7, i32 0, i32 0
  %90 = load i32, ptr %89, align 8, !tbaa !26
  %91 = invoke noundef i32 @_ZL16stbrp_pack_rectsP13stbrp_contextP10stbrp_recti(ptr noundef %86, ptr noundef %87, i32 noundef %90)
          to label %92 unwind label %51

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

93:                                               ; preds = %185, %92
  %94 = load i32, ptr %11, align 4, !tbaa !14
  %95 = getelementptr inbounds %struct.ImVector.12, ptr %7, i32 0, i32 0
  %96 = load i32, ptr %95, align 8, !tbaa !26
  %97 = icmp slt i32 %94, %96
  br i1 %97, label %99, label %98

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

99:                                               ; preds = %93
  %100 = load i32, ptr %11, align 4, !tbaa !14
  %101 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %100)
          to label %102 unwind label %160

102:                                              ; preds = %99
  %103 = getelementptr inbounds %struct.stbrp_rect, ptr %101, i32 0, i32 5
  %104 = load i32, ptr %103, align 4, !tbaa !27
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %184

106:                                              ; preds = %102
  %107 = load i32, ptr %11, align 4, !tbaa !14
  %108 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %107)
          to label %109 unwind label %160

109:                                              ; preds = %106
  %110 = getelementptr inbounds %struct.stbrp_rect, ptr %108, i32 0, i32 3
  %111 = load i32, ptr %110, align 4, !tbaa !28
  %112 = trunc i32 %111 to i16
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = load i32, ptr %11, align 4, !tbaa !14
  %115 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %113, i32 noundef %114)
          to label %116 unwind label %160

116:                                              ; preds = %109
  %117 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %115, i32 0, i32 2
  store i16 %112, ptr %117, align 4, !tbaa !29
  %118 = load i32, ptr %11, align 4, !tbaa !14
  %119 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %118)
          to label %120 unwind label %160

120:                                              ; preds = %116
  %121 = getelementptr inbounds %struct.stbrp_rect, ptr %119, i32 0, i32 4
  %122 = load i32, ptr %121, align 4, !tbaa !30
  %123 = trunc i32 %122 to i16
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = load i32, ptr %11, align 4, !tbaa !14
  %126 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %124, i32 noundef %125)
          to label %127 unwind label %160

127:                                              ; preds = %120
  %128 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %126, i32 0, i32 3
  store i16 %123, ptr %128, align 2, !tbaa !31
  %129 = load i32, ptr %11, align 4, !tbaa !14
  %130 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %129)
          to label %131 unwind label %160

131:                                              ; preds = %127
  %132 = getelementptr inbounds %struct.stbrp_rect, ptr %130, i32 0, i32 1
  %133 = load i32, ptr %132, align 4, !tbaa !20
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = load i32, ptr %11, align 4, !tbaa !14
  %136 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %134, i32 noundef %135)
          to label %137 unwind label %160

137:                                              ; preds = %131
  %138 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %136, i32 0, i32 0
  %139 = load i16, ptr %138, align 8, !tbaa !15
  %140 = zext i16 %139 to i32
  %141 = icmp eq i32 %133, %140
  br i1 %141, label %142, label %156

142:                                              ; preds = %137
  %143 = load i32, ptr %11, align 4, !tbaa !14
  %144 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %143)
          to label %145 unwind label %160

145:                                              ; preds = %142
  %146 = getelementptr inbounds %struct.stbrp_rect, ptr %144, i32 0, i32 2
  %147 = load i32, ptr %146, align 4, !tbaa !23
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = load i32, ptr %11, align 4, !tbaa !14
  %150 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %148, i32 noundef %149)
          to label %151 unwind label %160

151:                                              ; preds = %145
  %152 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %150, i32 0, i32 1
  %153 = load i16, ptr %152, align 2, !tbaa !22
  %154 = zext i16 %153 to i32
  %155 = icmp eq i32 %147, %154
  br label %156

156:                                              ; preds = %151, %137
  %157 = phi i1 [ false, %137 ], [ %155, %151 ]
  br i1 %157, label %158, label %159

158:                                              ; preds = %156
  br label %165

159:                                              ; preds = %156
  call void @__assert_fail(ptr noundef @.str.37, ptr noundef @.str.1, i32 noundef 2773, ptr noundef @__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv) #7
  unreachable

160:                                              ; preds = %176, %171, %165, %145, %142, %131, %127, %120, %116, %109, %106, %99
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %8, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %189

164:                                              ; No predecessors!
  br label %165

165:                                              ; preds = %164, %158
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.ImFontAtlas, ptr %166, i32 0, i32 14
  %168 = load i32, ptr %167, align 4, !tbaa !32
  %169 = load i32, ptr %11, align 4, !tbaa !14
  %170 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %169)
          to label %171 unwind label %160

171:                                              ; preds = %165
  %172 = getelementptr inbounds %struct.stbrp_rect, ptr %170, i32 0, i32 4
  %173 = load i32, ptr %172, align 4, !tbaa !30
  %174 = load i32, ptr %11, align 4, !tbaa !14
  %175 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %174)
          to label %176 unwind label %160

176:                                              ; preds = %171
  %177 = getelementptr inbounds %struct.stbrp_rect, ptr %175, i32 0, i32 2
  %178 = load i32, ptr %177, align 4, !tbaa !23
  %179 = add nsw i32 %173, %178
  %180 = invoke noundef i32 @_ZL5ImMaxIiET_S0_S0_(i32 noundef %168, i32 noundef %179)
          to label %181 unwind label %160

181:                                              ; preds = %176
  %182 = load ptr, ptr %3, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.ImFontAtlas, ptr %182, i32 0, i32 14
  store i32 %180, ptr %183, align 4, !tbaa !32
  br label %184

184:                                              ; preds = %181, %102
  br label %185

185:                                              ; preds = %184
  %186 = load i32, ptr %11, align 4, !tbaa !14
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %11, align 4, !tbaa !14
  br label %93, !llvm.loop !37

188:                                              ; preds = %98
  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

189:                                              ; preds = %160, %81, %51
  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 %190

190:                                              ; preds = %189
  %191 = load ptr, ptr %8, align 8
  %192 = load i32, ptr %9, align 4
  %193 = insertvalue { ptr, i32 } poison, ptr %191, 0
  %194 = insertvalue { ptr, i32 } %193, i32 %192, 1
  resume { ptr, i32 } %194
}

; 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 i32 @_ZNK8ImVectorI10stbrp_rectE13size_in_bytesEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

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

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

; 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 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 = !{!"_ZTS8ImVectorI21ImFontAtlasCustomRectE", !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 0}
!16 = !{!"_ZTS21ImFontAtlasCustomRect", !17, i64 0, !17, i64 2, !17, i64 4, !17, i64 6, !11, i64 8, !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, !11, i64 4}
!21 = !{!"_ZTS10stbrp_rect", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!22 = !{!16, !17, i64 2}
!23 = !{!21, !11, i64 8}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!13, !11, i64 0}
!27 = !{!21, !11, i64 20}
!28 = !{!21, !11, i64 12}
!29 = !{!16, !17, i64 4}
!30 = !{!21, !11, i64 16}
!31 = !{!16, !17, i64 6}
!32 = !{!33, !11, i64 68}
!33 = !{!"_ZTS11ImFontAtlas", !11, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !34, i64 24, !6, i64 32, !34, i64 40, !34, i64 41, !6, i64 48, !6, i64 56, !11, i64 64, !11, i64 68, !19, i64 72, !19, i64 80, !35, i64 88, !10, i64 104, !36, i64 120, !7, i64 136, !6, i64 1160, !11, i64 1168, !11, i64 1172, !11, i64 1176}
!34 = !{!"bool", !7, i64 0}
!35 = !{!"_ZTS8ImVectorIP6ImFontE", !11, i64 0, !11, i64 4, !6, i64 8}
!36 = !{!"_ZTS8ImVectorI12ImFontConfigE", !11, i64 0, !11, i64 4, !6, i64 8}
!37 = distinct !{!37, !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"

%struct.ImVector.12 = type { i32, i32, ptr }

@.str.1 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv = external hidden unnamed_addr constant [60 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.37 = 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; 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 hidden noundef i32 @_ZL5ImMaxIiET_S0_S0_(i32 noundef, i32 noundef) local_unnamed_addr #3

; 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 %struct.ImVector.12, align 8
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %4, label %5

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

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 104
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %10, label %9

9:                                                ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.36, ptr noundef nonnull @.str.1, i32 noundef 2754, ptr noundef nonnull @__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv) #6
  unreachable

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

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

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

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

.lr.ph41:                                         ; preds = %.preheader
  %24 = getelementptr inbounds i8, ptr %0, i64 68
  br label %41

25:                                               ; preds = %._crit_edge, %10
  %26 = 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 } %26

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

._crit_edge42:                                    ; preds = %84, %.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

41:                                               ; preds = %.lr.ph41, %84
  %.040 = phi i32 [ 0, %.lr.ph41 ], [ %85, %84 ]
  %42 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.040)
  %43 = getelementptr inbounds i8, ptr %42, i64 20
  %44 = load i32, ptr %43, align 4, !tbaa !25
  %.not38 = icmp eq i32 %44, 0
  br i1 %.not38, label %84, label %45

45:                                               ; preds = %41
  %46 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.040)
  %47 = getelementptr inbounds i8, ptr %46, i64 12
  %48 = load i32, ptr %47, align 4, !tbaa !26
  %49 = trunc i32 %48 to i16
  %50 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef %.040)
  %51 = getelementptr inbounds i8, ptr %50, i64 4
  store i16 %49, ptr %51, align 4, !tbaa !27
  %52 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.040)
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  %54 = load i32, ptr %53, align 4, !tbaa !28
  %55 = trunc i32 %54 to i16
  %56 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef %.040)
  %57 = getelementptr inbounds i8, ptr %56, i64 6
  store i16 %55, ptr %57, align 2, !tbaa !29
  %58 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.040)
  %59 = getelementptr inbounds i8, ptr %58, i64 4
  %60 = load i32, ptr %59, align 4, !tbaa !19
  %61 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef %.040)
  %62 = load i16, ptr %61, align 8, !tbaa !14
  %63 = zext i16 %62 to i32
  %64 = icmp eq i32 %60, %63
  br i1 %64, label %65, label %.critedge

65:                                               ; preds = %45
  %66 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.040)
  %67 = getelementptr inbounds i8, ptr %66, i64 8
  %68 = load i32, ptr %67, align 4, !tbaa !22
  %69 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef %.040)
  %70 = getelementptr inbounds i8, ptr %69, i64 2
  %71 = load i16, ptr %70, align 2, !tbaa !21
  %72 = zext i16 %71 to i32
  %73 = icmp eq i32 %68, %72
  br i1 %73, label %74, label %.critedge

.critedge:                                        ; preds = %45, %65
  call void @__assert_fail(ptr noundef nonnull @.str.37, ptr noundef nonnull @.str.1, i32 noundef 2773, ptr noundef nonnull @__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv) #6
  unreachable

74:                                               ; preds = %65
  %75 = load i32, ptr %24, align 4, !tbaa !30
  %76 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.040)
  %77 = getelementptr inbounds i8, ptr %76, i64 16
  %78 = load i32, ptr %77, align 4, !tbaa !28
  %79 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.040)
  %80 = getelementptr inbounds i8, ptr %79, i64 8
  %81 = load i32, ptr %80, align 4, !tbaa !22
  %82 = add nsw i32 %81, %78
  %83 = call noundef i32 @_ZL5ImMaxIiET_S0_S0_(i32 noundef %75, i32 noundef %82)
  store i32 %83, ptr %24, align 4, !tbaa !30
  br label %84

84:                                               ; preds = %41, %74
  %85 = add nuw nsw i32 %.040, 1
  %86 = load i32, ptr %3, align 8, !tbaa !13
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %41, label %._crit_edge42, !llvm.loop !35
}

; 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 i32 @_ZNK8ImVectorI10stbrp_rectE13size_in_bytesEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

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

; 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 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 = !{!"_ZTS8ImVectorI21ImFontAtlasCustomRectE", !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 0}
!15 = !{!"_ZTS21ImFontAtlasCustomRect", !16, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !7, i64 8, !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, !7, i64 4}
!20 = !{!"_ZTS10stbrp_rect", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!21 = !{!15, !16, i64 2}
!22 = !{!20, !7, i64 8}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!20, !7, i64 20}
!26 = !{!20, !7, i64 12}
!27 = !{!15, !16, i64 4}
!28 = !{!20, !7, i64 16}
!29 = !{!15, !16, i64 6}
!30 = !{!31, !7, i64 68}
!31 = !{!"_ZTS11ImFontAtlas", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 20, !32, i64 24, !10, i64 32, !32, i64 40, !32, i64 41, !10, i64 48, !10, i64 56, !7, i64 64, !7, i64 68, !18, i64 72, !18, i64 80, !33, i64 88, !6, i64 104, !34, i64 120, !8, i64 136, !10, i64 1160, !7, i64 1168, !7, i64 1172, !7, i64 1176}
!32 = !{!"bool", !8, i64 0}
!33 = !{!"_ZTS8ImVectorIP6ImFontE", !7, i64 0, !7, i64 4, !10, i64 8}
!34 = !{!"_ZTS8ImVectorI12ImFontConfigE", !7, i64 0, !7, i64 4, !10, i64 8}
!35 = distinct !{!35, !24}


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