; LLVM IR from DarrenSweeney/3D-Physics-Engine :: Physics Engine/Imgui/imgui.ll (ZNK6ImFont13CalcTextSizeAEfffPKcS1_PS1_)

; 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.ImFont = type { float, float, %struct.ImVec2, i16, ptr, %class.ImVector.16, ptr, float, %class.ImVector.10, %class.ImVector.17 }
%class.ImVector.16 = type { i64, i64, ptr }
%class.ImVector.10 = type { i64, i64, ptr }
%class.ImVector.17 = type { i64, i64, ptr }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #0 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local <2 x float> @_ZNK6ImFont13CalcTextSizeAEfffPKcS1_PS1_(ptr noundef nonnull align 8 dereferenceable(120) %0, float noundef %1, float noundef %2, float noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #3 align 2 {
  %8 = alloca %struct.ImVec2, align 4
  %9 = alloca ptr, align 8
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca i8, align 1
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i8, align 1
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca float, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store float %1, ptr %10, align 4, !tbaa !9
  store float %2, ptr %11, align 4, !tbaa !9
  store float %3, ptr %12, align 4, !tbaa !9
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  %26 = load ptr, ptr %9, align 8
  %27 = load ptr, ptr %14, align 8, !tbaa !5
  %28 = icmp ne ptr %27, null
  br i1 %28, label %34, label %29

29:                                               ; preds = %7
  %30 = load ptr, ptr %13, align 8, !tbaa !5
  %31 = load ptr, ptr %13, align 8, !tbaa !5
  %32 = call i64 @strlen(ptr noundef %31) #6
  %33 = getelementptr inbounds i8, ptr %30, i64 %32
  store ptr %33, ptr %14, align 8, !tbaa !5
  br label %34

34:                                               ; preds = %29, %7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %35 = load float, ptr %10, align 4, !tbaa !9
  %36 = getelementptr inbounds %struct.ImFont, ptr %26, i32 0, i32 0
  %37 = load float, ptr %36, align 8, !tbaa !11
  %38 = fdiv float %35, %37
  store float %38, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %39 = getelementptr inbounds %struct.ImFont, ptr %26, i32 0, i32 0
  %40 = load float, ptr %39, align 8, !tbaa !11
  %41 = load float, ptr %16, align 4, !tbaa !9
  %42 = fmul float %40, %41
  store float %42, ptr %17, align 4, !tbaa !9
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %8, float noundef 0.000000e+00, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store float 0.000000e+00, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #7
  %43 = load float, ptr %12, align 4, !tbaa !9
  %44 = fcmp ogt float %43, 0.000000e+00
  %45 = zext i1 %44 to i8
  store i8 %45, ptr %19, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store ptr null, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %46 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %46, ptr %21, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %177, %175, %114, %34
  %48 = load ptr, ptr %21, align 8, !tbaa !5
  %49 = load ptr, ptr %14, align 8, !tbaa !5
  %50 = icmp ult ptr %48, %49
  br i1 %50, label %51, label %178

51:                                               ; preds = %47
  %52 = load i8, ptr %19, align 1, !tbaa !19, !range !21, !noundef !22
  %53 = trunc i8 %52 to i1
  br i1 %53, label %54, label %116

54:                                               ; preds = %51
  %55 = load ptr, ptr %20, align 8, !tbaa !5
  %56 = icmp ne ptr %55, null
  br i1 %56, label %72, label %57

57:                                               ; preds = %54
  %58 = load float, ptr %16, align 4, !tbaa !9
  %59 = load ptr, ptr %21, align 8, !tbaa !5
  %60 = load ptr, ptr %14, align 8, !tbaa !5
  %61 = load float, ptr %12, align 4, !tbaa !9
  %62 = load float, ptr %18, align 4, !tbaa !9
  %63 = fsub float %61, %62
  %64 = call noundef ptr @_ZNK6ImFont21CalcWordWrapPositionAEfPKcS1_f(ptr noundef nonnull align 8 dereferenceable(120) %26, float noundef %58, ptr noundef %59, ptr noundef %60, float noundef %63)
  store ptr %64, ptr %20, align 8, !tbaa !5
  %65 = load ptr, ptr %20, align 8, !tbaa !5
  %66 = load ptr, ptr %21, align 8, !tbaa !5
  %67 = icmp eq ptr %65, %66
  br i1 %67, label %68, label %71

68:                                               ; preds = %57
  %69 = load ptr, ptr %20, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i32 1
  store ptr %70, ptr %20, align 8, !tbaa !5
  br label %71

71:                                               ; preds = %68, %57
  br label %72

72:                                               ; preds = %71, %54
  %73 = load ptr, ptr %21, align 8, !tbaa !5
  %74 = load ptr, ptr %20, align 8, !tbaa !5
  %75 = icmp uge ptr %73, %74
  br i1 %75, label %76, label %115

76:                                               ; preds = %72
  %77 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 0
  %78 = load float, ptr %77, align 4, !tbaa !23
  %79 = load float, ptr %18, align 4, !tbaa !9
  %80 = fcmp olt float %78, %79
  br i1 %80, label %81, label %84

81:                                               ; preds = %76
  %82 = load float, ptr %18, align 4, !tbaa !9
  %83 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 0
  store float %82, ptr %83, align 4, !tbaa !23
  br label %84

84:                                               ; preds = %81, %76
  %85 = load float, ptr %17, align 4, !tbaa !9
  %86 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 1
  %87 = load float, ptr %86, align 4, !tbaa !24
  %88 = fadd float %87, %85
  store float %88, ptr %86, align 4, !tbaa !24
  store float 0.000000e+00, ptr %18, align 4, !tbaa !9
  store ptr null, ptr %20, align 8, !tbaa !5
  br label %89

89:                                               ; preds = %113, %84
  %90 = load ptr, ptr %21, align 8, !tbaa !5
  %91 = load ptr, ptr %14, align 8, !tbaa !5
  %92 = icmp ult ptr %90, %91
  br i1 %92, label %93, label %114

93:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #7
  %94 = load ptr, ptr %21, align 8, !tbaa !5
  %95 = load i8, ptr %94, align 1, !tbaa !25
  store i8 %95, ptr %22, align 1, !tbaa !25
  %96 = load i8, ptr %22, align 1, !tbaa !25
  %97 = sext i8 %96 to i32
  %98 = call noundef zeroext i1 @_ZL13ImCharIsSpacei(i32 noundef %97)
  br i1 %98, label %99, label %102

99:                                               ; preds = %93
  %100 = load ptr, ptr %21, align 8, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %100, i32 1
  store ptr %101, ptr %21, align 8, !tbaa !5
  br label %110

102:                                              ; preds = %93
  %103 = load i8, ptr %22, align 1, !tbaa !25
  %104 = sext i8 %103 to i32
  %105 = icmp eq i32 %104, 10
  br i1 %105, label %106, label %109

106:                                              ; preds = %102
  %107 = load ptr, ptr %21, align 8, !tbaa !5
  %108 = getelementptr inbounds i8, ptr %107, i32 1
  store ptr %108, ptr %21, align 8, !tbaa !5
  store i32 5, ptr %23, align 4
  br label %111

109:                                              ; preds = %102
  store i32 5, ptr %23, align 4
  br label %111

110:                                              ; preds = %99
  store i32 0, ptr %23, align 4
  br label %111

111:                                              ; preds = %110, %109, %106
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #7
  %112 = load i32, ptr %23, align 4
  switch i32 %112, label %206 [
    i32 0, label %113
    i32 5, label %114
  ]

113:                                              ; preds = %111
  br label %89, !llvm.loop !26

114:                                              ; preds = %111, %89
  br label %47, !llvm.loop !28

115:                                              ; preds = %72
  br label %116

116:                                              ; preds = %115, %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %117 = load ptr, ptr %21, align 8, !tbaa !5
  %118 = load i8, ptr %117, align 1, !tbaa !25
  %119 = sext i8 %118 to i32
  store i32 %119, ptr %24, align 4, !tbaa !29
  %120 = load i32, ptr %24, align 4, !tbaa !29
  %121 = icmp ult i32 %120, 128
  br i1 %121, label %122, label %125

122:                                              ; preds = %116
  %123 = load ptr, ptr %21, align 8, !tbaa !5
  %124 = getelementptr inbounds i8, ptr %123, i64 1
  store ptr %124, ptr %21, align 8, !tbaa !5
  br label %132

125:                                              ; preds = %116
  %126 = load ptr, ptr %21, align 8, !tbaa !5
  %127 = load ptr, ptr %14, align 8, !tbaa !5
  %128 = call noundef i32 @_ZL18ImTextCharFromUtf8PjPKcS1_(ptr noundef %24, ptr noundef %126, ptr noundef %127)
  %129 = load ptr, ptr %21, align 8, !tbaa !5
  %130 = sext i32 %128 to i64
  %131 = getelementptr inbounds i8, ptr %129, i64 %130
  store ptr %131, ptr %21, align 8, !tbaa !5
  br label %132

132:                                              ; preds = %125, %122
  %133 = load i32, ptr %24, align 4, !tbaa !29
  %134 = icmp eq i32 %133, 10
  br i1 %134, label %135, label %145

135:                                              ; preds = %132
  %136 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 0
  %137 = load float, ptr %136, align 4, !tbaa !23
  %138 = load float, ptr %18, align 4, !tbaa !9
  %139 = call noundef float @_ZL5ImMaxff(float noundef %137, float noundef %138)
  %140 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 0
  store float %139, ptr %140, align 4, !tbaa !23
  %141 = load float, ptr %17, align 4, !tbaa !9
  %142 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 1
  %143 = load float, ptr %142, align 4, !tbaa !24
  %144 = fadd float %143, %141
  store float %144, ptr %142, align 4, !tbaa !24
  store float 0.000000e+00, ptr %18, align 4, !tbaa !9
  store i32 2, ptr %23, align 4
  br label %175, !llvm.loop !28

145:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %146 = load i32, ptr %24, align 4, !tbaa !29
  %147 = zext i32 %146 to i64
  %148 = getelementptr inbounds %struct.ImFont, ptr %26, i32 0, i32 8
  %149 = call noundef i64 @_ZNK8ImVectorIfE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %148)
  %150 = icmp ult i64 %147, %149
  br i1 %150, label %151, label %159

151:                                              ; preds = %145
  %152 = getelementptr inbounds %struct.ImFont, ptr %26, i32 0, i32 8
  %153 = load i32, ptr %24, align 4, !tbaa !29
  %154 = zext i32 %153 to i64
  %155 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK8ImVectorIfEixEm(ptr noundef nonnull align 8 dereferenceable(24) %152, i64 noundef %154)
  %156 = load float, ptr %155, align 4, !tbaa !9
  %157 = load float, ptr %16, align 4, !tbaa !9
  %158 = fmul float %156, %157
  br label %162

159:                                              ; preds = %145
  %160 = getelementptr inbounds %struct.ImFont, ptr %26, i32 0, i32 7
  %161 = load float, ptr %160, align 8, !tbaa !31
  br label %162

162:                                              ; preds = %159, %151
  %163 = phi float [ %158, %151 ], [ %161, %159 ]
  store float %163, ptr %25, align 4, !tbaa !9
  %164 = load float, ptr %18, align 4, !tbaa !9
  %165 = load float, ptr %25, align 4, !tbaa !9
  %166 = fadd float %164, %165
  %167 = load float, ptr %11, align 4, !tbaa !9
  %168 = fcmp oge float %166, %167
  br i1 %168, label %169, label %170

169:                                              ; preds = %162
  store i32 3, ptr %23, align 4
  br label %174

170:                                              ; preds = %162
  %171 = load float, ptr %25, align 4, !tbaa !9
  %172 = load float, ptr %18, align 4, !tbaa !9
  %173 = fadd float %172, %171
  store float %173, ptr %18, align 4, !tbaa !9
  store i32 0, ptr %23, align 4
  br label %174

174:                                              ; preds = %170, %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %175

175:                                              ; preds = %174, %135
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  %176 = load i32, ptr %23, align 4
  switch i32 %176, label %206 [
    i32 0, label %177
    i32 2, label %47
    i32 3, label %178
  ]

177:                                              ; preds = %175
  br label %47, !llvm.loop !28

178:                                              ; preds = %175, %47
  %179 = load float, ptr %18, align 4, !tbaa !9
  %180 = fcmp ogt float %179, 0.000000e+00
  br i1 %180, label %185, label %181

181:                                              ; preds = %178
  %182 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 1
  %183 = load float, ptr %182, align 4, !tbaa !24
  %184 = fcmp oeq float %183, 0.000000e+00
  br i1 %184, label %185, label %198

185:                                              ; preds = %181, %178
  %186 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 0
  %187 = load float, ptr %186, align 4, !tbaa !23
  %188 = load float, ptr %18, align 4, !tbaa !9
  %189 = fcmp olt float %187, %188
  br i1 %189, label %190, label %193

190:                                              ; preds = %185
  %191 = load float, ptr %18, align 4, !tbaa !9
  %192 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 0
  store float %191, ptr %192, align 4, !tbaa !23
  br label %193

193:                                              ; preds = %190, %185
  %194 = load float, ptr %17, align 4, !tbaa !9
  %195 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 1
  %196 = load float, ptr %195, align 4, !tbaa !24
  %197 = fadd float %196, %194
  store float %197, ptr %195, align 4, !tbaa !24
  br label %198

198:                                              ; preds = %193, %181
  %199 = load ptr, ptr %15, align 8, !tbaa !5
  %200 = icmp ne ptr %199, null
  br i1 %200, label %201, label %204

201:                                              ; preds = %198
  %202 = load ptr, ptr %21, align 8, !tbaa !5
  %203 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %202, ptr %203, align 8, !tbaa !5
  br label %204

204:                                              ; preds = %201, %198
  store i32 1, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  %205 = load <2 x float>, ptr %8, align 4
  ret <2 x float> %205

206:                                              ; preds = %175, %111
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef float @_ZL5ImMaxff(float noundef, float noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL18ImTextCharFromUtf8PjPKcS1_(ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZL13ImCharIsSpacei(i32 noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK8ImVectorIfE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK6ImFont21CalcWordWrapPositionAEfPKcS1_f(ptr noundef nonnull align 8 dereferenceable(120), float noundef, ptr noundef, ptr noundef, float noundef) #5 align 2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind willreturn memory(read) "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 = { 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 #4 = { 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 #5 = { 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 willreturn memory(read) }
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, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS6ImFont", !10, i64 0, !10, i64 4, !13, i64 8, !14, i64 16, !6, i64 24, !15, i64 32, !6, i64 56, !10, i64 64, !17, i64 72, !18, i64 96}
!13 = !{!"_ZTS6ImVec2", !10, i64 0, !10, i64 4}
!14 = !{!"short", !7, i64 0}
!15 = !{!"_ZTS8ImVectorIN6ImFont5GlyphEE", !16, i64 0, !16, i64 8, !6, i64 16}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTS8ImVectorIfE", !16, i64 0, !16, i64 8, !6, i64 16}
!18 = !{!"_ZTS8ImVectorIiE", !16, i64 0, !16, i64 8, !6, i64 16}
!19 = !{!20, !20, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!13, !10, i64 0}
!24 = !{!13, !10, i64 4}
!25 = !{!7, !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}
!29 = !{!30, !30, i64 0}
!30 = !{!"int", !7, i64 0}
!31 = !{!12, !10, i64 64}


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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local <2 x float> @_ZNK6ImFont13CalcTextSizeAEfffPKcS1_PS1_(ptr noundef nonnull align 8 dereferenceable(120) %0, float noundef %1, float noundef %2, float noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef writeonly %6) local_unnamed_addr #3 align 2 {
  %8 = alloca %struct.ImVec2, align 8
  %9 = alloca i32, align 4
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %10, label %13

10:                                               ; preds = %7
  %11 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %4) #6
  %12 = getelementptr inbounds i8, ptr %4, i64 %11
  br label %13

13:                                               ; preds = %10, %7
  %.0 = phi ptr [ %5, %7 ], [ %12, %10 ]
  %14 = load float, ptr %0, align 8, !tbaa !5
  %15 = fdiv float %1, %14
  %16 = fmul float %14, %15
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %8, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %17 = icmp ugt ptr %.0, %4
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %13
  %18 = fcmp ogt float %3, 0.000000e+00
  %19 = getelementptr inbounds i8, ptr %8, i64 4
  %20 = getelementptr inbounds i8, ptr %0, i64 72
  %21 = getelementptr inbounds i8, ptr %0, i64 64
  br i1 %18, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.backedge.us
  %.05685.us = phi float [ %.056.be.us, %.backedge.us ], [ 0.000000e+00, %.lr.ph ]
  %.05984.us = phi ptr [ %.059.be.us, %.backedge.us ], [ %4, %.lr.ph ]
  %.06383.us = phi ptr [ %.063.be.us, %.backedge.us ], [ null, %.lr.ph ]
  %.not73.us = icmp eq ptr %.06383.us, null
  br i1 %.not73.us, label %22, label %26

22:                                               ; preds = %.lr.ph.split.us
  %23 = fsub float %3, %.05685.us
  %24 = call noundef ptr @_ZNK6ImFont21CalcWordWrapPositionAEfPKcS1_f(ptr noundef nonnull align 8 dereferenceable(120) %0, float noundef %15, ptr noundef %.05984.us, ptr noundef nonnull %.0, float noundef %23)
  %25 = icmp eq ptr %24, %.05984.us
  %spec.select.idx.us = zext i1 %25 to i64
  %spec.select.us = getelementptr inbounds i8, ptr %24, i64 %spec.select.idx.us
  br label %26

26:                                               ; preds = %22, %.lr.ph.split.us
  %.164.us = phi ptr [ %.06383.us, %.lr.ph.split.us ], [ %spec.select.us, %22 ]
  %.not74.us = icmp ult ptr %.05984.us, %.164.us
  br i1 %.not74.us, label %41, label %27

27:                                               ; preds = %26
  %28 = load float, ptr %8, align 8, !tbaa !17
  %29 = fcmp olt float %28, %.05685.us
  br i1 %29, label %30, label %31

30:                                               ; preds = %27
  store float %.05685.us, ptr %8, align 8, !tbaa !17
  br label %31

31:                                               ; preds = %30, %27
  %32 = load float, ptr %19, align 4, !tbaa !18
  %33 = fadd float %16, %32
  store float %33, ptr %19, align 4, !tbaa !18
  br label %34

34:                                               ; preds = %36, %31
  %.160.us = phi ptr [ %.05984.us, %31 ], [ %40, %36 ]
  %35 = icmp ult ptr %.160.us, %.0
  br i1 %35, label %36, label %.backedge.us

36:                                               ; preds = %34
  %37 = load i8, ptr %.160.us, align 1, !tbaa !19
  %38 = sext i8 %37 to i32
  %39 = call noundef zeroext i1 @_ZL13ImCharIsSpacei(i32 noundef %38)
  %40 = getelementptr inbounds i8, ptr %.160.us, i64 1
  br i1 %39, label %34, label %.split.loop.exit.us

41:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %42 = load i8, ptr %.05984.us, align 1, !tbaa !19
  %43 = sext i8 %42 to i32
  store i32 %43, ptr %9, align 4, !tbaa !20
  %44 = icmp sgt i8 %42, -1
  br i1 %44, label %49, label %45

45:                                               ; preds = %41
  %46 = call noundef i32 @_ZL18ImTextCharFromUtf8PjPKcS1_(ptr noundef nonnull %9, ptr noundef nonnull %.05984.us, ptr noundef nonnull %.0)
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i8, ptr %.05984.us, i64 %47
  %.pr.us = load i32, ptr %9, align 4, !tbaa !20
  br label %51

49:                                               ; preds = %41
  %50 = getelementptr inbounds i8, ptr %.05984.us, i64 1
  br label %51

51:                                               ; preds = %49, %45
  %52 = phi i32 [ %.pr.us, %45 ], [ %43, %49 ]
  %.4.us = phi ptr [ %48, %45 ], [ %50, %49 ]
  %53 = icmp eq i32 %52, 10
  br i1 %53, label %70, label %54

54:                                               ; preds = %51
  %55 = zext i32 %52 to i64
  %56 = call noundef i64 @_ZNK8ImVectorIfE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  %57 = icmp ugt i64 %56, %55
  br i1 %57, label %60, label %58

58:                                               ; preds = %54
  %59 = load float, ptr %21, align 8, !tbaa !22
  br label %66

60:                                               ; preds = %54
  %61 = load i32, ptr %9, align 4, !tbaa !20
  %62 = zext i32 %61 to i64
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK8ImVectorIfEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %62)
  %64 = load float, ptr %63, align 4, !tbaa !23
  %65 = fmul float %15, %64
  br label %66

66:                                               ; preds = %60, %58
  %67 = phi float [ %65, %60 ], [ %59, %58 ]
  %68 = fadd float %.05685.us, %67
  %69 = fcmp ult float %68, %2
  br i1 %69, label %.thread, label %75

70:                                               ; preds = %51
  %71 = load float, ptr %8, align 8, !tbaa !17
  %72 = call noundef float @_ZL5ImMaxff(float noundef %71, float noundef %.05685.us)
  store float %72, ptr %8, align 8, !tbaa !17
  %73 = load float, ptr %19, align 4, !tbaa !18
  %74 = fadd float %16, %73
  store float %74, ptr %19, align 4, !tbaa !18
  br label %.thread, !llvm.loop !24

.thread:                                          ; preds = %70, %66
  %.258.us.ph = phi float [ 0.000000e+00, %70 ], [ %68, %66 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %.backedge.us

75:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %._crit_edge

.backedge.us:                                     ; preds = %34, %.thread, %.split.loop.exit.us
  %.063.be.us = phi ptr [ null, %.split.loop.exit.us ], [ %.164.us, %.thread ], [ null, %34 ]
  %.059.be.us = phi ptr [ %spec.select78.le.us, %.split.loop.exit.us ], [ %.4.us, %.thread ], [ %.160.us, %34 ]
  %.056.be.us = phi float [ 0.000000e+00, %.split.loop.exit.us ], [ %.258.us.ph, %.thread ], [ 0.000000e+00, %34 ]
  %76 = icmp ult ptr %.059.be.us, %.0
  br i1 %76, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !24

.split.loop.exit.us:                              ; preds = %36
  %77 = icmp eq i8 %37, 10
  %spec.select78.le.us = select i1 %77, ptr %40, ptr %.160.us
  br label %.backedge.us

.lr.ph.split:                                     ; preds = %.lr.ph, %111
  %.05685 = phi float [ %.258, %111 ], [ 0.000000e+00, %.lr.ph ]
  %.05984 = phi ptr [ %.4, %111 ], [ %4, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %78 = load i8, ptr %.05984, align 1, !tbaa !19
  %79 = sext i8 %78 to i32
  store i32 %79, ptr %9, align 4, !tbaa !20
  %80 = icmp sgt i8 %78, -1
  br i1 %80, label %81, label %83

81:                                               ; preds = %.lr.ph.split
  %82 = getelementptr inbounds i8, ptr %.05984, i64 1
  br label %87

83:                                               ; preds = %.lr.ph.split
  %84 = call noundef i32 @_ZL18ImTextCharFromUtf8PjPKcS1_(ptr noundef nonnull %9, ptr noundef nonnull %.05984, ptr noundef nonnull %.0)
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i8, ptr %.05984, i64 %85
  %.pr = load i32, ptr %9, align 4, !tbaa !20
  br label %87

87:                                               ; preds = %83, %81
  %88 = phi i32 [ %.pr, %83 ], [ %79, %81 ]
  %.4 = phi ptr [ %86, %83 ], [ %82, %81 ]
  %89 = icmp eq i32 %88, 10
  br i1 %89, label %90, label %95

90:                                               ; preds = %87
  %91 = load float, ptr %8, align 8, !tbaa !17
  %92 = call noundef float @_ZL5ImMaxff(float noundef %91, float noundef %.05685)
  store float %92, ptr %8, align 8, !tbaa !17
  %93 = load float, ptr %19, align 4, !tbaa !18
  %94 = fadd float %16, %93
  store float %94, ptr %19, align 4, !tbaa !18
  br label %111, !llvm.loop !24

95:                                               ; preds = %87
  %96 = zext i32 %88 to i64
  %97 = call noundef i64 @_ZNK8ImVectorIfE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  %98 = icmp ugt i64 %97, %96
  br i1 %98, label %99, label %105

99:                                               ; preds = %95
  %100 = load i32, ptr %9, align 4, !tbaa !20
  %101 = zext i32 %100 to i64
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK8ImVectorIfEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %101)
  %103 = load float, ptr %102, align 4, !tbaa !23
  %104 = fmul float %15, %103
  br label %107

105:                                              ; preds = %95
  %106 = load float, ptr %21, align 8, !tbaa !22
  br label %107

107:                                              ; preds = %105, %99
  %108 = phi float [ %104, %99 ], [ %106, %105 ]
  %109 = fadd float %.05685, %108
  %110 = fcmp ult float %109, %2
  %..056 = select i1 %110, float %109, float %.05685
  br label %111

111:                                              ; preds = %107, %90
  %.258 = phi float [ 0.000000e+00, %90 ], [ %..056, %107 ]
  %.2 = phi i1 [ true, %90 ], [ %110, %107 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  %112 = icmp ult ptr %.4, %.0
  %or.cond93 = select i1 %.2, i1 %112, i1 false
  br i1 %or.cond93, label %.lr.ph.split, label %._crit_edge, !llvm.loop !24

._crit_edge:                                      ; preds = %111, %.backedge.us, %75, %13
  %.5 = phi ptr [ %4, %13 ], [ %.4.us, %75 ], [ %.059.be.us, %.backedge.us ], [ %.4, %111 ]
  %.3 = phi float [ 0.000000e+00, %13 ], [ %.05685.us, %75 ], [ %.056.be.us, %.backedge.us ], [ %.258, %111 ]
  %113 = fcmp ogt float %.3, 0.000000e+00
  %114 = getelementptr inbounds i8, ptr %8, i64 4
  %115 = load float, ptr %114, align 4
  %116 = fcmp oeq float %115, 0.000000e+00
  %or.cond = select i1 %113, i1 true, i1 %116
  br i1 %or.cond, label %117, label %123

117:                                              ; preds = %._crit_edge
  %118 = load float, ptr %8, align 8, !tbaa !17
  %119 = fcmp olt float %118, %.3
  br i1 %119, label %120, label %121

120:                                              ; preds = %117
  store float %.3, ptr %8, align 8, !tbaa !17
  br label %121

121:                                              ; preds = %120, %117
  %122 = fadd float %16, %115
  store float %122, ptr %114, align 4, !tbaa !18
  br label %123

123:                                              ; preds = %._crit_edge, %121
  %.not75 = icmp eq ptr %6, null
  br i1 %.not75, label %125, label %124

124:                                              ; preds = %123
  store ptr %.5, ptr %6, align 8, !tbaa !26
  br label %125

125:                                              ; preds = %124, %123
  %126 = load <2 x float>, ptr %8, align 8
  ret <2 x float> %126
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef float @_ZL5ImMaxff(float noundef, float noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL18ImTextCharFromUtf8PjPKcS1_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZL13ImCharIsSpacei(i32 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK8ImVectorIfE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK6ImFont21CalcWordWrapPositionAEfPKcS1_f(ptr noundef nonnull align 8 dereferenceable(120), float noundef, ptr noundef, ptr noundef, float noundef) local_unnamed_addr #5 align 2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { 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 #4 = { 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 #5 = { 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 willreturn memory(read) }
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 = !{!"_ZTS6ImFont", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 16, !12, i64 24, !13, i64 32, !12, i64 56, !7, i64 64, !15, i64 72, !16, i64 96}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS6ImVec2", !7, i64 0, !7, i64 4}
!11 = !{!"short", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"_ZTS8ImVectorIN6ImFont5GlyphEE", !14, i64 0, !14, i64 8, !12, i64 16}
!14 = !{!"long", !8, i64 0}
!15 = !{!"_ZTS8ImVectorIfE", !14, i64 0, !14, i64 8, !12, i64 16}
!16 = !{!"_ZTS8ImVectorIiE", !14, i64 0, !14, i64 8, !12, i64 16}
!17 = !{!10, !7, i64 0}
!18 = !{!10, !7, i64 4}
!19 = !{!8, !8, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"int", !8, i64 0}
!22 = !{!6, !7, i64 64}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!12, !12, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass