; LLVM IR from hadryansalles/Luz :: deps/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], 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.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.ImFont = type <{ %struct.ImVector.6, float, float, %struct.ImVector.1, %struct.ImVector.7, 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.6 = type { i32, i32, ptr }
%struct.ImVector.1 = type { i32, i32, ptr }
%struct.ImVector.7 = type { i32, i32, ptr }

@.str.1 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [69 x i8], align 1
@__PRETTY_FUNCTION__._Z22ImFontAtlasBuildFinishP11ImFontAtlas = external hidden unnamed_addr constant [43 x i8], align 1
@.str.41 = 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 !18
  %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.40, ptr noundef @.str.1, i32 noundef 2921, 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 !19
  br label %29

29:                                               ; preds = %115, %26
  %30 = load i32, ptr %3, align 4, !tbaa !19
  %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.9, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !20
  %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 %118

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 !19
  %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 !21
  %45 = icmp eq ptr %44, null
  br i1 %45, label %51, 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, !tbaa !24
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %52

51:                                               ; preds = %46, %37
  store i32 4, ptr %4, align 4
  br label %112

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

60:                                               ; preds = %52
  br label %63

61:                                               ; preds = %52
  call void @__assert_fail(ptr noundef @.str.41, ptr noundef @.str.1, i32 noundef 2933, ptr noundef @__PRETTY_FUNCTION__._Z22ImFontAtlasBuildFinishP11ImFontAtlas) #6
  unreachable

62:                                               ; No predecessors!
  br label %63

63:                                               ; preds = %62, %60
  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)
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNK11ImFontAtlas16CalcCustomRectUVEPK21ImFontAtlasCustomRectP6ImVec2S4_(ptr noundef nonnull align 8 dereferenceable(1180) %64, ptr noundef %65, ptr noundef %6, ptr noundef %7)
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %66, i32 0, i32 7
  %68 = load ptr, ptr %67, align 8, !tbaa !21
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %69, i32 0, i32 4
  %71 = load i32, ptr %70, align 8, !tbaa !24
  %72 = trunc i32 %71 to i16
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %73, i32 0, i32 6
  %75 = getelementptr inbounds %struct.ImVec2, ptr %74, i32 0, i32 0
  %76 = load float, ptr %75, align 8, !tbaa !30
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %77, i32 0, i32 6
  %79 = getelementptr inbounds %struct.ImVec2, ptr %78, i32 0, i32 1
  %80 = load float, ptr %79, align 4, !tbaa !31
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %81, i32 0, i32 6
  %83 = getelementptr inbounds %struct.ImVec2, ptr %82, i32 0, i32 0
  %84 = load float, ptr %83, align 8, !tbaa !30
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %85, i32 0, i32 0
  %87 = load i16, ptr %86, align 8, !tbaa !32
  %88 = zext i16 %87 to i32
  %89 = sitofp i32 %88 to float
  %90 = fadd float %84, %89
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %91, i32 0, i32 6
  %93 = getelementptr inbounds %struct.ImVec2, ptr %92, i32 0, i32 1
  %94 = load float, ptr %93, align 4, !tbaa !31
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %95, i32 0, i32 1
  %97 = load i16, ptr %96, align 2, !tbaa !33
  %98 = zext i16 %97 to i32
  %99 = sitofp i32 %98 to float
  %100 = fadd float %94, %99
  %101 = getelementptr inbounds %struct.ImVec2, ptr %6, i32 0, i32 0
  %102 = load float, ptr %101, align 4, !tbaa !34
  %103 = getelementptr inbounds %struct.ImVec2, ptr %6, i32 0, i32 1
  %104 = load float, ptr %103, align 4, !tbaa !35
  %105 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 0
  %106 = load float, ptr %105, align 4, !tbaa !34
  %107 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 1
  %108 = load float, ptr %107, align 4, !tbaa !35
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %109, i32 0, i32 5
  %111 = load float, ptr %110, align 4, !tbaa !36
  call void @_ZN6ImFont8AddGlyphEPK12ImFontConfigtfffffffff(ptr noundef nonnull align 8 dereferenceable(118) %68, ptr noundef null, i16 noundef zeroext %72, float noundef %76, float noundef %80, float noundef %90, float noundef %100, float noundef %102, float noundef %104, float noundef %106, float noundef %108, float noundef %111)
  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 %112

112:                                              ; preds = %63, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  %113 = load i32, ptr %4, align 4
  switch i32 %113, label %146 [
    i32 0, label %114
    i32 4, label %115
  ]

114:                                              ; preds = %112
  br label %115

115:                                              ; preds = %114, %112
  %116 = load i32, ptr %3, align 4, !tbaa !19
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %3, align 4, !tbaa !19
  br label %29, !llvm.loop !37

118:                                              ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.ImFontAtlas, ptr %119, i32 0, i32 17
  store ptr %120, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = call noundef ptr @_ZN8ImVectorIP6ImFontE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %121)
  store ptr %122, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  %124 = call noundef ptr @_ZN8ImVectorIP6ImFontE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %123)
  store ptr %124, ptr %10, align 8, !tbaa !5
  br label %125

125:                                              ; preds = %140, %118
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  %128 = icmp ne ptr %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %125
  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 %143

130:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  store ptr %132, ptr %11, align 8, !tbaa !5
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.ImFont, ptr %133, i32 0, i32 14
  %135 = load i8, ptr %134, align 8, !tbaa !39, !range !40, !noundef !41
  %136 = trunc i8 %135 to i1
  br i1 %136, label %137, label %139

137:                                              ; preds = %130
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN6ImFont16BuildLookupTableEv(ptr noundef nonnull align 8 dereferenceable(118) %138)
  br label %139

139:                                              ; preds = %137, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %140

140:                                              ; preds = %139
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = getelementptr inbounds ptr, ptr %141, i32 1
  store ptr %142, ptr %9, align 8, !tbaa !5
  br label %125

143:                                              ; preds = %129
  %144 = load ptr, ptr %2, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.ImFontAtlas, ptr %144, i32 0, i32 8
  store i8 1, ptr %145, align 8, !tbaa !42
  ret void

146:                                              ; preds = %112
  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: 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, !6, i64 8, !11, i64 16, !11, i64 20, !12, i64 24, !6, i64 32, !12, i64 40, !12, i64 41, !6, i64 48, !6, i64 56, !11, i64 64, !11, i64 68, !13, i64 72, !13, i64 80, !15, i64 88, !16, i64 104, !17, i64 120, !7, i64 136, !6, i64 1160, !11, i64 1168, !11, i64 1172, !11, i64 1176}
!11 = !{!"int", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_ZTS8ImVectorIP6ImFontE", !11, i64 0, !11, i64 4, !6, i64 8}
!16 = !{!"_ZTS8ImVectorI21ImFontAtlasCustomRectE", !11, i64 0, !11, i64 4, !6, i64 8}
!17 = !{!"_ZTS8ImVectorI12ImFontConfigE", !11, i64 0, !11, i64 4, !6, i64 8}
!18 = !{!10, !6, i64 56}
!19 = !{!11, !11, i64 0}
!20 = !{!10, !11, i64 104}
!21 = !{!22, !6, i64 24}
!22 = !{!"_ZTS21ImFontAtlasCustomRect", !23, i64 0, !23, i64 2, !23, i64 4, !23, i64 6, !11, i64 8, !14, i64 12, !13, i64 16, !6, i64 24}
!23 = !{!"short", !7, i64 0}
!24 = !{!22, !11, i64 8}
!25 = !{!26, !6, i64 64}
!26 = !{!"_ZTS6ImFont", !27, i64 0, !14, i64 16, !14, i64 20, !28, i64 24, !29, i64 40, !6, i64 56, !6, i64 64, !6, i64 72, !23, i64 80, !23, i64 82, !23, i64 84, !23, i64 86, !14, i64 88, !14, i64 92, !12, i64 96, !14, i64 100, !14, i64 104, !14, 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 = !{!22, !14, i64 16}
!31 = !{!22, !14, i64 20}
!32 = !{!22, !23, i64 0}
!33 = !{!22, !23, i64 2}
!34 = !{!13, !14, i64 0}
!35 = !{!13, !14, i64 4}
!36 = !{!22, !14, i64 12}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!26, !12, i64 96}
!40 = !{i8 0, i8 2}
!41 = !{}
!42 = !{!10, !12, 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 [77 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [69 x i8], align 1
@__PRETTY_FUNCTION__._Z22ImFontAtlasBuildFinishP11ImFontAtlas = external hidden unnamed_addr constant [43 x i8], align 1
@.str.41 = 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 !17
  %.not36 = icmp eq ptr %8, null
  br i1 %.not36, label %9, label %.critedge

9:                                                ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.40, ptr noundef nonnull @.str.1, i32 noundef 2921, 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 !18
  %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 = %53, %.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)
  %.not3739 = icmp eq ptr %16, %17
  br i1 %.not3739, label %._crit_edge43, label %.lr.ph42

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

23:                                               ; preds = %18
  %24 = getelementptr inbounds i8, ptr %19, i64 8
  %25 = load i32, ptr %24, align 8, !tbaa !22
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %53, label %27

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

31:                                               ; preds = %27
  call void @__assert_fail(ptr noundef nonnull @.str.41, ptr noundef nonnull @.str.1, i32 noundef 2933, ptr noundef nonnull @__PRETTY_FUNCTION__._Z22ImFontAtlasBuildFinishP11ImFontAtlas) #6
  unreachable

32:                                               ; preds = %27
  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)
  %33 = load ptr, ptr %20, align 8, !tbaa !19
  %34 = load i32, ptr %24, align 8, !tbaa !22
  %35 = trunc i32 %34 to i16
  %36 = getelementptr inbounds i8, ptr %19, i64 16
  %37 = load float, ptr %36, align 8, !tbaa !28
  %38 = getelementptr inbounds i8, ptr %19, i64 20
  %39 = load float, ptr %38, align 4, !tbaa !29
  %40 = load i16, ptr %19, align 8, !tbaa !30
  %41 = uitofp i16 %40 to float
  %42 = fadd float %37, %41
  %43 = getelementptr inbounds i8, ptr %19, i64 2
  %44 = load i16, ptr %43, align 2, !tbaa !31
  %45 = uitofp i16 %44 to float
  %46 = fadd float %39, %45
  %47 = load float, ptr %2, align 4, !tbaa !32
  %48 = load float, ptr %13, align 4, !tbaa !33
  %49 = load float, ptr %3, align 4, !tbaa !32
  %50 = load float, ptr %14, align 4, !tbaa !33
  %51 = getelementptr inbounds i8, ptr %19, i64 12
  %52 = load float, ptr %51, align 4, !tbaa !34
  call void @_ZN6ImFont8AddGlyphEPK12ImFontConfigtfffffffff(ptr noundef nonnull align 8 dereferenceable(118) %33, ptr noundef null, i16 noundef zeroext %35, float noundef %37, float noundef %39, float noundef %42, float noundef %46, float noundef %47, float noundef %48, float noundef %49, float noundef %50, float noundef %52)
  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 %53

53:                                               ; preds = %18, %23, %32
  %54 = add nuw nsw i32 %.038, 1
  %55 = load i32, ptr %10, align 8, !tbaa !18
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %18, label %._crit_edge, !llvm.loop !35

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

.lr.ph42:                                         ; preds = %._crit_edge, %63
  %.03340 = phi ptr [ %64, %63 ], [ %16, %._crit_edge ]
  %58 = load ptr, ptr %.03340, align 8, !tbaa !38
  %59 = getelementptr inbounds i8, ptr %58, i64 96
  %60 = load i8, ptr %59, align 8, !tbaa !39, !range !40, !noundef !41
  %61 = trunc nuw i8 %60 to i1
  br i1 %61, label %62, label %63

62:                                               ; preds = %.lr.ph42
  call void @_ZN6ImFont16BuildLookupTableEv(ptr noundef nonnull align 8 dereferenceable(118) %58)
  br label %63

63:                                               ; preds = %62, %.lr.ph42
  %64 = getelementptr inbounds i8, ptr %.03340, i64 8
  %.not37 = icmp eq ptr %64, %17
  br i1 %.not37, label %._crit_edge43, label %.lr.ph42
}

; 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: 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, !10, i64 48}
!6 = !{!"_ZTS11ImFontAtlas", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 20, !11, i64 24, !10, i64 32, !11, i64 40, !11, i64 41, !10, i64 48, !10, i64 56, !7, i64 64, !7, i64 68, !12, i64 72, !12, i64 80, !14, i64 88, !15, i64 104, !16, i64 120, !8, i64 136, !10, 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 = !{!"any pointer", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTS6ImVec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !8, i64 0}
!14 = !{!"_ZTS8ImVectorIP6ImFontE", !7, i64 0, !7, i64 4, !10, i64 8}
!15 = !{!"_ZTS8ImVectorI21ImFontAtlasCustomRectE", !7, i64 0, !7, i64 4, !10, i64 8}
!16 = !{!"_ZTS8ImVectorI12ImFontConfigE", !7, i64 0, !7, i64 4, !10, i64 8}
!17 = !{!6, !10, i64 56}
!18 = !{!6, !7, i64 104}
!19 = !{!20, !10, i64 24}
!20 = !{!"_ZTS21ImFontAtlasCustomRect", !21, i64 0, !21, i64 2, !21, i64 4, !21, i64 6, !7, i64 8, !13, i64 12, !12, i64 16, !10, i64 24}
!21 = !{!"short", !8, i64 0}
!22 = !{!20, !7, i64 8}
!23 = !{!24, !10, i64 64}
!24 = !{!"_ZTS6ImFont", !25, i64 0, !13, i64 16, !13, i64 20, !26, i64 24, !27, i64 40, !10, i64 56, !10, i64 64, !10, i64 72, !21, i64 80, !21, i64 82, !21, i64 84, !21, i64 86, !13, i64 88, !13, i64 92, !11, i64 96, !13, i64 100, !13, i64 104, !13, i64 108, !7, i64 112, !8, i64 116}
!25 = !{!"_ZTS8ImVectorIfE", !7, i64 0, !7, i64 4, !10, i64 8}
!26 = !{!"_ZTS8ImVectorItE", !7, i64 0, !7, i64 4, !10, i64 8}
!27 = !{!"_ZTS8ImVectorI11ImFontGlyphE", !7, i64 0, !7, i64 4, !10, i64 8}
!28 = !{!20, !13, i64 16}
!29 = !{!20, !13, i64 20}
!30 = !{!20, !21, i64 0}
!31 = !{!20, !21, i64 2}
!32 = !{!12, !13, i64 0}
!33 = !{!12, !13, i64 4}
!34 = !{!20, !13, i64 12}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!6, !11, i64 40}
!38 = !{!10, !10, 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