; LLVM IR from erwincoumans/tiny-differentiable-simulator :: src/visualizer/opengl (tiny_font_stash)

; 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.stbtt_fontinfo = type { ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.stbtt_bakedchar = type { i16, i16, i16, i16, float, float, float }

@.str.10 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__.stbtt_BakeFontBitmap = external hidden unnamed_addr constant [116 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [12 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 uwtable
declare dso_local i32 @stbtt_InitFont(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local i32 @stbtt_FindGlyphIndex(ptr noundef, i32 noundef) #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @stbtt_GetGlyphHMetrics(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local float @stbtt_ScaleForPixelHeight(ptr noundef, float noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @stbtt_GetGlyphBitmapBox(ptr noundef, i32 noundef, float noundef, float noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @stbtt_MakeGlyphBitmap(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, float noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local i32 @stbtt_BakeFontBitmap(ptr noundef %0, i32 noundef %1, float noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, ptr noundef %8) #1 {
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca float, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %struct.stbtt_fontinfo, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  store ptr %0, ptr %11, align 8, !tbaa !5
  store i32 %1, ptr %12, align 4, !tbaa !9
  store float %2, ptr %13, align 4, !tbaa !11
  store ptr %3, ptr %14, align 8, !tbaa !5
  store i32 %4, ptr %15, align 4, !tbaa !9
  store i32 %5, ptr %16, align 4, !tbaa !9
  store i32 %6, ptr %17, align 4, !tbaa !9
  store i32 %7, ptr %18, align 4, !tbaa !9
  store ptr %8, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 56, ptr %25) #4
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  %37 = load i32, ptr %12, align 4, !tbaa !9
  %38 = call i32 @stbtt_InitFont(ptr noundef %25, ptr noundef %36, i32 noundef %37)
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %41, label %40

40:                                               ; preds = %9
  store i32 -1, ptr %10, align 4
  store i32 1, ptr %26, align 4
  br label %199

41:                                               ; preds = %9
  %42 = load ptr, ptr %14, align 8, !tbaa !5
  %43 = load i32, ptr %15, align 4, !tbaa !9
  %44 = load i32, ptr %16, align 4, !tbaa !9
  %45 = mul nsw i32 %43, %44
  %46 = sext i32 %45 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %42, i8 0, i64 %46, i1 false)
  store i32 1, ptr %22, align 4, !tbaa !9
  store i32 1, ptr %21, align 4, !tbaa !9
  store i32 1, ptr %23, align 4, !tbaa !9
  %47 = load float, ptr %13, align 4, !tbaa !11
  %48 = call float @stbtt_ScaleForPixelHeight(ptr noundef %25, float noundef %47)
  store float %48, ptr %20, align 4, !tbaa !11
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %194, %41
  %50 = load i32, ptr %24, align 4, !tbaa !9
  %51 = load i32, ptr %18, align 4, !tbaa !9
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %53, label %197

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #4
  %54 = load i32, ptr %17, align 4, !tbaa !9
  %55 = load i32, ptr %24, align 4, !tbaa !9
  %56 = add nsw i32 %54, %55
  %57 = call i32 @stbtt_FindGlyphIndex(ptr noundef %25, i32 noundef %56)
  store i32 %57, ptr %35, align 4, !tbaa !9
  %58 = load i32, ptr %35, align 4, !tbaa !9
  call void @stbtt_GetGlyphHMetrics(ptr noundef %25, i32 noundef %58, ptr noundef %27, ptr noundef %28)
  %59 = load i32, ptr %35, align 4, !tbaa !9
  %60 = load float, ptr %20, align 4, !tbaa !11
  %61 = load float, ptr %20, align 4, !tbaa !11
  call void @stbtt_GetGlyphBitmapBox(ptr noundef %25, i32 noundef %59, float noundef %60, float noundef %61, ptr noundef %29, ptr noundef %30, ptr noundef %31, ptr noundef %32)
  %62 = load i32, ptr %31, align 4, !tbaa !9
  %63 = load i32, ptr %29, align 4, !tbaa !9
  %64 = sub nsw i32 %62, %63
  store i32 %64, ptr %33, align 4, !tbaa !9
  %65 = load i32, ptr %32, align 4, !tbaa !9
  %66 = load i32, ptr %30, align 4, !tbaa !9
  %67 = sub nsw i32 %65, %66
  store i32 %67, ptr %34, align 4, !tbaa !9
  %68 = load i32, ptr %21, align 4, !tbaa !9
  %69 = load i32, ptr %33, align 4, !tbaa !9
  %70 = add nsw i32 %68, %69
  %71 = add nsw i32 %70, 1
  %72 = load i32, ptr %15, align 4, !tbaa !9
  %73 = icmp sge i32 %71, %72
  br i1 %73, label %74, label %76

74:                                               ; preds = %53
  %75 = load i32, ptr %23, align 4, !tbaa !9
  store i32 %75, ptr %22, align 4, !tbaa !9
  store i32 1, ptr %21, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %74, %53
  %77 = load i32, ptr %22, align 4, !tbaa !9
  %78 = load i32, ptr %34, align 4, !tbaa !9
  %79 = add nsw i32 %77, %78
  %80 = add nsw i32 %79, 1
  %81 = load i32, ptr %16, align 4, !tbaa !9
  %82 = icmp sge i32 %80, %81
  br i1 %82, label %83, label %86

83:                                               ; preds = %76
  %84 = load i32, ptr %24, align 4, !tbaa !9
  %85 = sub nsw i32 0, %84
  store i32 %85, ptr %10, align 4
  store i32 1, ptr %26, align 4
  br label %191

86:                                               ; preds = %76
  %87 = load i32, ptr %21, align 4, !tbaa !9
  %88 = load i32, ptr %33, align 4, !tbaa !9
  %89 = add nsw i32 %87, %88
  %90 = load i32, ptr %15, align 4, !tbaa !9
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %92, label %93

92:                                               ; preds = %86
  br label %95

93:                                               ; preds = %86
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.10, i32 noundef 2711, ptr noundef @__PRETTY_FUNCTION__.stbtt_BakeFontBitmap) #5
  unreachable

94:                                               ; No predecessors!
  br label %95

95:                                               ; preds = %94, %92
  %96 = load i32, ptr %22, align 4, !tbaa !9
  %97 = load i32, ptr %34, align 4, !tbaa !9
  %98 = add nsw i32 %96, %97
  %99 = load i32, ptr %16, align 4, !tbaa !9
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %101, label %102

101:                                              ; preds = %95
  br label %104

102:                                              ; preds = %95
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.10, i32 noundef 2712, ptr noundef @__PRETTY_FUNCTION__.stbtt_BakeFontBitmap) #5
  unreachable

103:                                              ; No predecessors!
  br label %104

104:                                              ; preds = %103, %101
  %105 = load ptr, ptr %14, align 8, !tbaa !5
  %106 = load i32, ptr %21, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i8, ptr %105, i64 %107
  %109 = load i32, ptr %22, align 4, !tbaa !9
  %110 = load i32, ptr %15, align 4, !tbaa !9
  %111 = mul nsw i32 %109, %110
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i8, ptr %108, i64 %112
  %114 = load i32, ptr %33, align 4, !tbaa !9
  %115 = load i32, ptr %34, align 4, !tbaa !9
  %116 = load i32, ptr %15, align 4, !tbaa !9
  %117 = load float, ptr %20, align 4, !tbaa !11
  %118 = load float, ptr %20, align 4, !tbaa !11
  %119 = load i32, ptr %35, align 4, !tbaa !9
  call void @stbtt_MakeGlyphBitmap(ptr noundef %25, ptr noundef %113, i32 noundef %114, i32 noundef %115, i32 noundef %116, float noundef %117, float noundef %118, i32 noundef %119)
  %120 = load i32, ptr %21, align 4, !tbaa !9
  %121 = trunc i32 %120 to i16
  %122 = load ptr, ptr %19, align 8, !tbaa !5
  %123 = load i32, ptr %24, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %122, i64 %124
  %126 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %125, i32 0, i32 0
  store i16 %121, ptr %126, align 4, !tbaa !13
  %127 = load i32, ptr %22, align 4, !tbaa !9
  %128 = trunc i32 %127 to i16
  %129 = load ptr, ptr %19, align 8, !tbaa !5
  %130 = load i32, ptr %24, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %129, i64 %131
  %133 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %132, i32 0, i32 1
  store i16 %128, ptr %133, align 2, !tbaa !16
  %134 = load i32, ptr %21, align 4, !tbaa !9
  %135 = load i32, ptr %33, align 4, !tbaa !9
  %136 = add nsw i32 %134, %135
  %137 = trunc i32 %136 to i16
  %138 = load ptr, ptr %19, align 8, !tbaa !5
  %139 = load i32, ptr %24, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %138, i64 %140
  %142 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %141, i32 0, i32 2
  store i16 %137, ptr %142, align 4, !tbaa !17
  %143 = load i32, ptr %22, align 4, !tbaa !9
  %144 = load i32, ptr %34, align 4, !tbaa !9
  %145 = add nsw i32 %143, %144
  %146 = trunc i32 %145 to i16
  %147 = load ptr, ptr %19, align 8, !tbaa !5
  %148 = load i32, ptr %24, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %147, i64 %149
  %151 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %150, i32 0, i32 3
  store i16 %146, ptr %151, align 2, !tbaa !18
  %152 = load float, ptr %20, align 4, !tbaa !11
  %153 = load i32, ptr %27, align 4, !tbaa !9
  %154 = sitofp i32 %153 to float
  %155 = fmul float %152, %154
  %156 = load ptr, ptr %19, align 8, !tbaa !5
  %157 = load i32, ptr %24, align 4, !tbaa !9
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %156, i64 %158
  %160 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %159, i32 0, i32 6
  store float %155, ptr %160, align 4, !tbaa !19
  %161 = load i32, ptr %29, align 4, !tbaa !9
  %162 = sitofp i32 %161 to float
  %163 = load ptr, ptr %19, align 8, !tbaa !5
  %164 = load i32, ptr %24, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %163, i64 %165
  %167 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %166, i32 0, i32 4
  store float %162, ptr %167, align 4, !tbaa !20
  %168 = load i32, ptr %30, align 4, !tbaa !9
  %169 = sitofp i32 %168 to float
  %170 = load ptr, ptr %19, align 8, !tbaa !5
  %171 = load i32, ptr %24, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %170, i64 %172
  %174 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %173, i32 0, i32 5
  store float %169, ptr %174, align 4, !tbaa !21
  %175 = load i32, ptr %21, align 4, !tbaa !9
  %176 = load i32, ptr %33, align 4, !tbaa !9
  %177 = add nsw i32 %175, %176
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %21, align 4, !tbaa !9
  %179 = load i32, ptr %22, align 4, !tbaa !9
  %180 = load i32, ptr %34, align 4, !tbaa !9
  %181 = add nsw i32 %179, %180
  %182 = add nsw i32 %181, 1
  %183 = load i32, ptr %23, align 4, !tbaa !9
  %184 = icmp sgt i32 %182, %183
  br i1 %184, label %185, label %190

185:                                              ; preds = %104
  %186 = load i32, ptr %22, align 4, !tbaa !9
  %187 = load i32, ptr %34, align 4, !tbaa !9
  %188 = add nsw i32 %186, %187
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %23, align 4, !tbaa !9
  br label %190

190:                                              ; preds = %185, %104
  store i32 0, ptr %26, align 4
  br label %191

191:                                              ; preds = %190, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  %192 = load i32, ptr %26, align 4
  switch i32 %192, label %199 [
    i32 0, label %193
  ]

193:                                              ; preds = %191
  br label %194

194:                                              ; preds = %193
  %195 = load i32, ptr %24, align 4, !tbaa !9
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %24, align 4, !tbaa !9
  br label %49, !llvm.loop !22

197:                                              ; preds = %49
  %198 = load i32, ptr %23, align 4, !tbaa !9
  store i32 %198, ptr %10, align 4
  store i32 1, ptr %26, align 4
  br label %199

199:                                              ; preds = %197, %191, %40
  call void @llvm.lifetime.end.p0(i64 56, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  %200 = load i32, ptr %10, align 4
  ret i32 %200
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
attributes #5 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTS15stbtt_bakedchar", !15, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !12, i64 8, !12, i64 12, !12, i64 16}
!15 = !{!"short", !7, i64 0}
!16 = !{!14, !15, i64 2}
!17 = !{!14, !15, i64 4}
!18 = !{!14, !15, i64 6}
!19 = !{!14, !12, i64 16}
!20 = !{!14, !12, i64 8}
!21 = !{!14, !12, i64 12}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


; 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.stbtt_fontinfo = type { ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.stbtt_bakedchar = type { i16, i16, i16, i16, float, float, float }

@.str.10 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__.stbtt_BakeFontBitmap = external hidden unnamed_addr constant [116 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 uwtable
declare dso_local i32 @stbtt_InitFont(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local i32 @stbtt_FindGlyphIndex(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @stbtt_GetGlyphHMetrics(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local float @stbtt_ScaleForPixelHeight(ptr noundef, float noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @stbtt_GetGlyphBitmapBox(ptr noundef, i32 noundef, float noundef, float noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @stbtt_MakeGlyphBitmap(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, float noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local i32 @stbtt_BakeFontBitmap(ptr noundef %0, i32 noundef %1, float noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, ptr nocapture noundef writeonly %8) local_unnamed_addr #1 {
  %10 = alloca %struct.stbtt_fontinfo, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %10) #4
  %17 = call i32 @stbtt_InitFont(ptr noundef nonnull %10, ptr noundef %0, i32 noundef %1)
  %.not = icmp eq i32 %17, 0
  br i1 %.not, label %.loopexit, label %18

18:                                               ; preds = %9
  %19 = mul nsw i32 %5, %4
  %20 = sext i32 %19 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %3, i8 0, i64 %20, i1 false)
  %21 = call float @stbtt_ScaleForPixelHeight(ptr noundef nonnull %10, float noundef %2)
  %22 = icmp sgt i32 %7, 0
  br i1 %22, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %18
  %wide.trip.count = zext nneg i32 %7 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %43
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %43 ]
  %.069102 = phi i32 [ 1, %.lr.ph.preheader ], [ %67, %43 ]
  %.072101 = phi i32 [ 1, %.lr.ph.preheader ], [ %spec.select, %43 ]
  %.07699 = phi i32 [ 1, %.lr.ph.preheader ], [ %spec.select88, %43 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #4
  %23 = trunc i64 %indvars.iv to i32
  %24 = add i32 %23, %6
  %25 = call i32 @stbtt_FindGlyphIndex(ptr noundef nonnull %10, i32 noundef %24)
  call void @stbtt_GetGlyphHMetrics(ptr noundef nonnull %10, i32 noundef %25, ptr noundef nonnull %11, ptr noundef nonnull %12)
  call void @stbtt_GetGlyphBitmapBox(ptr noundef nonnull %10, i32 noundef %25, float noundef %21, float noundef %21, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef nonnull %15, ptr noundef nonnull %16)
  %26 = load i32, ptr %15, align 4, !tbaa !5
  %27 = load i32, ptr %13, align 4, !tbaa !5
  %28 = sub nsw i32 %26, %27
  %29 = load i32, ptr %16, align 4, !tbaa !5
  %30 = load i32, ptr %14, align 4, !tbaa !5
  %31 = sub nsw i32 %29, %30
  %32 = add i32 %.069102, 1
  %33 = add i32 %32, %28
  %.not84 = icmp slt i32 %33, %4
  %spec.select = select i1 %.not84, i32 %.072101, i32 %.07699
  %spec.select87 = select i1 %.not84, i32 %.069102, i32 1
  %34 = add nsw i32 %spec.select, %31
  %35 = add nsw i32 %34, 1
  %.not85 = icmp slt i32 %35, %5
  br i1 %.not85, label %36, label %40

36:                                               ; preds = %.lr.ph
  %37 = add nsw i32 %spec.select87, %28
  %38 = icmp slt i32 %37, %4
  br i1 %38, label %43, label %39

39:                                               ; preds = %36
  call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.10, i32 noundef 2711, ptr noundef nonnull @__PRETTY_FUNCTION__.stbtt_BakeFontBitmap) #5
  unreachable

40:                                               ; preds = %.lr.ph
  %41 = trunc nuw nsw i64 %indvars.iv to i32
  %42 = sub nsw i32 0, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  br label %.loopexit

43:                                               ; preds = %36
  %44 = sext i32 %spec.select87 to i64
  %45 = getelementptr inbounds i8, ptr %3, i64 %44
  %46 = mul nsw i32 %spec.select, %4
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i8, ptr %45, i64 %47
  call void @stbtt_MakeGlyphBitmap(ptr noundef nonnull %10, ptr noundef %48, i32 noundef %28, i32 noundef %31, i32 noundef %4, float noundef %21, float noundef %21, i32 noundef %25)
  %49 = trunc i32 %spec.select87 to i16
  %50 = getelementptr inbounds %struct.stbtt_bakedchar, ptr %8, i64 %indvars.iv
  store i16 %49, ptr %50, align 4, !tbaa !9
  %51 = trunc i32 %spec.select to i16
  %52 = getelementptr inbounds i8, ptr %50, i64 2
  store i16 %51, ptr %52, align 2, !tbaa !13
  %53 = trunc i32 %37 to i16
  %54 = getelementptr inbounds i8, ptr %50, i64 4
  store i16 %53, ptr %54, align 4, !tbaa !14
  %55 = trunc i32 %34 to i16
  %56 = getelementptr inbounds i8, ptr %50, i64 6
  store i16 %55, ptr %56, align 2, !tbaa !15
  %57 = load i32, ptr %11, align 4, !tbaa !5
  %58 = sitofp i32 %57 to float
  %59 = fmul float %21, %58
  %60 = getelementptr inbounds i8, ptr %50, i64 16
  store float %59, ptr %60, align 4, !tbaa !16
  %61 = load i32, ptr %13, align 4, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %50, i64 8
  %63 = load i32, ptr %14, align 4, !tbaa !5
  %64 = insertelement <2 x i32> poison, i32 %61, i64 0
  %65 = insertelement <2 x i32> %64, i32 %63, i64 1
  %66 = sitofp <2 x i32> %65 to <2 x float>
  store <2 x float> %66, ptr %62, align 4, !tbaa !17
  %67 = add nsw i32 %37, 1
  %.not86 = icmp slt i32 %34, %.07699
  %spec.select88 = select i1 %.not86, i32 %.07699, i32 %35
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !18

.loopexit:                                        ; preds = %43, %18, %40, %9
  %.2 = phi i32 [ %42, %40 ], [ -1, %9 ], [ 1, %18 ], [ %spec.select88, %43 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %10) #4
  ret i32 %.2
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
attributes #5 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS15stbtt_bakedchar", !11, i64 0, !11, i64 2, !11, i64 4, !11, i64 6, !12, i64 8, !12, i64 12, !12, i64 16}
!11 = !{!"short", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!10, !11, i64 2}
!14 = !{!10, !11, i64 4}
!15 = !{!10, !11, i64 6}
!16 = !{!10, !12, i64 16}
!17 = !{!12, !12, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass