; LLVM IR from xhub/reshop :: gui/external/imgui/imgui_draw.ll (Z22ImFontAtlasBuildFinishP11ImFontAtlas)

; 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.ImVec2 = type { float, float }
%struct.ImFontAtlas = type <{ i32, [4 x i8], i64, i32, i32, i8, [7 x i8], ptr, i8, i8, [6 x i8], ptr, ptr, i32, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVector.9, %struct.ImVector.10, %struct.ImVector.11, [64 x %struct.ImVec4], ptr, i32, i32, i32, [4 x i8] }>
%struct.ImVector.9 = type { i32, i32, ptr }
%struct.ImVector.10 = type { i32, i32, ptr }
%struct.ImVector.11 = type { i32, i32, ptr }
%struct.ImVec4 = type { float, float, float, float }
%struct.ImFontAtlasCustomRect = type { i16, i16, i16, i16, i32, float, %struct.ImVec2, ptr }
%struct.ImFont = type <{ %struct.ImVector.7, float, float, %struct.ImVector.1, %struct.ImVector.8, ptr, ptr, ptr, i16, i16, i16, i16, float, float, i8, [3 x i8], float, float, float, i32, [2 x i8], [2 x i8] }>
%struct.ImVector.7 = type { i32, i32, ptr }
%struct.ImVector.1 = type { i32, i32, ptr }
%struct.ImVector.8 = type { i32, i32, ptr }

@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [69 x i8], align 1
@__PRETTY_FUNCTION__._Z22ImFontAtlasBuildFinishP11ImFontAtlas = external hidden unnamed_addr constant [43 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [33 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: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK11ImFontAtlas16CalcCustomRectUVEPK21ImFontAtlasCustomRectP6ImVec2S4_(ptr noundef nonnull align 8 dereferenceable(1180), ptr noundef, ptr noundef, ptr noundef) #4 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: mustprogress uwtable
define dso_local void @_Z22ImFontAtlasBuildFinishP11ImFontAtlas(ptr noundef %0) #4 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %struct.ImVec2, align 4
  %7 = alloca %struct.ImVec2, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.ImFontAtlas, ptr %12, i32 0, i32 11
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = icmp ne ptr %14, null
  br i1 %15, label %21, label %16

16:                                               ; preds = %1
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.ImFontAtlas, ptr %17, i32 0, i32 12
  %19 = load ptr, ptr %18, align 8, !tbaa !19
  %20 = icmp ne ptr %19, null
  br label %21

21:                                               ; preds = %16, %1
  %22 = phi i1 [ true, %1 ], [ %20, %16 ]
  br i1 %22, label %23, label %24

23:                                               ; preds = %21
  br label %26

24:                                               ; preds = %21
  call void @__assert_fail(ptr noundef @.str.48, ptr noundef @.str.1, i32 noundef 3331, ptr noundef @__PRETTY_FUNCTION__._Z22ImFontAtlasBuildFinishP11ImFontAtlas) #6
  unreachable

25:                                               ; No predecessors!
  br label %26

26:                                               ; preds = %25, %23
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZL36ImFontAtlasBuildRenderDefaultTexDataP11ImFontAtlas(ptr noundef %27)
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZL34ImFontAtlasBuildRenderLinesTexDataP11ImFontAtlas(ptr noundef %28)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !20
  br label %29

29:                                               ; preds = %132, %26
  %30 = load i32, ptr %3, align 4, !tbaa !20
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ImFontAtlas, ptr %31, i32 0, i32 18
  %33 = getelementptr inbounds %struct.ImVector.10, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !21
  %35 = icmp slt i32 %30, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %29
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %135

37:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.ImFontAtlas, ptr %38, i32 0, i32 18
  %40 = load i32, ptr %3, align 4, !tbaa !20
  %41 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %39, i32 noundef %40)
  store ptr %41, ptr %5, align 8, !tbaa !5
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %42, i32 0, i32 7
  %44 = load ptr, ptr %43, align 8, !tbaa !22
  %45 = icmp eq ptr %44, null
  br i1 %45, label %52, label %46

46:                                               ; preds = %37
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %47, i32 0, i32 4
  %49 = load i32, ptr %48, align 8
  %50 = and i32 %49, 2147483647
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %52, label %53

52:                                               ; preds = %46, %37
  store i32 4, ptr %4, align 4
  br label %129

53:                                               ; preds = %46
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %54, i32 0, i32 7
  %56 = load ptr, ptr %55, align 8, !tbaa !22
  %57 = getelementptr inbounds %struct.ImFont, ptr %56, i32 0, i32 6
  %58 = load ptr, ptr %57, align 8, !tbaa !25
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = icmp eq ptr %58, %59
  br i1 %60, label %61, label %62

61:                                               ; preds = %53
  br label %64

62:                                               ; preds = %53
  call void @__assert_fail(ptr noundef @.str.49, ptr noundef @.str.1, i32 noundef 3343, ptr noundef @__PRETTY_FUNCTION__._Z22ImFontAtlasBuildFinishP11ImFontAtlas) #6
  unreachable

63:                                               ; No predecessors!
  br label %64

64:                                               ; preds = %63, %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %7)
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNK11ImFontAtlas16CalcCustomRectUVEPK21ImFontAtlasCustomRectP6ImVec2S4_(ptr noundef nonnull align 8 dereferenceable(1180) %65, ptr noundef %66, ptr noundef %6, ptr noundef %7)
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %67, i32 0, i32 7
  %69 = load ptr, ptr %68, align 8, !tbaa !22
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %70, i32 0, i32 4
  %72 = load i32, ptr %71, align 8
  %73 = and i32 %72, 2147483647
  %74 = trunc i32 %73 to i16
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %75, i32 0, i32 6
  %77 = getelementptr inbounds %struct.ImVec2, ptr %76, i32 0, i32 0
  %78 = load float, ptr %77, align 8, !tbaa !30
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %79, i32 0, i32 6
  %81 = getelementptr inbounds %struct.ImVec2, ptr %80, i32 0, i32 1
  %82 = load float, ptr %81, align 4, !tbaa !31
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %83, i32 0, i32 6
  %85 = getelementptr inbounds %struct.ImVec2, ptr %84, i32 0, i32 0
  %86 = load float, ptr %85, align 8, !tbaa !30
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %87, i32 0, i32 2
  %89 = load i16, ptr %88, align 4, !tbaa !32
  %90 = zext i16 %89 to i32
  %91 = sitofp i32 %90 to float
  %92 = fadd float %86, %91
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %93, i32 0, i32 6
  %95 = getelementptr inbounds %struct.ImVec2, ptr %94, i32 0, i32 1
  %96 = load float, ptr %95, align 4, !tbaa !31
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %97, i32 0, i32 3
  %99 = load i16, ptr %98, align 2, !tbaa !33
  %100 = zext i16 %99 to i32
  %101 = sitofp i32 %100 to float
  %102 = fadd float %96, %101
  %103 = getelementptr inbounds %struct.ImVec2, ptr %6, i32 0, i32 0
  %104 = load float, ptr %103, align 4, !tbaa !34
  %105 = getelementptr inbounds %struct.ImVec2, ptr %6, i32 0, i32 1
  %106 = load float, ptr %105, align 4, !tbaa !35
  %107 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 0
  %108 = load float, ptr %107, align 4, !tbaa !34
  %109 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 1
  %110 = load float, ptr %109, align 4, !tbaa !35
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %111, i32 0, i32 5
  %113 = load float, ptr %112, align 4, !tbaa !36
  call void @_ZN6ImFont8AddGlyphEPK12ImFontConfigtfffffffff(ptr noundef nonnull align 8 dereferenceable(118) %69, ptr noundef null, i16 noundef zeroext %74, float noundef %78, float noundef %82, float noundef %92, float noundef %102, float noundef %104, float noundef %106, float noundef %108, float noundef %110, float noundef %113)
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %114, i32 0, i32 4
  %116 = load i32, ptr %115, align 8
  %117 = lshr i32 %116, 31
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %119, label %128

119:                                              ; preds = %64
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %120, i32 0, i32 7
  %122 = load ptr, ptr %121, align 8, !tbaa !22
  %123 = getelementptr inbounds %struct.ImFont, ptr %122, i32 0, i32 4
  %124 = call noundef nonnull align 4 dereferenceable(40) ptr @_ZN8ImVectorI11ImFontGlyphE4backEv(ptr noundef nonnull align 8 dereferenceable(16) %123)
  %125 = load i32, ptr %124, align 4
  %126 = and i32 %125, -2
  %127 = or i32 %126, 1
  store i32 %127, ptr %124, align 4
  br label %128

128:                                              ; preds = %119, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  store i32 0, ptr %4, align 4
  br label %129

129:                                              ; preds = %128, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  %130 = load i32, ptr %4, align 4
  switch i32 %130, label %163 [
    i32 0, label %131
    i32 4, label %132
  ]

131:                                              ; preds = %129
  br label %132

132:                                              ; preds = %131, %129
  %133 = load i32, ptr %3, align 4, !tbaa !20
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %3, align 4, !tbaa !20
  br label %29, !llvm.loop !37

135:                                              ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %136 = load ptr, ptr %2, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.ImFontAtlas, ptr %136, i32 0, i32 17
  store ptr %137, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %138 = load ptr, ptr %8, align 8, !tbaa !5
  %139 = call noundef ptr @_ZN8ImVectorIP6ImFontE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %138)
  store ptr %139, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  %141 = call noundef ptr @_ZN8ImVectorIP6ImFontE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %140)
  store ptr %141, ptr %10, align 8, !tbaa !5
  br label %142

142:                                              ; preds = %157, %135
  %143 = load ptr, ptr %9, align 8, !tbaa !5
  %144 = load ptr, ptr %10, align 8, !tbaa !5
  %145 = icmp ne ptr %143, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %142
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %160

147:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = load ptr, ptr %148, align 8, !tbaa !5
  store ptr %149, ptr %11, align 8, !tbaa !5
  %150 = load ptr, ptr %11, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.ImFont, ptr %150, i32 0, i32 14
  %152 = load i8, ptr %151, align 8, !tbaa !39, !range !40, !noundef !41
  %153 = trunc i8 %152 to i1
  br i1 %153, label %154, label %156

154:                                              ; preds = %147
  %155 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN6ImFont16BuildLookupTableEv(ptr noundef nonnull align 8 dereferenceable(118) %155)
  br label %156

156:                                              ; preds = %154, %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %157

157:                                              ; preds = %156
  %158 = load ptr, ptr %9, align 8, !tbaa !5
  %159 = getelementptr inbounds ptr, ptr %158, i32 1
  store ptr %159, ptr %9, align 8, !tbaa !5
  br label %142

160:                                              ; preds = %146
  %161 = load ptr, ptr %2, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.ImFontAtlas, ptr %161, i32 0, i32 8
  store i8 1, ptr %162, align 8, !tbaa !42
  ret void

163:                                              ; preds = %129
  unreachable
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL36ImFontAtlasBuildRenderDefaultTexDataP11ImFontAtlas(ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL34ImFontAtlasBuildRenderLinesTexDataP11ImFontAtlas(ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ImFont8AddGlyphEPK12ImFontConfigtfffffffff(ptr noundef nonnull align 8 dereferenceable(118), ptr noundef, i16 noundef zeroext, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ImFont16BuildLookupTableEv(ptr noundef nonnull align 8 dereferenceable(118)) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { mustprogress uwtable "min-legal-vector-width"="64" "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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 48}
!10 = !{!"_ZTS11ImFontAtlas", !11, i64 0, !12, i64 8, !11, i64 16, !11, i64 20, !13, i64 24, !6, i64 32, !13, i64 40, !13, i64 41, !6, i64 48, !6, i64 56, !11, i64 64, !11, i64 68, !14, i64 72, !14, i64 80, !16, i64 88, !17, i64 104, !18, i64 120, !7, i64 136, !6, i64 1160, !11, i64 1168, !11, i64 1172, !11, i64 1176}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTS6ImVec2", !15, i64 0, !15, i64 4}
!15 = !{!"float", !7, i64 0}
!16 = !{!"_ZTS8ImVectorIP6ImFontE", !11, i64 0, !11, i64 4, !6, i64 8}
!17 = !{!"_ZTS8ImVectorI21ImFontAtlasCustomRectE", !11, i64 0, !11, i64 4, !6, i64 8}
!18 = !{!"_ZTS8ImVectorI12ImFontConfigE", !11, i64 0, !11, i64 4, !6, i64 8}
!19 = !{!10, !6, i64 56}
!20 = !{!11, !11, i64 0}
!21 = !{!10, !11, i64 104}
!22 = !{!23, !6, i64 24}
!23 = !{!"_ZTS21ImFontAtlasCustomRect", !24, i64 0, !24, i64 2, !24, i64 4, !24, i64 6, !11, i64 8, !11, i64 11, !15, i64 12, !14, i64 16, !6, i64 24}
!24 = !{!"short", !7, i64 0}
!25 = !{!26, !6, i64 64}
!26 = !{!"_ZTS6ImFont", !27, i64 0, !15, i64 16, !15, i64 20, !28, i64 24, !29, i64 40, !6, i64 56, !6, i64 64, !6, i64 72, !24, i64 80, !24, i64 82, !24, i64 84, !24, i64 86, !15, i64 88, !15, i64 92, !13, i64 96, !15, i64 100, !15, i64 104, !15, i64 108, !11, i64 112, !7, i64 116}
!27 = !{!"_ZTS8ImVectorIfE", !11, i64 0, !11, i64 4, !6, i64 8}
!28 = !{!"_ZTS8ImVectorItE", !11, i64 0, !11, i64 4, !6, i64 8}
!29 = !{!"_ZTS8ImVectorI11ImFontGlyphE", !11, i64 0, !11, i64 4, !6, i64 8}
!30 = !{!23, !15, i64 16}
!31 = !{!23, !15, i64 20}
!32 = !{!23, !24, i64 4}
!33 = !{!23, !24, i64 6}
!34 = !{!14, !15, i64 0}
!35 = !{!14, !15, i64 4}
!36 = !{!23, !15, i64 12}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!26, !13, i64 96}
!40 = !{i8 0, i8 2}
!41 = !{}
!42 = !{!10, !13, i64 40}


; 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.ImVec2 = type { float, float }

@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [69 x i8], align 1
@__PRETTY_FUNCTION__._Z22ImFontAtlasBuildFinishP11ImFontAtlas = external hidden unnamed_addr constant [43 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [33 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 nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK11ImFontAtlas16CalcCustomRectUVEPK21ImFontAtlasCustomRectP6ImVec2S4_(ptr noundef nonnull align 8 dereferenceable(1180), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4 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: mustprogress uwtable
define dso_local void @_Z22ImFontAtlasBuildFinishP11ImFontAtlas(ptr noundef %0) local_unnamed_addr #4 {
  %2 = alloca %struct.ImVec2, align 4
  %3 = alloca %struct.ImVec2, align 4
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %6, label %.critedge

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %0, i64 56
  %8 = load ptr, ptr %7, align 8, !tbaa !18
  %.not38 = icmp eq ptr %8, null
  br i1 %.not38, label %9, label %.critedge

9:                                                ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.48, ptr noundef nonnull @.str.1, i32 noundef 3331, ptr noundef nonnull @__PRETTY_FUNCTION__._Z22ImFontAtlasBuildFinishP11ImFontAtlas) #6
  unreachable

.critedge:                                        ; preds = %1, %6
  tail call void @_ZL36ImFontAtlasBuildRenderDefaultTexDataP11ImFontAtlas(ptr noundef nonnull %0)
  tail call void @_ZL34ImFontAtlasBuildRenderLinesTexDataP11ImFontAtlas(ptr noundef nonnull %0)
  %10 = getelementptr inbounds i8, ptr %0, i64 104
  %11 = load i32, ptr %10, align 8, !tbaa !19
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.critedge
  %13 = getelementptr inbounds i8, ptr %2, i64 4
  %14 = getelementptr inbounds i8, ptr %3, i64 4
  br label %18

._crit_edge:                                      ; preds = %63, %.critedge
  %15 = getelementptr inbounds i8, ptr %0, i64 88
  %16 = call noundef ptr @_ZN8ImVectorIP6ImFontE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  %17 = call noundef ptr @_ZN8ImVectorIP6ImFontE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  %.not3942 = icmp eq ptr %16, %17
  br i1 %.not3942, label %._crit_edge46, label %.lr.ph45

18:                                               ; preds = %.lr.ph, %63
  %.041 = phi i32 [ 0, %.lr.ph ], [ %64, %63 ]
  %19 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN8ImVectorI21ImFontAtlasCustomRectEixEi(ptr noundef nonnull align 8 dereferenceable(16) %10, i32 noundef %.041)
  %20 = getelementptr inbounds i8, ptr %19, i64 24
  %21 = load ptr, ptr %20, align 8, !tbaa !20
  %22 = icmp eq ptr %21, null
  br i1 %22, label %63, label %23

23:                                               ; preds = %18
  %24 = getelementptr inbounds i8, ptr %19, i64 8
  %25 = load i32, ptr %24, align 8
  %26 = and i32 %25, 2147483647
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %63, label %28

28:                                               ; preds = %23
  %29 = getelementptr inbounds i8, ptr %21, i64 64
  %30 = load ptr, ptr %29, align 8, !tbaa !23
  %31 = icmp eq ptr %30, %0
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @__assert_fail(ptr noundef nonnull @.str.49, ptr noundef nonnull @.str.1, i32 noundef 3343, ptr noundef nonnull @__PRETTY_FUNCTION__._Z22ImFontAtlasBuildFinishP11ImFontAtlas) #6
  unreachable

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  call void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @_ZNK11ImFontAtlas16CalcCustomRectUVEPK21ImFontAtlasCustomRectP6ImVec2S4_(ptr noundef nonnull align 8 dereferenceable(1180) %0, ptr noundef nonnull %19, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %34 = load ptr, ptr %20, align 8, !tbaa !20
  %35 = load i32, ptr %24, align 8
  %36 = trunc i32 %35 to i16
  %37 = getelementptr inbounds i8, ptr %19, i64 16
  %38 = load float, ptr %37, align 8, !tbaa !28
  %39 = getelementptr inbounds i8, ptr %19, i64 20
  %40 = load float, ptr %39, align 4, !tbaa !29
  %41 = getelementptr inbounds i8, ptr %19, i64 4
  %42 = load i16, ptr %41, align 4, !tbaa !30
  %43 = uitofp i16 %42 to float
  %44 = fadd float %38, %43
  %45 = getelementptr inbounds i8, ptr %19, i64 6
  %46 = load i16, ptr %45, align 2, !tbaa !31
  %47 = uitofp i16 %46 to float
  %48 = fadd float %40, %47
  %49 = load float, ptr %2, align 4, !tbaa !32
  %50 = load float, ptr %13, align 4, !tbaa !33
  %51 = load float, ptr %3, align 4, !tbaa !32
  %52 = load float, ptr %14, align 4, !tbaa !33
  %53 = getelementptr inbounds i8, ptr %19, i64 12
  %54 = load float, ptr %53, align 4, !tbaa !34
  call void @_ZN6ImFont8AddGlyphEPK12ImFontConfigtfffffffff(ptr noundef nonnull align 8 dereferenceable(118) %34, ptr noundef null, i16 noundef zeroext %36, float noundef %38, float noundef %40, float noundef %44, float noundef %48, float noundef %49, float noundef %50, float noundef %51, float noundef %52, float noundef %54)
  %55 = load i32, ptr %24, align 8
  %.not40 = icmp sgt i32 %55, -1
  br i1 %.not40, label %62, label %56

56:                                               ; preds = %33
  %57 = load ptr, ptr %20, align 8, !tbaa !20
  %58 = getelementptr inbounds i8, ptr %57, i64 40
  %59 = call noundef nonnull align 4 dereferenceable(40) ptr @_ZN8ImVectorI11ImFontGlyphE4backEv(ptr noundef nonnull align 8 dereferenceable(16) %58)
  %60 = load i32, ptr %59, align 4
  %61 = or i32 %60, 1
  store i32 %61, ptr %59, align 4
  br label %62

62:                                               ; preds = %56, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %63

63:                                               ; preds = %18, %23, %62
  %64 = add nuw nsw i32 %.041, 1
  %65 = load i32, ptr %10, align 8, !tbaa !19
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %18, label %._crit_edge, !llvm.loop !35

._crit_edge46:                                    ; preds = %73, %._crit_edge
  %67 = getelementptr inbounds i8, ptr %0, i64 40
  store i8 1, ptr %67, align 8, !tbaa !37
  ret void

.lr.ph45:                                         ; preds = %._crit_edge, %73
  %.03543 = phi ptr [ %74, %73 ], [ %16, %._crit_edge ]
  %68 = load ptr, ptr %.03543, align 8, !tbaa !38
  %69 = getelementptr inbounds i8, ptr %68, i64 96
  %70 = load i8, ptr %69, align 8, !tbaa !39, !range !40, !noundef !41
  %71 = trunc nuw i8 %70 to i1
  br i1 %71, label %72, label %73

72:                                               ; preds = %.lr.ph45
  call void @_ZN6ImFont16BuildLookupTableEv(ptr noundef nonnull align 8 dereferenceable(118) %68)
  br label %73

73:                                               ; preds = %72, %.lr.ph45
  %74 = getelementptr inbounds i8, ptr %.03543, i64 8
  %.not39 = icmp eq ptr %74, %17
  br i1 %.not39, label %._crit_edge46, label %.lr.ph45
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL36ImFontAtlasBuildRenderDefaultTexDataP11ImFontAtlas(ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL34ImFontAtlasBuildRenderLinesTexDataP11ImFontAtlas(ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ImFont8AddGlyphEPK12ImFontConfigtfffffffff(ptr noundef nonnull align 8 dereferenceable(118), ptr noundef, i16 noundef zeroext, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ImFont16BuildLookupTableEv(ptr noundef nonnull align 8 dereferenceable(118)) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { mustprogress uwtable "min-legal-vector-width"="64" "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, !12, i64 48}
!6 = !{!"_ZTS11ImFontAtlas", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 20, !11, i64 24, !12, i64 32, !11, i64 40, !11, i64 41, !12, i64 48, !12, i64 56, !7, i64 64, !7, i64 68, !13, i64 72, !13, i64 80, !15, i64 88, !16, i64 104, !17, i64 120, !8, i64 136, !12, i64 1160, !7, i64 1168, !7, i64 1172, !7, i64 1176}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long long", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !8, i64 0}
!15 = !{!"_ZTS8ImVectorIP6ImFontE", !7, i64 0, !7, i64 4, !12, i64 8}
!16 = !{!"_ZTS8ImVectorI21ImFontAtlasCustomRectE", !7, i64 0, !7, i64 4, !12, i64 8}
!17 = !{!"_ZTS8ImVectorI12ImFontConfigE", !7, i64 0, !7, i64 4, !12, i64 8}
!18 = !{!6, !12, i64 56}
!19 = !{!6, !7, i64 104}
!20 = !{!21, !12, i64 24}
!21 = !{!"_ZTS21ImFontAtlasCustomRect", !22, i64 0, !22, i64 2, !22, i64 4, !22, i64 6, !7, i64 8, !7, i64 11, !14, i64 12, !13, i64 16, !12, i64 24}
!22 = !{!"short", !8, i64 0}
!23 = !{!24, !12, i64 64}
!24 = !{!"_ZTS6ImFont", !25, i64 0, !14, i64 16, !14, i64 20, !26, i64 24, !27, i64 40, !12, i64 56, !12, i64 64, !12, i64 72, !22, i64 80, !22, i64 82, !22, i64 84, !22, i64 86, !14, i64 88, !14, i64 92, !11, i64 96, !14, i64 100, !14, i64 104, !14, i64 108, !7, i64 112, !8, i64 116}
!25 = !{!"_ZTS8ImVectorIfE", !7, i64 0, !7, i64 4, !12, i64 8}
!26 = !{!"_ZTS8ImVectorItE", !7, i64 0, !7, i64 4, !12, i64 8}
!27 = !{!"_ZTS8ImVectorI11ImFontGlyphE", !7, i64 0, !7, i64 4, !12, i64 8}
!28 = !{!21, !14, i64 16}
!29 = !{!21, !14, i64 20}
!30 = !{!21, !22, i64 4}
!31 = !{!21, !22, i64 6}
!32 = !{!13, !14, i64 0}
!33 = !{!13, !14, i64 4}
!34 = !{!21, !14, i64 12}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!6, !11, i64 40}
!38 = !{!12, !12, i64 0}
!39 = !{!24, !11, i64 96}
!40 = !{i8 0, i8 2}
!41 = !{}


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