; LLVM IR from Samson-Mano/EM_Propogation_simulation :: EM_Propogation_simulation/src/ImGui (imgui_draw)

; 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.11 = 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 [122 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv = external hidden unnamed_addr constant [60 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.28 = 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.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
  %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.26, ptr noundef @.str.1, i32 noundef 2622, 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.27, ptr noundef @.str.1, i32 noundef 2625, ptr noundef @__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv) #7
  unreachable

27:                                               ; No predecessors!
  br label %28

28:                                               ; preds = %27, %25
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  call void @_ZN8ImVectorI10stbrp_rectEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %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
  invoke void @_ZN8ImVectorI10stbrp_rectE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %31)
          to label %32 unwind label %45

32:                                               ; preds = %28
  %33 = getelementptr inbounds %struct.ImVector.11, ptr %7, i32 0, i32 2
  %34 = load ptr, ptr %33, align 8, !tbaa !12
  %35 = invoke noundef i32 @_ZNK8ImVectorI10stbrp_rectE13size_in_bytesEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %36 unwind label %45

36:                                               ; preds = %32
  %37 = sext i32 %35 to i64
  call void @llvm.memset.p0.i64(ptr align 4 %34, i8 0, i64 %37, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !14
  br label %38

38:                                               ; preds = %72, %36
  %39 = load i32, ptr %10, align 4, !tbaa !14
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.ImVector.9, ptr %40, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !9
  %43 = icmp slt i32 %39, %42
  br i1 %43, label %49, label %44

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

45:                                               ; preds = %82, %79, %32, %28
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %8, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %9, align 4
  br label %183

49:                                               ; preds = %38
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = load i32, ptr %10, align 4, !tbaa !14
  %52 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %50, i32 noundef %51)
          to label %53 unwind label %75

53:                                               ; preds = %49
  %54 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %52, i32 0, i32 0
  %55 = load i16, ptr %54, align 8, !tbaa !15
  %56 = zext i16 %55 to i32
  %57 = load i32, ptr %10, align 4, !tbaa !14
  %58 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %57)
          to label %59 unwind label %75

59:                                               ; preds = %53
  %60 = getelementptr inbounds %struct.stbrp_rect, ptr %58, i32 0, i32 1
  store i32 %56, ptr %60, align 4, !tbaa !20
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = load i32, ptr %10, align 4, !tbaa !14
  %63 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %61, i32 noundef %62)
          to label %64 unwind label %75

64:                                               ; preds = %59
  %65 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %63, i32 0, i32 1
  %66 = load i16, ptr %65, align 2, !tbaa !22
  %67 = zext i16 %66 to i32
  %68 = load i32, ptr %10, align 4, !tbaa !14
  %69 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %68)
          to label %70 unwind label %75

70:                                               ; preds = %64
  %71 = getelementptr inbounds %struct.stbrp_rect, ptr %69, i32 0, i32 2
  store i32 %67, ptr %71, align 4, !tbaa !23
  br label %72

72:                                               ; preds = %70
  %73 = load i32, ptr %10, align 4, !tbaa !14
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %10, align 4, !tbaa !14
  br label %38, !llvm.loop !24

75:                                               ; preds = %64, %59, %53, %49
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %8, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %183

79:                                               ; preds = %44
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 0)
          to label %82 unwind label %45

82:                                               ; preds = %79
  %83 = getelementptr inbounds %struct.ImVector.11, ptr %7, i32 0, i32 0
  %84 = load i32, ptr %83, align 8, !tbaa !26
  %85 = invoke noundef i32 @_ZL16stbrp_pack_rectsP13stbrp_contextP10stbrp_recti(ptr noundef %80, ptr noundef %81, i32 noundef %84)
          to label %86 unwind label %45

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

87:                                               ; preds = %179, %86
  %88 = load i32, ptr %11, align 4, !tbaa !14
  %89 = getelementptr inbounds %struct.ImVector.11, ptr %7, i32 0, i32 0
  %90 = load i32, ptr %89, align 8, !tbaa !26
  %91 = icmp slt i32 %88, %90
  br i1 %91, label %93, label %92

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

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

96:                                               ; preds = %93
  %97 = getelementptr inbounds %struct.stbrp_rect, ptr %95, i32 0, i32 5
  %98 = load i32, ptr %97, align 4, !tbaa !27
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %178

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

103:                                              ; preds = %100
  %104 = getelementptr inbounds %struct.stbrp_rect, ptr %102, i32 0, i32 3
  %105 = load i32, ptr %104, align 4, !tbaa !28
  %106 = trunc i32 %105 to i16
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = load i32, ptr %11, align 4, !tbaa !14
  %109 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %107, i32 noundef %108)
          to label %110 unwind label %154

110:                                              ; preds = %103
  %111 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %109, i32 0, i32 2
  store i16 %106, ptr %111, align 4, !tbaa !29
  %112 = load i32, ptr %11, align 4, !tbaa !14
  %113 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %112)
          to label %114 unwind label %154

114:                                              ; preds = %110
  %115 = getelementptr inbounds %struct.stbrp_rect, ptr %113, i32 0, i32 4
  %116 = load i32, ptr %115, align 4, !tbaa !30
  %117 = trunc i32 %116 to i16
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = load i32, ptr %11, align 4, !tbaa !14
  %120 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %118, i32 noundef %119)
          to label %121 unwind label %154

121:                                              ; preds = %114
  %122 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %120, i32 0, i32 3
  store i16 %117, ptr %122, align 2, !tbaa !31
  %123 = load i32, ptr %11, align 4, !tbaa !14
  %124 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %123)
          to label %125 unwind label %154

125:                                              ; preds = %121
  %126 = getelementptr inbounds %struct.stbrp_rect, ptr %124, i32 0, i32 1
  %127 = load i32, ptr %126, align 4, !tbaa !20
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = load i32, ptr %11, align 4, !tbaa !14
  %130 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %128, i32 noundef %129)
          to label %131 unwind label %154

131:                                              ; preds = %125
  %132 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %130, i32 0, i32 0
  %133 = load i16, ptr %132, align 8, !tbaa !15
  %134 = zext i16 %133 to i32
  %135 = icmp eq i32 %127, %134
  br i1 %135, label %136, label %150

136:                                              ; preds = %131
  %137 = load i32, ptr %11, align 4, !tbaa !14
  %138 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %137)
          to label %139 unwind label %154

139:                                              ; preds = %136
  %140 = getelementptr inbounds %struct.stbrp_rect, ptr %138, i32 0, i32 2
  %141 = load i32, ptr %140, align 4, !tbaa !23
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  %143 = load i32, ptr %11, align 4, !tbaa !14
  %144 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %142, i32 noundef %143)
          to label %145 unwind label %154

145:                                              ; preds = %139
  %146 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %144, i32 0, i32 1
  %147 = load i16, ptr %146, align 2, !tbaa !22
  %148 = zext i16 %147 to i32
  %149 = icmp eq i32 %141, %148
  br label %150

150:                                              ; preds = %145, %131
  %151 = phi i1 [ false, %131 ], [ %149, %145 ]
  br i1 %151, label %152, label %153

152:                                              ; preds = %150
  br label %159

153:                                              ; preds = %150
  call void @__assert_fail(ptr noundef @.str.28, ptr noundef @.str.1, i32 noundef 2641, ptr noundef @__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv) #7
  unreachable

154:                                              ; preds = %170, %165, %159, %139, %136, %125, %121, %114, %110, %103, %100, %93
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %8, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %183

158:                                              ; No predecessors!
  br label %159

159:                                              ; preds = %158, %152
  %160 = load ptr, ptr %3, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.ImFontAtlas, ptr %160, i32 0, i32 14
  %162 = load i32, ptr %161, align 4, !tbaa !32
  %163 = load i32, ptr %11, align 4, !tbaa !14
  %164 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %163)
          to label %165 unwind label %154

165:                                              ; preds = %159
  %166 = getelementptr inbounds %struct.stbrp_rect, ptr %164, i32 0, i32 4
  %167 = load i32, ptr %166, align 4, !tbaa !30
  %168 = load i32, ptr %11, align 4, !tbaa !14
  %169 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %168)
          to label %170 unwind label %154

170:                                              ; preds = %165
  %171 = getelementptr inbounds %struct.stbrp_rect, ptr %169, i32 0, i32 2
  %172 = load i32, ptr %171, align 4, !tbaa !23
  %173 = add nsw i32 %167, %172
  %174 = invoke noundef i32 @_ZL5ImMaxIiET_S0_S0_(i32 noundef %162, i32 noundef %173)
          to label %175 unwind label %154

175:                                              ; preds = %170
  %176 = load ptr, ptr %3, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.ImFontAtlas, ptr %176, i32 0, i32 14
  store i32 %174, ptr %177, align 4, !tbaa !32
  br label %178

178:                                              ; preds = %175, %96
  br label %179

179:                                              ; preds = %178
  %180 = load i32, ptr %11, align 4, !tbaa !14
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %11, align 4, !tbaa !14
  br label %87, !llvm.loop !37

182:                                              ; preds = %92
  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

183:                                              ; preds = %154, %75, %45
  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 %184

184:                                              ; preds = %183
  %185 = load ptr, ptr %8, align 8
  %186 = load i32, ptr %9, align 4
  %187 = insertvalue { ptr, i32 } poison, ptr %185, 0
  %188 = insertvalue { ptr, i32 } %187, i32 %186, 1
  resume { ptr, i32 } %188
}

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

@.str.1 = external hidden unnamed_addr constant [122 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._Z31ImFontAtlasBuildPackCustomRectsP11ImFontAtlasPv = external hidden unnamed_addr constant [60 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.28 = 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.11, 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.26, ptr noundef nonnull @.str.1, i32 noundef 2622, 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.27, ptr noundef nonnull @.str.1, i32 noundef 2625, 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.ph40, label %._crit_edge41

.lr.ph40:                                         ; 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
  %.03538 = 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 %.03538)
  %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 %.03538)
  %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 %.03538)
  %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 %.03538)
  %37 = getelementptr inbounds i8, ptr %36, i64 8
  store i32 %35, ptr %37, align 4, !tbaa !22
  %38 = add nuw nsw i32 %.03538, 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_edge41:                                    ; 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.ph40, %84
  %.039 = phi i32 [ 0, %.lr.ph40 ], [ %85, %84 ]
  %42 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN8ImVectorI10stbrp_rectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.039)
  %43 = getelementptr inbounds i8, ptr %42, i64 20
  %44 = load i32, ptr %43, align 4, !tbaa !25
  %.not37 = icmp eq i32 %44, 0
  br i1 %.not37, 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 %.039)
  %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 %.039)
  %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 %.039)
  %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 %.039)
  %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 %.039)
  %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 %.039)
  %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 %.039)
  %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 %.039)
  %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.28, ptr noundef nonnull @.str.1, i32 noundef 2641, 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 %.039)
  %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 %.039)
  %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 %.039, 1
  %86 = load i32, ptr %3, align 8, !tbaa !13
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %41, label %._crit_edge41, !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