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

; 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.sth_quad = type { float, float, float, float, float, float, float, float }
%struct.sth_stash = type { i32, i32, float, float, ptr, ptr, i32, ptr }
%struct.sth_font = type { i32, i32, %struct.stbtt_fontinfo, ptr, ptr, [256 x i32], i32, float, float, float, ptr }
%struct.stbtt_fontinfo = type { ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.sth_glyph = type { i32, i16, ptr, i32, i32, i32, i32, float, float, float, i32 }
%struct.sth_texture = type { %union.anon, ptr, [128 x %struct.sth_row], i32, i32, [2048 x %struct.Vertex], ptr }
%union.anon = type { ptr }
%struct.sth_row = type { i16, i16, i16 }
%struct.Vertex = type { %struct.vec4, %struct.vec4, %struct.vec2 }
%struct.vec4 = type { [4 x float] }
%struct.vec2 = type { [2 x float] }

@_ZL13s_retinaScale = external hidden global float, align 4

; 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 hidden void @_ZL10flush_drawP9sth_stash(ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL9get_glyphP9sth_stashP8sth_fontjs(ptr noundef, ptr noundef, i32 noundef, i16 noundef signext) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15sth_draw_text3DP9sth_stashiffffPKcPffS3_i(ptr noundef %0, i32 noundef %1, float noundef %2, float noundef %3, float noundef %4, float noundef %5, ptr noundef %6, ptr noundef %7, float noundef %8, ptr noundef %9, i32 noundef %10) #1 {
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca float, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca %struct.sth_quad, align 4
  %28 = alloca i16, align 2
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca i32, align 4
  store ptr %0, ptr %12, align 8, !tbaa !5
  store i32 %1, ptr %13, align 4, !tbaa !9
  store float %2, ptr %14, align 4, !tbaa !11
  store float %3, ptr %15, align 4, !tbaa !11
  store float %4, ptr %16, align 4, !tbaa !11
  store float %5, ptr %17, align 4, !tbaa !11
  store ptr %6, ptr %18, align 8, !tbaa !5
  store ptr %7, ptr %19, align 8, !tbaa !5
  store float %8, ptr %20, align 4, !tbaa !11
  store ptr %9, ptr %21, align 8, !tbaa !5
  store i32 %10, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  store ptr null, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  store ptr null, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #3
  store i32 0, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %27) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %28) #3
  %32 = load float, ptr %14, align 4, !tbaa !11
  %33 = fmul float %32, 1.000000e+01
  %34 = fptosi float %33 to i16
  store i16 %34, ptr %28, align 2, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #3
  store ptr null, ptr %30, align 8, !tbaa !5
  store float 1.000000e+00, ptr @_ZL13s_retinaScale, align 4, !tbaa !11
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  %36 = icmp eq ptr %35, null
  br i1 %36, label %37, label %38

37:                                               ; preds = %11
  store i32 1, ptr %31, align 4
  br label %214

38:                                               ; preds = %11
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.sth_stash, ptr %39, i32 0, i32 4
  %41 = load ptr, ptr %40, align 8, !tbaa !15
  %42 = icmp ne ptr %41, null
  br i1 %42, label %44, label %43

43:                                               ; preds = %38
  store i32 1, ptr %31, align 4
  br label %214

44:                                               ; preds = %38
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.sth_stash, ptr %45, i32 0, i32 5
  %47 = load ptr, ptr %46, align 8, !tbaa !17
  store ptr %47, ptr %30, align 8, !tbaa !5
  br label %48

48:                                               ; preds = %59, %44
  %49 = load ptr, ptr %30, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %57

51:                                               ; preds = %48
  %52 = load ptr, ptr %30, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.sth_font, ptr %52, i32 0, i32 0
  %54 = load i32, ptr %53, align 8, !tbaa !18
  %55 = load i32, ptr %13, align 4, !tbaa !9
  %56 = icmp ne i32 %54, %55
  br label %57

57:                                               ; preds = %51, %48
  %58 = phi i1 [ false, %48 ], [ %56, %51 ]
  br i1 %58, label %59, label %63

59:                                               ; preds = %57
  %60 = load ptr, ptr %30, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.sth_font, ptr %60, i32 0, i32 10
  %62 = load ptr, ptr %61, align 8, !tbaa !21
  store ptr %62, ptr %30, align 8, !tbaa !5
  br label %48, !llvm.loop !22

63:                                               ; preds = %57
  %64 = load ptr, ptr %30, align 8, !tbaa !5
  %65 = icmp eq ptr %64, null
  br i1 %65, label %66, label %67

66:                                               ; preds = %63
  store i32 1, ptr %31, align 4
  br label %214

67:                                               ; preds = %63
  %68 = load ptr, ptr %30, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.sth_font, ptr %68, i32 0, i32 1
  %70 = load i32, ptr %69, align 4, !tbaa !24
  %71 = icmp ne i32 %70, 3
  br i1 %71, label %72, label %78

72:                                               ; preds = %67
  %73 = load ptr, ptr %30, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.sth_font, ptr %73, i32 0, i32 3
  %75 = load ptr, ptr %74, align 8, !tbaa !25
  %76 = icmp ne ptr %75, null
  br i1 %76, label %78, label %77

77:                                               ; preds = %72
  store i32 1, ptr %31, align 4
  br label %214

78:                                               ; preds = %72, %67
  br label %79

79:                                               ; preds = %204, %78
  %80 = load ptr, ptr %18, align 8, !tbaa !5
  %81 = load i8, ptr %80, align 1, !tbaa !26
  %82 = icmp ne i8 %81, 0
  br i1 %82, label %83, label %207

83:                                               ; preds = %79
  %84 = load ptr, ptr %18, align 8, !tbaa !5
  %85 = load i8, ptr %84, align 1, !tbaa !26
  %86 = zext i8 %85 to i32
  %87 = call noundef i32 @_ZL7decutf8PjS_j(ptr noundef %26, ptr noundef %23, i32 noundef %86)
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %90

89:                                               ; preds = %83
  br label %204

90:                                               ; preds = %83
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = load ptr, ptr %30, align 8, !tbaa !5
  %93 = load i32, ptr %23, align 4, !tbaa !9
  %94 = load i16, ptr %28, align 2, !tbaa !13
  %95 = call noundef ptr @_ZL9get_glyphP9sth_stashP8sth_fontjs(ptr noundef %91, ptr noundef %92, i32 noundef %93, i16 noundef signext %94)
  store ptr %95, ptr %24, align 8, !tbaa !5
  %96 = load ptr, ptr %24, align 8, !tbaa !5
  %97 = icmp ne ptr %96, null
  br i1 %97, label %99, label %98

98:                                               ; preds = %90
  br label %204

99:                                               ; preds = %90
  %100 = load ptr, ptr %24, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.sth_glyph, ptr %100, i32 0, i32 2
  %102 = load ptr, ptr %101, align 8, !tbaa !27
  store ptr %102, ptr %25, align 8, !tbaa !5
  %103 = load ptr, ptr %25, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.sth_texture, ptr %103, i32 0, i32 4
  %105 = load i32, ptr %104, align 4, !tbaa !29
  %106 = add nsw i32 %105, 6
  %107 = icmp sge i32 %106, 2048
  br i1 %107, label %108, label %110

108:                                              ; preds = %99
  %109 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZL10flush_drawP9sth_stash(ptr noundef %109)
  br label %110

110:                                              ; preds = %108, %99
  %111 = load ptr, ptr %12, align 8, !tbaa !5
  %112 = load ptr, ptr %30, align 8, !tbaa !5
  %113 = load ptr, ptr %24, align 8, !tbaa !5
  %114 = load i16, ptr %28, align 2, !tbaa !13
  %115 = load float, ptr %14, align 4, !tbaa !11
  %116 = load float, ptr %20, align 4, !tbaa !11
  %117 = call noundef i32 @_ZL10get_quad3DP9sth_stashP8sth_fontP9sth_glyphsPfS5_P8sth_quadff(ptr noundef %111, ptr noundef %112, ptr noundef %113, i16 noundef signext %114, ptr noundef %15, ptr noundef %16, ptr noundef %27, float noundef %115, float noundef %116)
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %120, label %119

119:                                              ; preds = %110
  br label %204

120:                                              ; preds = %110
  %121 = load ptr, ptr %25, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.sth_texture, ptr %121, i32 0, i32 5
  %123 = load ptr, ptr %25, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.sth_texture, ptr %123, i32 0, i32 4
  %125 = load i32, ptr %124, align 4, !tbaa !29
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [2048 x %struct.Vertex], ptr %122, i64 0, i64 %126
  store ptr %127, ptr %29, align 8, !tbaa !5
  %128 = load ptr, ptr %29, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 0
  %130 = load float, ptr %129, align 4, !tbaa !31
  %131 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 1
  %132 = load float, ptr %131, align 4, !tbaa !33
  %133 = load float, ptr %17, align 4, !tbaa !11
  %134 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 2
  %135 = load float, ptr %134, align 4, !tbaa !34
  %136 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 3
  %137 = load float, ptr %136, align 4, !tbaa !35
  %138 = load ptr, ptr %21, align 8, !tbaa !5
  %139 = call noundef ptr @_ZL6setv3DP6VertexfffffPf(ptr noundef %128, float noundef %130, float noundef %132, float noundef %133, float noundef %135, float noundef %137, ptr noundef %138)
  store ptr %139, ptr %29, align 8, !tbaa !5
  %140 = load ptr, ptr %29, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 4
  %142 = load float, ptr %141, align 4, !tbaa !36
  %143 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 1
  %144 = load float, ptr %143, align 4, !tbaa !33
  %145 = load float, ptr %17, align 4, !tbaa !11
  %146 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 6
  %147 = load float, ptr %146, align 4, !tbaa !37
  %148 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 3
  %149 = load float, ptr %148, align 4, !tbaa !35
  %150 = load ptr, ptr %21, align 8, !tbaa !5
  %151 = call noundef ptr @_ZL6setv3DP6VertexfffffPf(ptr noundef %140, float noundef %142, float noundef %144, float noundef %145, float noundef %147, float noundef %149, ptr noundef %150)
  store ptr %151, ptr %29, align 8, !tbaa !5
  %152 = load ptr, ptr %29, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 4
  %154 = load float, ptr %153, align 4, !tbaa !36
  %155 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 5
  %156 = load float, ptr %155, align 4, !tbaa !38
  %157 = load float, ptr %17, align 4, !tbaa !11
  %158 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 6
  %159 = load float, ptr %158, align 4, !tbaa !37
  %160 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 7
  %161 = load float, ptr %160, align 4, !tbaa !39
  %162 = load ptr, ptr %21, align 8, !tbaa !5
  %163 = call noundef ptr @_ZL6setv3DP6VertexfffffPf(ptr noundef %152, float noundef %154, float noundef %156, float noundef %157, float noundef %159, float noundef %161, ptr noundef %162)
  store ptr %163, ptr %29, align 8, !tbaa !5
  %164 = load ptr, ptr %29, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 0
  %166 = load float, ptr %165, align 4, !tbaa !31
  %167 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 1
  %168 = load float, ptr %167, align 4, !tbaa !33
  %169 = load float, ptr %17, align 4, !tbaa !11
  %170 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 2
  %171 = load float, ptr %170, align 4, !tbaa !34
  %172 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 3
  %173 = load float, ptr %172, align 4, !tbaa !35
  %174 = load ptr, ptr %21, align 8, !tbaa !5
  %175 = call noundef ptr @_ZL6setv3DP6VertexfffffPf(ptr noundef %164, float noundef %166, float noundef %168, float noundef %169, float noundef %171, float noundef %173, ptr noundef %174)
  store ptr %175, ptr %29, align 8, !tbaa !5
  %176 = load ptr, ptr %29, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 4
  %178 = load float, ptr %177, align 4, !tbaa !36
  %179 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 5
  %180 = load float, ptr %179, align 4, !tbaa !38
  %181 = load float, ptr %17, align 4, !tbaa !11
  %182 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 6
  %183 = load float, ptr %182, align 4, !tbaa !37
  %184 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 7
  %185 = load float, ptr %184, align 4, !tbaa !39
  %186 = load ptr, ptr %21, align 8, !tbaa !5
  %187 = call noundef ptr @_ZL6setv3DP6VertexfffffPf(ptr noundef %176, float noundef %178, float noundef %180, float noundef %181, float noundef %183, float noundef %185, ptr noundef %186)
  store ptr %187, ptr %29, align 8, !tbaa !5
  %188 = load ptr, ptr %29, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 0
  %190 = load float, ptr %189, align 4, !tbaa !31
  %191 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 5
  %192 = load float, ptr %191, align 4, !tbaa !38
  %193 = load float, ptr %17, align 4, !tbaa !11
  %194 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 2
  %195 = load float, ptr %194, align 4, !tbaa !34
  %196 = getelementptr inbounds %struct.sth_quad, ptr %27, i32 0, i32 7
  %197 = load float, ptr %196, align 4, !tbaa !39
  %198 = load ptr, ptr %21, align 8, !tbaa !5
  %199 = call noundef ptr @_ZL6setv3DP6VertexfffffPf(ptr noundef %188, float noundef %190, float noundef %192, float noundef %193, float noundef %195, float noundef %197, ptr noundef %198)
  store ptr %199, ptr %29, align 8, !tbaa !5
  %200 = load ptr, ptr %25, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.sth_texture, ptr %200, i32 0, i32 4
  %202 = load i32, ptr %201, align 4, !tbaa !29
  %203 = add nsw i32 %202, 6
  store i32 %203, ptr %201, align 4, !tbaa !29
  br label %204

204:                                              ; preds = %120, %119, %98, %89
  %205 = load ptr, ptr %18, align 8, !tbaa !5
  %206 = getelementptr inbounds i8, ptr %205, i32 1
  store ptr %206, ptr %18, align 8, !tbaa !5
  br label %79, !llvm.loop !40

207:                                              ; preds = %79
  %208 = load ptr, ptr %19, align 8, !tbaa !5
  %209 = icmp ne ptr %208, null
  br i1 %209, label %210, label %213

210:                                              ; preds = %207
  %211 = load float, ptr %15, align 4, !tbaa !11
  %212 = load ptr, ptr %19, align 8, !tbaa !5
  store float %211, ptr %212, align 4, !tbaa !11
  br label %213

213:                                              ; preds = %210, %207
  store i32 0, ptr %31, align 4
  br label %214

214:                                              ; preds = %213, %77, %66, %43, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  %215 = load i32, ptr %31, align 4
  switch i32 %215, label %217 [
    i32 0, label %216
    i32 1, label %216
  ]

216:                                              ; preds = %214, %214
  ret void

217:                                              ; preds = %214
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL10get_quad3DP9sth_stashP8sth_fontP9sth_glyphsPfS5_P8sth_quadff(ptr noundef, ptr noundef, ptr noundef, i16 noundef signext, ptr noundef, ptr noundef, ptr noundef, float noundef, float noundef) #2

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

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 = { 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 }

!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, !14, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!16, !6, i64 16}
!16 = !{!"_ZTS9sth_stash", !10, i64 0, !10, i64 4, !12, i64 8, !12, i64 12, !6, i64 16, !6, i64 24, !10, i64 32, !6, i64 40}
!17 = !{!16, !6, i64 24}
!18 = !{!19, !10, i64 0}
!19 = !{!"_ZTS8sth_font", !10, i64 0, !10, i64 4, !20, i64 8, !6, i64 64, !6, i64 72, !7, i64 80, !10, i64 1104, !12, i64 1108, !12, i64 1112, !12, i64 1116, !6, i64 1120}
!20 = !{!"_ZTS14stbtt_fontinfo", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52}
!21 = !{!19, !6, i64 1120}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!19, !10, i64 4}
!25 = !{!19, !6, i64 64}
!26 = !{!7, !7, i64 0}
!27 = !{!28, !6, i64 8}
!28 = !{!"_ZTS9sth_glyph", !10, i64 0, !14, i64 4, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !10, i64 44}
!29 = !{!30, !10, i64 788}
!30 = !{!"_ZTS11sth_texture", !7, i64 0, !6, i64 8, !7, i64 16, !10, i64 784, !10, i64 788, !7, i64 792, !6, i64 82712}
!31 = !{!32, !12, i64 0}
!32 = !{!"_ZTS8sth_quad", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!33 = !{!32, !12, i64 4}
!34 = !{!32, !12, i64 8}
!35 = !{!32, !12, i64 12}
!36 = !{!32, !12, i64 16}
!37 = !{!32, !12, i64 24}
!38 = !{!32, !12, i64 20}
!39 = !{!32, !12, i64 28}
!40 = distinct !{!40, !23}


; 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.sth_quad = type { float, float, float, float, float, float, float, float }
%struct.Vertex = type { %struct.vec4, %struct.vec4, %struct.vec2 }
%struct.vec4 = type { [4 x float] }
%struct.vec2 = type { [2 x float] }

@_ZL13s_retinaScale = external hidden local_unnamed_addr global float, align 4

; 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 hidden void @_ZL10flush_drawP9sth_stash(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL9get_glyphP9sth_stashP8sth_fontjs(ptr noundef, ptr noundef, i32 noundef, i16 noundef signext) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15sth_draw_text3DP9sth_stashiffffPKcPffS3_i(ptr noundef %0, i32 noundef %1, float noundef %2, float noundef %3, float noundef %4, float noundef %5, ptr nocapture noundef readonly %6, ptr noundef writeonly %7, float noundef %8, ptr noundef %9, i32 noundef %10) local_unnamed_addr #1 {
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.sth_quad, align 4
  store float %3, ptr %12, align 4, !tbaa !5
  store float %4, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #3
  store i32 0, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %16) #3
  %17 = fmul float %2, 1.000000e+01
  %18 = fptosi float %17 to i16
  store float 1.000000e+00, ptr @_ZL13s_retinaScale, align 4, !tbaa !5
  %19 = icmp eq ptr %0, null
  br i1 %19, label %.loopexit, label %20

20:                                               ; preds = %11
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %.not = icmp eq ptr %22, null
  br i1 %.not, label %.loopexit, label %23

23:                                               ; preds = %20
  %24 = getelementptr inbounds i8, ptr %0, i64 24
  %.064 = load ptr, ptr %24, align 8, !tbaa !14
  %cond65 = icmp eq ptr %.064, null
  br i1 %cond65, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %23, %26
  %.066 = phi ptr [ %.0, %26 ], [ %.064, %23 ]
  %25 = load i32, ptr %.066, align 8, !tbaa !15
  %.not55 = icmp eq i32 %25, %1
  br i1 %.not55, label %.critedge, label %26

26:                                               ; preds = %.lr.ph
  %27 = getelementptr inbounds i8, ptr %.066, i64 1120
  %.0 = load ptr, ptr %27, align 8, !tbaa !14
  %cond = icmp eq ptr %.0, null
  br i1 %cond, label %.loopexit, label %.lr.ph, !llvm.loop !18

.critedge:                                        ; preds = %.lr.ph
  %28 = getelementptr inbounds i8, ptr %.066, i64 4
  %29 = load i32, ptr %28, align 4, !tbaa !20
  %.not56 = icmp eq i32 %29, 3
  br i1 %.not56, label %33, label %30

30:                                               ; preds = %.critedge
  %31 = getelementptr inbounds i8, ptr %.066, i64 64
  %32 = load ptr, ptr %31, align 8, !tbaa !21
  %.not57 = icmp eq ptr %32, null
  br i1 %.not57, label %.loopexit, label %33

33:                                               ; preds = %30, %.critedge
  %34 = load i8, ptr %6, align 1, !tbaa !22
  %.not5867 = icmp eq i8 %34, 0
  br i1 %.not5867, label %._crit_edge, label %.lr.ph69

.lr.ph69:                                         ; preds = %33
  %35 = getelementptr inbounds i8, ptr %16, i64 4
  %36 = getelementptr inbounds i8, ptr %16, i64 8
  %37 = getelementptr inbounds i8, ptr %16, i64 12
  %38 = getelementptr inbounds i8, ptr %16, i64 16
  %39 = getelementptr inbounds i8, ptr %16, i64 24
  %40 = getelementptr inbounds i8, ptr %16, i64 20
  %41 = getelementptr inbounds i8, ptr %16, i64 28
  br label %42

42:                                               ; preds = %.lr.ph69, %95
  %43 = phi i8 [ %34, %.lr.ph69 ], [ %97, %95 ]
  %.04968 = phi ptr [ %6, %.lr.ph69 ], [ %96, %95 ]
  %44 = zext i8 %43 to i32
  %45 = call noundef i32 @_ZL7decutf8PjS_j(ptr noundef nonnull %15, ptr noundef nonnull %14, i32 noundef %44)
  %.not60 = icmp eq i32 %45, 0
  br i1 %.not60, label %46, label %95

46:                                               ; preds = %42
  %47 = load i32, ptr %14, align 4, !tbaa !9
  %48 = call noundef ptr @_ZL9get_glyphP9sth_stashP8sth_fontjs(ptr noundef nonnull %0, ptr noundef nonnull %.066, i32 noundef %47, i16 noundef signext %18)
  %.not61 = icmp eq ptr %48, null
  br i1 %.not61, label %95, label %49

49:                                               ; preds = %46
  %50 = getelementptr inbounds i8, ptr %48, i64 8
  %51 = load ptr, ptr %50, align 8, !tbaa !23
  %52 = getelementptr inbounds i8, ptr %51, i64 788
  %53 = load i32, ptr %52, align 4, !tbaa !26
  %54 = icmp sgt i32 %53, 2041
  br i1 %54, label %55, label %56

55:                                               ; preds = %49
  call void @_ZL10flush_drawP9sth_stash(ptr noundef nonnull %0)
  br label %56

56:                                               ; preds = %55, %49
  %57 = call noundef i32 @_ZL10get_quad3DP9sth_stashP8sth_fontP9sth_glyphsPfS5_P8sth_quadff(ptr noundef nonnull %0, ptr noundef nonnull %.066, ptr noundef nonnull %48, i16 noundef signext %18, ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %16, float noundef %2, float noundef %8)
  %.not62 = icmp eq i32 %57, 0
  br i1 %.not62, label %95, label %58

58:                                               ; preds = %56
  %59 = getelementptr inbounds i8, ptr %51, i64 792
  %60 = load i32, ptr %52, align 4, !tbaa !26
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [2048 x %struct.Vertex], ptr %59, i64 0, i64 %61
  %63 = load float, ptr %16, align 4, !tbaa !28
  %64 = load float, ptr %35, align 4, !tbaa !30
  %65 = load float, ptr %36, align 4, !tbaa !31
  %66 = load float, ptr %37, align 4, !tbaa !32
  %67 = call noundef ptr @_ZL6setv3DP6VertexfffffPf(ptr noundef nonnull %62, float noundef %63, float noundef %64, float noundef %5, float noundef %65, float noundef %66, ptr noundef %9)
  %68 = load float, ptr %38, align 4, !tbaa !33
  %69 = load float, ptr %35, align 4, !tbaa !30
  %70 = load float, ptr %39, align 4, !tbaa !34
  %71 = load float, ptr %37, align 4, !tbaa !32
  %72 = call noundef ptr @_ZL6setv3DP6VertexfffffPf(ptr noundef %67, float noundef %68, float noundef %69, float noundef %5, float noundef %70, float noundef %71, ptr noundef %9)
  %73 = load float, ptr %38, align 4, !tbaa !33
  %74 = load float, ptr %40, align 4, !tbaa !35
  %75 = load float, ptr %39, align 4, !tbaa !34
  %76 = load float, ptr %41, align 4, !tbaa !36
  %77 = call noundef ptr @_ZL6setv3DP6VertexfffffPf(ptr noundef %72, float noundef %73, float noundef %74, float noundef %5, float noundef %75, float noundef %76, ptr noundef %9)
  %78 = load float, ptr %16, align 4, !tbaa !28
  %79 = load float, ptr %35, align 4, !tbaa !30
  %80 = load float, ptr %36, align 4, !tbaa !31
  %81 = load float, ptr %37, align 4, !tbaa !32
  %82 = call noundef ptr @_ZL6setv3DP6VertexfffffPf(ptr noundef %77, float noundef %78, float noundef %79, float noundef %5, float noundef %80, float noundef %81, ptr noundef %9)
  %83 = load float, ptr %38, align 4, !tbaa !33
  %84 = load float, ptr %40, align 4, !tbaa !35
  %85 = load float, ptr %39, align 4, !tbaa !34
  %86 = load float, ptr %41, align 4, !tbaa !36
  %87 = call noundef ptr @_ZL6setv3DP6VertexfffffPf(ptr noundef %82, float noundef %83, float noundef %84, float noundef %5, float noundef %85, float noundef %86, ptr noundef %9)
  %88 = load float, ptr %16, align 4, !tbaa !28
  %89 = load float, ptr %40, align 4, !tbaa !35
  %90 = load float, ptr %36, align 4, !tbaa !31
  %91 = load float, ptr %41, align 4, !tbaa !36
  %92 = call noundef ptr @_ZL6setv3DP6VertexfffffPf(ptr noundef %87, float noundef %88, float noundef %89, float noundef %5, float noundef %90, float noundef %91, ptr noundef %9)
  %93 = load i32, ptr %52, align 4, !tbaa !26
  %94 = add nsw i32 %93, 6
  store i32 %94, ptr %52, align 4, !tbaa !26
  br label %95

95:                                               ; preds = %56, %46, %42, %58
  %96 = getelementptr inbounds i8, ptr %.04968, i64 1
  %97 = load i8, ptr %96, align 1, !tbaa !22
  %.not58 = icmp eq i8 %97, 0
  br i1 %.not58, label %._crit_edge, label %42, !llvm.loop !37

._crit_edge:                                      ; preds = %95, %33
  %.not59 = icmp eq ptr %7, null
  br i1 %.not59, label %.loopexit, label %98

98:                                               ; preds = %._crit_edge
  %99 = load float, ptr %12, align 4, !tbaa !5
  store float %99, ptr %7, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %26, %23, %._crit_edge, %98, %30, %20, %11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #3
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL10get_quad3DP9sth_stashP8sth_fontP9sth_glyphsPfS5_P8sth_quadff(ptr noundef, ptr noundef, ptr noundef, i16 noundef signext, ptr noundef, ptr noundef, ptr noundef, float noundef, float noundef) local_unnamed_addr #2

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

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 = { 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 }

!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 = !{!"float", !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, !13, i64 16}
!12 = !{!"_ZTS9sth_stash", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 12, !13, i64 16, !13, i64 24, !10, i64 32, !13, i64 40}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!16, !10, i64 0}
!16 = !{!"_ZTS8sth_font", !10, i64 0, !10, i64 4, !17, i64 8, !13, i64 64, !13, i64 72, !7, i64 80, !10, i64 1104, !6, i64 1108, !6, i64 1112, !6, i64 1116, !13, i64 1120}
!17 = !{!"_ZTS14stbtt_fontinfo", !13, i64 0, !13, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!16, !10, i64 4}
!21 = !{!16, !13, i64 64}
!22 = !{!7, !7, i64 0}
!23 = !{!24, !13, i64 8}
!24 = !{!"_ZTS9sth_glyph", !10, i64 0, !25, i64 4, !13, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !10, i64 44}
!25 = !{!"short", !7, i64 0}
!26 = !{!27, !10, i64 788}
!27 = !{!"_ZTS11sth_texture", !7, i64 0, !13, i64 8, !7, i64 16, !10, i64 784, !10, i64 788, !7, i64 792, !13, i64 82712}
!28 = !{!29, !6, i64 0}
!29 = !{!"_ZTS8sth_quad", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28}
!30 = !{!29, !6, i64 4}
!31 = !{!29, !6, i64 8}
!32 = !{!29, !6, i64 12}
!33 = !{!29, !6, i64 16}
!34 = !{!29, !6, i64 24}
!35 = !{!29, !6, i64 20}
!36 = !{!29, !6, i64 28}
!37 = distinct !{!37, !19}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass