; LLVM IR from l1mey112/yr11-physics-applied :: cimgui/imgui/imgui_draw.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 <{ %struct.ImVector.6, float, float, %struct.ImVector.1, %struct.ImVector.7, ptr, ptr, ptr, i16, i16, i16, i16, 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 }

; 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 @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #1 align 2

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

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

declare noundef i32 @_Z18ImTextCharFromUtf8PjPKcS1_(ptr noundef, ptr noundef, ptr noundef) #4

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

; Function Attrs: mustprogress uwtable
define dso_local <2 x float> @_ZNK6ImFont13CalcTextSizeAEfffPKcS1_PS1_(ptr noundef nonnull align 8 dereferenceable(110) %0, float noundef %1, float noundef %2, float noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #6 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 ptr, align 8
  %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) #8
  %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) #9
  %35 = load float, ptr %10, align 4, !tbaa !9
  store float %35, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  %36 = load float, ptr %10, align 4, !tbaa !9
  %37 = getelementptr inbounds %struct.ImFont, ptr %26, i32 0, i32 2
  %38 = load float, ptr %37, align 4, !tbaa !11
  %39 = fdiv float %36, %38
  store float %39, 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) #9
  store float 0.000000e+00, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #9
  %40 = load float, ptr %12, align 4, !tbaa !9
  %41 = fcmp ogt float %40, 0.000000e+00
  %42 = zext i1 %41 to i8
  store i8 %42, ptr %19, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  store ptr null, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %43 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %43, ptr %21, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %160, %158, %74, %34
  %45 = load ptr, ptr %21, align 8, !tbaa !5
  %46 = load ptr, ptr %14, align 8, !tbaa !5
  %47 = icmp ult ptr %45, %46
  br i1 %47, label %48, label %161

48:                                               ; preds = %44
  %49 = load i8, ptr %19, align 1, !tbaa !19, !range !20, !noundef !21
  %50 = trunc i8 %49 to i1
  br i1 %50, label %51, label %83

51:                                               ; preds = %48
  %52 = load ptr, ptr %20, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %62, label %54

54:                                               ; preds = %51
  %55 = load float, ptr %17, align 4, !tbaa !9
  %56 = load ptr, ptr %21, align 8, !tbaa !5
  %57 = load ptr, ptr %14, align 8, !tbaa !5
  %58 = load float, ptr %12, align 4, !tbaa !9
  %59 = load float, ptr %18, align 4, !tbaa !9
  %60 = fsub float %58, %59
  %61 = call noundef ptr @_ZNK6ImFont21CalcWordWrapPositionAEfPKcS1_f(ptr noundef nonnull align 8 dereferenceable(110) %26, float noundef %55, ptr noundef %56, ptr noundef %57, float noundef %60)
  store ptr %61, ptr %20, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %54, %51
  %63 = load ptr, ptr %21, align 8, !tbaa !5
  %64 = load ptr, ptr %20, align 8, !tbaa !5
  %65 = icmp uge ptr %63, %64
  br i1 %65, label %66, label %82

66:                                               ; preds = %62
  %67 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 0
  %68 = load float, ptr %67, align 4, !tbaa !22
  %69 = load float, ptr %18, align 4, !tbaa !9
  %70 = fcmp olt float %68, %69
  br i1 %70, label %71, label %74

71:                                               ; preds = %66
  %72 = load float, ptr %18, align 4, !tbaa !9
  %73 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 0
  store float %72, ptr %73, align 4, !tbaa !22
  br label %74

74:                                               ; preds = %71, %66
  %75 = load float, ptr %16, align 4, !tbaa !9
  %76 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 1
  %77 = load float, ptr %76, align 4, !tbaa !24
  %78 = fadd float %77, %75
  store float %78, ptr %76, align 4, !tbaa !24
  store float 0.000000e+00, ptr %18, align 4, !tbaa !9
  store ptr null, ptr %20, align 8, !tbaa !5
  %79 = load ptr, ptr %21, align 8, !tbaa !5
  %80 = load ptr, ptr %14, align 8, !tbaa !5
  %81 = call noundef ptr @_ZL26CalcWordWrapNextLineStartAPKcS0_(ptr noundef %79, ptr noundef %80)
  store ptr %81, ptr %21, align 8, !tbaa !5
  br label %44, !llvm.loop !25

82:                                               ; preds = %62
  br label %83

83:                                               ; preds = %82, %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  %84 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %84, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  %85 = load ptr, ptr %21, align 8, !tbaa !5
  %86 = load i8, ptr %85, align 1, !tbaa !27
  %87 = sext i8 %86 to i32
  store i32 %87, ptr %23, align 4, !tbaa !28
  %88 = load i32, ptr %23, align 4, !tbaa !28
  %89 = icmp ult i32 %88, 128
  br i1 %89, label %90, label %93

90:                                               ; preds = %83
  %91 = load ptr, ptr %21, align 8, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %91, i64 1
  store ptr %92, ptr %21, align 8, !tbaa !5
  br label %104

93:                                               ; preds = %83
  %94 = load ptr, ptr %21, align 8, !tbaa !5
  %95 = load ptr, ptr %14, align 8, !tbaa !5
  %96 = call noundef i32 @_Z18ImTextCharFromUtf8PjPKcS1_(ptr noundef %23, ptr noundef %94, ptr noundef %95)
  %97 = load ptr, ptr %21, align 8, !tbaa !5
  %98 = sext i32 %96 to i64
  %99 = getelementptr inbounds i8, ptr %97, i64 %98
  store ptr %99, ptr %21, align 8, !tbaa !5
  %100 = load i32, ptr %23, align 4, !tbaa !28
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %102, label %103

102:                                              ; preds = %93
  store i32 3, ptr %24, align 4
  br label %158

103:                                              ; preds = %93
  br label %104

104:                                              ; preds = %103, %90
  %105 = load i32, ptr %23, align 4, !tbaa !28
  %106 = icmp ult i32 %105, 32
  br i1 %106, label %107, label %125

107:                                              ; preds = %104
  %108 = load i32, ptr %23, align 4, !tbaa !28
  %109 = icmp eq i32 %108, 10
  br i1 %109, label %110, label %120

110:                                              ; preds = %107
  %111 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 0
  %112 = load float, ptr %111, align 4, !tbaa !22
  %113 = load float, ptr %18, align 4, !tbaa !9
  %114 = call noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef %112, float noundef %113)
  %115 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 0
  store float %114, ptr %115, align 4, !tbaa !22
  %116 = load float, ptr %16, align 4, !tbaa !9
  %117 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 1
  %118 = load float, ptr %117, align 4, !tbaa !24
  %119 = fadd float %118, %116
  store float %119, ptr %117, align 4, !tbaa !24
  store float 0.000000e+00, ptr %18, align 4, !tbaa !9
  store i32 2, ptr %24, align 4
  br label %158, !llvm.loop !25

120:                                              ; preds = %107
  %121 = load i32, ptr %23, align 4, !tbaa !28
  %122 = icmp eq i32 %121, 13
  br i1 %122, label %123, label %124

123:                                              ; preds = %120
  store i32 2, ptr %24, align 4
  br label %158, !llvm.loop !25

124:                                              ; preds = %120
  br label %125

125:                                              ; preds = %124, %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #9
  %126 = load i32, ptr %23, align 4, !tbaa !28
  %127 = getelementptr inbounds %struct.ImFont, ptr %26, i32 0, i32 0
  %128 = getelementptr inbounds %struct.ImVector.6, ptr %127, i32 0, i32 0
  %129 = load i32, ptr %128, align 8, !tbaa !29
  %130 = icmp slt i32 %126, %129
  br i1 %130, label %131, label %139

131:                                              ; preds = %125
  %132 = getelementptr inbounds %struct.ImFont, ptr %26, i32 0, i32 0
  %133 = getelementptr inbounds %struct.ImVector.6, ptr %132, i32 0, i32 2
  %134 = load ptr, ptr %133, align 8, !tbaa !30
  %135 = load i32, ptr %23, align 4, !tbaa !28
  %136 = zext i32 %135 to i64
  %137 = getelementptr inbounds float, ptr %134, i64 %136
  %138 = load float, ptr %137, align 4, !tbaa !9
  br label %142

139:                                              ; preds = %125
  %140 = getelementptr inbounds %struct.ImFont, ptr %26, i32 0, i32 1
  %141 = load float, ptr %140, align 8, !tbaa !31
  br label %142

142:                                              ; preds = %139, %131
  %143 = phi float [ %138, %131 ], [ %141, %139 ]
  %144 = load float, ptr %17, align 4, !tbaa !9
  %145 = fmul float %143, %144
  store float %145, ptr %25, align 4, !tbaa !9
  %146 = load float, ptr %18, align 4, !tbaa !9
  %147 = load float, ptr %25, align 4, !tbaa !9
  %148 = fadd float %146, %147
  %149 = load float, ptr %11, align 4, !tbaa !9
  %150 = fcmp oge float %148, %149
  br i1 %150, label %151, label %153

151:                                              ; preds = %142
  %152 = load ptr, ptr %22, align 8, !tbaa !5
  store ptr %152, ptr %21, align 8, !tbaa !5
  store i32 3, ptr %24, align 4
  br label %157

153:                                              ; preds = %142
  %154 = load float, ptr %25, align 4, !tbaa !9
  %155 = load float, ptr %18, align 4, !tbaa !9
  %156 = fadd float %155, %154
  store float %156, ptr %18, align 4, !tbaa !9
  store i32 0, ptr %24, align 4
  br label %157

157:                                              ; preds = %153, %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #9
  br label %158

158:                                              ; preds = %157, %123, %110, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  %159 = load i32, ptr %24, align 4
  switch i32 %159, label %189 [
    i32 0, label %160
    i32 3, label %161
    i32 2, label %44
  ]

160:                                              ; preds = %158
  br label %44, !llvm.loop !25

161:                                              ; preds = %158, %44
  %162 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 0
  %163 = load float, ptr %162, align 4, !tbaa !22
  %164 = load float, ptr %18, align 4, !tbaa !9
  %165 = fcmp olt float %163, %164
  br i1 %165, label %166, label %169

166:                                              ; preds = %161
  %167 = load float, ptr %18, align 4, !tbaa !9
  %168 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 0
  store float %167, ptr %168, align 4, !tbaa !22
  br label %169

169:                                              ; preds = %166, %161
  %170 = load float, ptr %18, align 4, !tbaa !9
  %171 = fcmp ogt float %170, 0.000000e+00
  br i1 %171, label %176, label %172

172:                                              ; preds = %169
  %173 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 1
  %174 = load float, ptr %173, align 4, !tbaa !24
  %175 = fcmp oeq float %174, 0.000000e+00
  br i1 %175, label %176, label %181

176:                                              ; preds = %172, %169
  %177 = load float, ptr %16, align 4, !tbaa !9
  %178 = getelementptr inbounds %struct.ImVec2, ptr %8, i32 0, i32 1
  %179 = load float, ptr %178, align 4, !tbaa !24
  %180 = fadd float %179, %177
  store float %180, ptr %178, align 4, !tbaa !24
  br label %181

181:                                              ; preds = %176, %172
  %182 = load ptr, ptr %15, align 8, !tbaa !5
  %183 = icmp ne ptr %182, null
  br i1 %183, label %184, label %187

184:                                              ; preds = %181
  %185 = load ptr, ptr %21, align 8, !tbaa !5
  %186 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %185, ptr %186, align 8, !tbaa !5
  br label %187

187:                                              ; preds = %184, %181
  store i32 1, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  %188 = load <2 x float>, ptr %8, align 4
  ret <2 x float> %188

189:                                              ; preds = %158
  unreachable
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef ptr @_ZL26CalcWordWrapNextLineStartAPKcS0_(ptr noundef, ptr noundef) #7

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 = { 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 #3 = { 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 #4 = { "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 = { 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 #7 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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 20}
!12 = !{!"_ZTS6ImFont", !13, i64 0, !10, i64 16, !10, i64 20, !15, i64 24, !16, i64 40, !6, i64 56, !6, i64 64, !6, i64 72, !17, i64 80, !17, i64 82, !17, i64 84, !17, i64 86, !18, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !14, i64 104, !7, i64 108}
!13 = !{!"_ZTS8ImVectorIfE", !14, i64 0, !14, i64 4, !6, i64 8}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTS8ImVectorItE", !14, i64 0, !14, i64 4, !6, i64 8}
!16 = !{!"_ZTS8ImVectorI11ImFontGlyphE", !14, i64 0, !14, i64 4, !6, i64 8}
!17 = !{!"short", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!18, !18, i64 0}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!23, !10, i64 0}
!23 = !{!"_ZTS6ImVec2", !10, i64 0, !10, i64 4}
!24 = !{!23, !10, i64 4}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!7, !7, i64 0}
!28 = !{!14, !14, i64 0}
!29 = !{!12, !14, i64 0}
!30 = !{!12, !6, i64 8}
!31 = !{!12, !10, i64 16}


; 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 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 @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #1 align 2

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

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

declare noundef i32 @_Z18ImTextCharFromUtf8PjPKcS1_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
define dso_local <2 x float> @_ZNK6ImFont13CalcTextSizeAEfffPKcS1_PS1_(ptr noundef nonnull align 8 dereferenceable(110) %0, float noundef %1, float noundef %2, float noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef writeonly %6) local_unnamed_addr #6 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) #8
  %12 = getelementptr inbounds i8, ptr %4, i64 %11
  br label %13

13:                                               ; preds = %10, %7
  %.0 = phi ptr [ %5, %7 ], [ %12, %10 ]
  %14 = getelementptr inbounds i8, ptr %0, i64 20
  %15 = load float, ptr %14, align 4, !tbaa !5
  %16 = fdiv float %1, %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 %.loopexit

.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 8
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  br i1 %18, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.backedge.us
  %.04975.us = phi float [ %.049.be.us, %.backedge.us ], [ 0.000000e+00, %.lr.ph ]
  %.05174.us = phi ptr [ %.051.be.us, %.backedge.us ], [ %4, %.lr.ph ]
  %.05573.us = phi ptr [ %.055.be.us, %.backedge.us ], [ null, %.lr.ph ]
  %.not64.us = icmp eq ptr %.05573.us, null
  br i1 %.not64.us, label %22, label %25

22:                                               ; preds = %.lr.ph.split.us
  %23 = fsub float %3, %.04975.us
  %24 = call noundef ptr @_ZNK6ImFont21CalcWordWrapPositionAEfPKcS1_f(ptr noundef nonnull align 8 dereferenceable(110) %0, float noundef %16, ptr noundef %.05174.us, ptr noundef nonnull %.0, float noundef %23)
  br label %25

25:                                               ; preds = %22, %.lr.ph.split.us
  %.156.us = phi ptr [ %.05573.us, %.lr.ph.split.us ], [ %24, %22 ]
  %.not65.us = icmp ult ptr %.05174.us, %.156.us
  br i1 %.not65.us, label %34, label %26

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

29:                                               ; preds = %26
  store float %.04975.us, ptr %8, align 8, !tbaa !17
  br label %30

30:                                               ; preds = %29, %26
  %31 = load float, ptr %19, align 4, !tbaa !19
  %32 = fadd float %31, %1
  store float %32, ptr %19, align 4, !tbaa !19
  %33 = call noundef ptr @_ZL26CalcWordWrapNextLineStartAPKcS0_(ptr noundef %.05174.us, ptr noundef nonnull %.0)
  br label %.backedge.us

34:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  %35 = load i8, ptr %.05174.us, align 1, !tbaa !20
  %36 = sext i8 %35 to i32
  store i32 %36, ptr %9, align 4, !tbaa !21
  %37 = icmp sgt i8 %35, -1
  br i1 %37, label %44, label %38

38:                                               ; preds = %34
  %39 = call noundef i32 @_Z18ImTextCharFromUtf8PjPKcS1_(ptr noundef nonnull %9, ptr noundef nonnull %.05174.us, ptr noundef nonnull %.0)
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i8, ptr %.05174.us, i64 %40
  %42 = load i32, ptr %9, align 4, !tbaa !21
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %.thread, label %46

44:                                               ; preds = %34
  %45 = getelementptr inbounds i8, ptr %.05174.us, i64 1
  br label %46

46:                                               ; preds = %44, %38
  %47 = phi i32 [ %42, %38 ], [ %36, %44 ]
  %.152.us = phi ptr [ %41, %38 ], [ %45, %44 ]
  %48 = icmp ult i32 %47, 32
  br i1 %48, label %49, label %55

49:                                               ; preds = %46
  switch i32 %47, label %55 [
    i32 10, label %50
    i32 13, label %.thread91
  ], !llvm.loop !22

50:                                               ; preds = %49
  %51 = load float, ptr %8, align 8, !tbaa !17
  %52 = call noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef %51, float noundef %.04975.us)
  store float %52, ptr %8, align 8, !tbaa !17
  %53 = load float, ptr %19, align 4, !tbaa !19
  %54 = fadd float %53, %1
  store float %54, ptr %19, align 4, !tbaa !19
  br label %.thread91, !llvm.loop !22

55:                                               ; preds = %49, %46
  %56 = load i32, ptr %0, align 8, !tbaa !24
  %57 = icmp slt i32 %47, %56
  %58 = load ptr, ptr %20, align 8
  %59 = zext i32 %47 to i64
  %60 = getelementptr inbounds float, ptr %58, i64 %59
  %.in.us = select i1 %57, ptr %60, ptr %21
  %61 = load float, ptr %.in.us, align 4, !tbaa !25
  %62 = fmul float %16, %61
  %63 = fadd float %.04975.us, %62
  %64 = fcmp ult float %63, %2
  br i1 %64, label %.thread91, label %65

.thread91:                                        ; preds = %50, %49, %55
  %.2.us.ph = phi float [ %.04975.us, %49 ], [ 0.000000e+00, %50 ], [ %63, %55 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  br label %.backedge.us

65:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  br label %.loopexit

.backedge.us:                                     ; preds = %.thread91, %30
  %.055.be.us = phi ptr [ null, %30 ], [ %.156.us, %.thread91 ]
  %.051.be.us = phi ptr [ %33, %30 ], [ %.152.us, %.thread91 ]
  %.049.be.us = phi float [ 0.000000e+00, %30 ], [ %.2.us.ph, %.thread91 ]
  %66 = icmp ult ptr %.051.be.us, %.0
  br i1 %66, label %.lr.ph.split.us, label %.loopexit, !llvm.loop !22

.lr.ph.split:                                     ; preds = %.lr.ph, %97
  %.04975 = phi float [ %.2, %97 ], [ 0.000000e+00, %.lr.ph ]
  %.05174 = phi ptr [ %.354, %97 ], [ %4, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  %67 = load i8, ptr %.05174, align 1, !tbaa !20
  %68 = sext i8 %67 to i32
  store i32 %68, ptr %9, align 4, !tbaa !21
  %69 = icmp sgt i8 %67, -1
  br i1 %69, label %70, label %72

70:                                               ; preds = %.lr.ph.split
  %71 = getelementptr inbounds i8, ptr %.05174, i64 1
  br label %78

72:                                               ; preds = %.lr.ph.split
  %73 = call noundef i32 @_Z18ImTextCharFromUtf8PjPKcS1_(ptr noundef nonnull %9, ptr noundef nonnull %.05174, ptr noundef nonnull %.0)
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %.05174, i64 %74
  %76 = load i32, ptr %9, align 4, !tbaa !21
  %77 = icmp eq i32 %76, 0
  br i1 %77, label %.thread, label %78

.thread:                                          ; preds = %72, %38
  %.us-phi = phi float [ %.04975.us, %38 ], [ %.04975, %72 ]
  %.us-phi80 = phi ptr [ %41, %38 ], [ %75, %72 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  br label %.loopexit

78:                                               ; preds = %72, %70
  %79 = phi i32 [ %76, %72 ], [ %68, %70 ]
  %.152 = phi ptr [ %75, %72 ], [ %71, %70 ]
  %80 = icmp ult i32 %79, 32
  br i1 %80, label %81, label %87

81:                                               ; preds = %78
  switch i32 %79, label %87 [
    i32 10, label %82
    i32 13, label %97
  ], !llvm.loop !22

82:                                               ; preds = %81
  %83 = load float, ptr %8, align 8, !tbaa !17
  %84 = call noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef %83, float noundef %.04975)
  store float %84, ptr %8, align 8, !tbaa !17
  %85 = load float, ptr %19, align 4, !tbaa !19
  %86 = fadd float %85, %1
  store float %86, ptr %19, align 4, !tbaa !19
  br label %97, !llvm.loop !22

87:                                               ; preds = %81, %78
  %88 = load i32, ptr %0, align 8, !tbaa !24
  %89 = icmp slt i32 %79, %88
  %90 = load ptr, ptr %20, align 8
  %91 = zext i32 %79 to i64
  %92 = getelementptr inbounds float, ptr %90, i64 %91
  %.in = select i1 %89, ptr %92, ptr %21
  %93 = load float, ptr %.in, align 4, !tbaa !25
  %94 = fmul float %16, %93
  %95 = fadd float %.04975, %94
  %96 = fcmp ult float %95, %2
  %.253 = select i1 %96, ptr %.152, ptr %.05174
  %.150 = select i1 %96, float %95, float %.04975
  br label %97

97:                                               ; preds = %81, %87, %82
  %.354 = phi ptr [ %.152, %82 ], [ %.253, %87 ], [ %.152, %81 ]
  %.2 = phi float [ 0.000000e+00, %82 ], [ %.150, %87 ], [ %.04975, %81 ]
  %.1 = phi i1 [ true, %82 ], [ %96, %87 ], [ true, %81 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  %98 = icmp ult ptr %.354, %.0
  %or.cond85 = select i1 %.1, i1 %98, i1 false
  br i1 %or.cond85, label %.lr.ph.split, label %.loopexit, !llvm.loop !22

.loopexit:                                        ; preds = %97, %.backedge.us, %65, %13, %.thread
  %.4 = phi ptr [ %.us-phi80, %.thread ], [ %4, %13 ], [ %.05174.us, %65 ], [ %.051.be.us, %.backedge.us ], [ %.354, %97 ]
  %.3 = phi float [ %.us-phi, %.thread ], [ 0.000000e+00, %13 ], [ %.04975.us, %65 ], [ %.049.be.us, %.backedge.us ], [ %.2, %97 ]
  %99 = load float, ptr %8, align 8, !tbaa !17
  %100 = fcmp olt float %99, %.3
  br i1 %100, label %101, label %102

101:                                              ; preds = %.loopexit
  store float %.3, ptr %8, align 8, !tbaa !17
  br label %102

102:                                              ; preds = %101, %.loopexit
  %103 = fcmp ogt float %.3, 0.000000e+00
  %104 = getelementptr inbounds i8, ptr %8, i64 4
  %105 = load float, ptr %104, align 4
  %106 = fcmp oeq float %105, 0.000000e+00
  %or.cond = select i1 %103, i1 true, i1 %106
  br i1 %or.cond, label %107, label %109

107:                                              ; preds = %102
  %108 = fadd float %105, %1
  store float %108, ptr %104, align 4, !tbaa !19
  br label %109

109:                                              ; preds = %102, %107
  %.not66 = icmp eq ptr %6, null
  br i1 %.not66, label %111, label %110

110:                                              ; preds = %109
  store ptr %.4, ptr %6, align 8, !tbaa !26
  br label %111

111:                                              ; preds = %110, %109
  %112 = load <2 x float>, ptr %8, align 8
  ret <2 x float> %112
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef ptr @_ZL26CalcWordWrapNextLineStartAPKcS0_(ptr noundef, ptr noundef) local_unnamed_addr #7

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 = { 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 #3 = { 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 #4 = { "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 = { 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 #7 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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 20}
!6 = !{!"_ZTS6ImFont", !7, i64 0, !12, i64 16, !12, i64 20, !13, i64 24, !14, i64 40, !11, i64 56, !11, i64 64, !11, i64 72, !15, i64 80, !15, i64 82, !15, i64 84, !15, i64 86, !16, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !8, i64 104, !9, i64 108}
!7 = !{!"_ZTS8ImVectorIfE", !8, i64 0, !8, i64 4, !11, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"float", !9, i64 0}
!13 = !{!"_ZTS8ImVectorItE", !8, i64 0, !8, i64 4, !11, i64 8}
!14 = !{!"_ZTS8ImVectorI11ImFontGlyphE", !8, i64 0, !8, i64 4, !11, i64 8}
!15 = !{!"short", !9, i64 0}
!16 = !{!"bool", !9, i64 0}
!17 = !{!18, !12, i64 0}
!18 = !{!"_ZTS6ImVec2", !12, i64 0, !12, i64 4}
!19 = !{!18, !12, i64 4}
!20 = !{!9, !9, i64 0}
!21 = !{!8, !8, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!6, !8, i64 0}
!25 = !{!12, !12, i64 0}
!26 = !{!11, !11, 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