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

; 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 nounwind uwtable
declare hidden noundef i32 @_ZL8get_quadP9sth_stashP8sth_fontP9sth_glyphsPfS5_P8sth_quad(ptr noundef, ptr noundef, ptr noundef, i16 noundef signext, ptr noundef, ptr noundef, ptr noundef) #2

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

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

40:                                               ; preds = %12
  store i32 1, ptr %33, align 4
  br label %241

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

46:                                               ; preds = %41
  store i32 1, ptr %33, align 4
  br label %241

47:                                               ; preds = %41
  %48 = load ptr, ptr %13, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.sth_stash, ptr %48, i32 0, i32 5
  %50 = load ptr, ptr %49, align 8, !tbaa !17
  store ptr %50, ptr %32, align 8, !tbaa !5
  br label %51

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

54:                                               ; preds = %51
  %55 = load ptr, ptr %32, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.sth_font, ptr %55, i32 0, i32 0
  %57 = load i32, ptr %56, align 8, !tbaa !18
  %58 = load i32, ptr %14, align 4, !tbaa !9
  %59 = icmp ne i32 %57, %58
  br label %60

60:                                               ; preds = %54, %51
  %61 = phi i1 [ false, %51 ], [ %59, %54 ]
  br i1 %61, label %62, label %66

62:                                               ; preds = %60
  %63 = load ptr, ptr %32, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.sth_font, ptr %63, i32 0, i32 10
  %65 = load ptr, ptr %64, align 8, !tbaa !21
  store ptr %65, ptr %32, align 8, !tbaa !5
  br label %51, !llvm.loop !22

66:                                               ; preds = %60
  %67 = load ptr, ptr %32, align 8, !tbaa !5
  %68 = icmp eq ptr %67, null
  br i1 %68, label %69, label %70

69:                                               ; preds = %66
  store i32 1, ptr %33, align 4
  br label %241

70:                                               ; preds = %66
  %71 = load ptr, ptr %32, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.sth_font, ptr %71, i32 0, i32 1
  %73 = load i32, ptr %72, align 4, !tbaa !24
  %74 = icmp ne i32 %73, 3
  br i1 %74, label %75, label %81

75:                                               ; preds = %70
  %76 = load ptr, ptr %32, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.sth_font, ptr %76, i32 0, i32 3
  %78 = load ptr, ptr %77, align 8, !tbaa !25
  %79 = icmp ne ptr %78, null
  br i1 %79, label %81, label %80

80:                                               ; preds = %75
  store i32 1, ptr %33, align 4
  br label %241

81:                                               ; preds = %75, %70
  br label %82

82:                                               ; preds = %231, %81
  %83 = load ptr, ptr %18, align 8, !tbaa !5
  %84 = load i8, ptr %83, align 1, !tbaa !26
  %85 = icmp ne i8 %84, 0
  br i1 %85, label %86, label %234

86:                                               ; preds = %82
  %87 = load ptr, ptr %18, align 8, !tbaa !5
  %88 = load i8, ptr %87, align 1, !tbaa !26
  %89 = zext i8 %88 to i32
  %90 = call noundef i32 @_ZL7decutf8PjS_j(ptr noundef %28, ptr noundef %25, i32 noundef %89)
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %93

92:                                               ; preds = %86
  br label %231

93:                                               ; preds = %86
  %94 = load ptr, ptr %13, align 8, !tbaa !5
  %95 = load ptr, ptr %32, align 8, !tbaa !5
  %96 = load i32, ptr %25, align 4, !tbaa !9
  %97 = load i16, ptr %30, align 2, !tbaa !13
  %98 = call noundef ptr @_ZL9get_glyphP9sth_stashP8sth_fontjs(ptr noundef %94, ptr noundef %95, i32 noundef %96, i16 noundef signext %97)
  store ptr %98, ptr %26, align 8, !tbaa !5
  %99 = load ptr, ptr %26, align 8, !tbaa !5
  %100 = icmp ne ptr %99, null
  br i1 %100, label %102, label %101

101:                                              ; preds = %93
  br label %231

102:                                              ; preds = %93
  %103 = load ptr, ptr %26, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.sth_glyph, ptr %103, i32 0, i32 2
  %105 = load ptr, ptr %104, align 8, !tbaa !27
  store ptr %105, ptr %27, align 8, !tbaa !5
  %106 = load i32, ptr %22, align 4, !tbaa !9
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %117, label %108

108:                                              ; preds = %102
  %109 = load ptr, ptr %27, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.sth_texture, ptr %109, i32 0, i32 4
  %111 = load i32, ptr %110, align 4, !tbaa !29
  %112 = add nsw i32 %111, 6
  %113 = icmp sge i32 %112, 2048
  br i1 %113, label %114, label %116

114:                                              ; preds = %108
  %115 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZL10flush_drawP9sth_stash(ptr noundef %115)
  br label %116

116:                                              ; preds = %114, %108
  br label %117

117:                                              ; preds = %116, %102
  %118 = load ptr, ptr %13, align 8, !tbaa !5
  %119 = load ptr, ptr %32, align 8, !tbaa !5
  %120 = load ptr, ptr %26, align 8, !tbaa !5
  %121 = load i16, ptr %30, align 2, !tbaa !13
  %122 = call noundef i32 @_ZL8get_quadP9sth_stashP8sth_fontP9sth_glyphsPfS5_P8sth_quad(ptr noundef %118, ptr noundef %119, ptr noundef %120, i16 noundef signext %121, ptr noundef %16, ptr noundef %17, ptr noundef %29)
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %125, label %124

124:                                              ; preds = %117
  br label %231

125:                                              ; preds = %117
  %126 = load i32, ptr %22, align 4, !tbaa !9
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %230, label %128

128:                                              ; preds = %125
  %129 = load ptr, ptr %27, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.sth_texture, ptr %129, i32 0, i32 5
  %131 = load ptr, ptr %27, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.sth_texture, ptr %131, i32 0, i32 4
  %133 = load i32, ptr %132, align 4, !tbaa !29
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [2048 x %struct.Vertex], ptr %130, i64 0, i64 %134
  store ptr %135, ptr %31, align 8, !tbaa !5
  %136 = load ptr, ptr %31, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 0
  %138 = load float, ptr %137, align 4, !tbaa !31
  %139 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 1
  %140 = load float, ptr %139, align 4, !tbaa !33
  %141 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 2
  %142 = load float, ptr %141, align 4, !tbaa !34
  %143 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 3
  %144 = load float, ptr %143, align 4, !tbaa !35
  %145 = load i32, ptr %20, align 4, !tbaa !9
  %146 = sitofp i32 %145 to float
  %147 = load i32, ptr %21, align 4, !tbaa !9
  %148 = sitofp i32 %147 to float
  %149 = load ptr, ptr %24, align 8, !tbaa !5
  %150 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %136, float noundef %138, float noundef %140, float noundef %142, float noundef %144, float noundef %146, float noundef %148, ptr noundef %149)
  store ptr %150, ptr %31, align 8, !tbaa !5
  %151 = load ptr, ptr %31, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 4
  %153 = load float, ptr %152, align 4, !tbaa !36
  %154 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 1
  %155 = load float, ptr %154, align 4, !tbaa !33
  %156 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 6
  %157 = load float, ptr %156, align 4, !tbaa !37
  %158 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 3
  %159 = load float, ptr %158, align 4, !tbaa !35
  %160 = load i32, ptr %20, align 4, !tbaa !9
  %161 = sitofp i32 %160 to float
  %162 = load i32, ptr %21, align 4, !tbaa !9
  %163 = sitofp i32 %162 to float
  %164 = load ptr, ptr %24, align 8, !tbaa !5
  %165 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %151, float noundef %153, float noundef %155, float noundef %157, float noundef %159, float noundef %161, float noundef %163, ptr noundef %164)
  store ptr %165, ptr %31, align 8, !tbaa !5
  %166 = load ptr, ptr %31, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 4
  %168 = load float, ptr %167, align 4, !tbaa !36
  %169 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 5
  %170 = load float, ptr %169, align 4, !tbaa !38
  %171 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 6
  %172 = load float, ptr %171, align 4, !tbaa !37
  %173 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 7
  %174 = load float, ptr %173, align 4, !tbaa !39
  %175 = load i32, ptr %20, align 4, !tbaa !9
  %176 = sitofp i32 %175 to float
  %177 = load i32, ptr %21, align 4, !tbaa !9
  %178 = sitofp i32 %177 to float
  %179 = load ptr, ptr %24, align 8, !tbaa !5
  %180 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %166, float noundef %168, float noundef %170, float noundef %172, float noundef %174, float noundef %176, float noundef %178, ptr noundef %179)
  store ptr %180, ptr %31, align 8, !tbaa !5
  %181 = load ptr, ptr %31, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 0
  %183 = load float, ptr %182, align 4, !tbaa !31
  %184 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 1
  %185 = load float, ptr %184, align 4, !tbaa !33
  %186 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 2
  %187 = load float, ptr %186, align 4, !tbaa !34
  %188 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 3
  %189 = load float, ptr %188, align 4, !tbaa !35
  %190 = load i32, ptr %20, align 4, !tbaa !9
  %191 = sitofp i32 %190 to float
  %192 = load i32, ptr %21, align 4, !tbaa !9
  %193 = sitofp i32 %192 to float
  %194 = load ptr, ptr %24, align 8, !tbaa !5
  %195 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %181, float noundef %183, float noundef %185, float noundef %187, float noundef %189, float noundef %191, float noundef %193, ptr noundef %194)
  store ptr %195, ptr %31, align 8, !tbaa !5
  %196 = load ptr, ptr %31, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 4
  %198 = load float, ptr %197, align 4, !tbaa !36
  %199 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 5
  %200 = load float, ptr %199, align 4, !tbaa !38
  %201 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 6
  %202 = load float, ptr %201, align 4, !tbaa !37
  %203 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 7
  %204 = load float, ptr %203, align 4, !tbaa !39
  %205 = load i32, ptr %20, align 4, !tbaa !9
  %206 = sitofp i32 %205 to float
  %207 = load i32, ptr %21, align 4, !tbaa !9
  %208 = sitofp i32 %207 to float
  %209 = load ptr, ptr %24, align 8, !tbaa !5
  %210 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %196, float noundef %198, float noundef %200, float noundef %202, float noundef %204, float noundef %206, float noundef %208, ptr noundef %209)
  store ptr %210, ptr %31, align 8, !tbaa !5
  %211 = load ptr, ptr %31, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 0
  %213 = load float, ptr %212, align 4, !tbaa !31
  %214 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 5
  %215 = load float, ptr %214, align 4, !tbaa !38
  %216 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 2
  %217 = load float, ptr %216, align 4, !tbaa !34
  %218 = getelementptr inbounds %struct.sth_quad, ptr %29, i32 0, i32 7
  %219 = load float, ptr %218, align 4, !tbaa !39
  %220 = load i32, ptr %20, align 4, !tbaa !9
  %221 = sitofp i32 %220 to float
  %222 = load i32, ptr %21, align 4, !tbaa !9
  %223 = sitofp i32 %222 to float
  %224 = load ptr, ptr %24, align 8, !tbaa !5
  %225 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %211, float noundef %213, float noundef %215, float noundef %217, float noundef %219, float noundef %221, float noundef %223, ptr noundef %224)
  store ptr %225, ptr %31, align 8, !tbaa !5
  %226 = load ptr, ptr %27, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.sth_texture, ptr %226, i32 0, i32 4
  %228 = load i32, ptr %227, align 4, !tbaa !29
  %229 = add nsw i32 %228, 6
  store i32 %229, ptr %227, align 4, !tbaa !29
  br label %230

230:                                              ; preds = %128, %125
  br label %231

231:                                              ; preds = %230, %124, %101, %92
  %232 = load ptr, ptr %18, align 8, !tbaa !5
  %233 = getelementptr inbounds i8, ptr %232, i32 1
  store ptr %233, ptr %18, align 8, !tbaa !5
  br label %82, !llvm.loop !40

234:                                              ; preds = %82
  %235 = load ptr, ptr %19, align 8, !tbaa !5
  %236 = icmp ne ptr %235, null
  br i1 %236, label %237, label %240

237:                                              ; preds = %234
  %238 = load float, ptr %16, align 4, !tbaa !11
  %239 = load ptr, ptr %19, align 8, !tbaa !5
  store float %238, ptr %239, align 4, !tbaa !11
  br label %240

240:                                              ; preds = %237, %234
  store i32 0, ptr %33, align 4
  br label %241

241:                                              ; preds = %240, %80, %69, %46, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  %242 = load i32, ptr %33, align 4
  switch i32 %242, label %244 [
    i32 0, label %243
    i32 1, label %243
  ]

243:                                              ; preds = %241, %241
  ret void

244:                                              ; preds = %241
  unreachable
}

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 nounwind uwtable
declare hidden noundef i32 @_ZL8get_quadP9sth_stashP8sth_fontP9sth_glyphsPfS5_P8sth_quad(ptr noundef, ptr noundef, ptr noundef, i16 noundef signext, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

24:                                               ; preds = %21
  %25 = getelementptr inbounds i8, ptr %0, i64 24
  %.072 = load ptr, ptr %25, align 8, !tbaa !14
  %cond73 = icmp eq ptr %.072, null
  br i1 %cond73, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %24, %27
  %.074 = phi ptr [ %.0, %27 ], [ %.072, %24 ]
  %26 = load i32, ptr %.074, align 8, !tbaa !15
  %.not63 = icmp eq i32 %26, %1
  br i1 %.not63, label %.critedge, label %27

27:                                               ; preds = %.lr.ph
  %28 = getelementptr inbounds i8, ptr %.074, i64 1120
  %.0 = load ptr, ptr %28, 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
  %29 = getelementptr inbounds i8, ptr %.074, i64 4
  %30 = load i32, ptr %29, align 4, !tbaa !20
  %.not64 = icmp eq i32 %30, 3
  br i1 %.not64, label %34, label %31

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

34:                                               ; preds = %31, %.critedge
  %35 = load i8, ptr %5, align 1, !tbaa !22
  %.not6675 = icmp eq i8 %35, 0
  br i1 %.not6675, label %._crit_edge, label %.lr.ph77

.lr.ph77:                                         ; preds = %34
  %.not78 = icmp eq i32 %9, 0
  %36 = getelementptr inbounds i8, ptr %17, i64 4
  %37 = getelementptr inbounds i8, ptr %17, i64 8
  %38 = getelementptr inbounds i8, ptr %17, i64 12
  %39 = sitofp i32 %7 to float
  %40 = sitofp i32 %8 to float
  %41 = getelementptr inbounds i8, ptr %17, i64 16
  %42 = getelementptr inbounds i8, ptr %17, i64 24
  %43 = getelementptr inbounds i8, ptr %17, i64 20
  %44 = getelementptr inbounds i8, ptr %17, i64 28
  br i1 %.not78, label %.lr.ph77.split, label %.lr.ph77.split.us

.lr.ph77.split.us:                                ; preds = %.lr.ph77, %52
  %45 = phi i8 [ %54, %52 ], [ %35, %.lr.ph77 ]
  %.05776.us = phi ptr [ %53, %52 ], [ %5, %.lr.ph77 ]
  %46 = zext i8 %45 to i32
  %47 = call noundef i32 @_ZL7decutf8PjS_j(ptr noundef nonnull %16, ptr noundef nonnull %15, i32 noundef %46)
  %.not68.us = icmp eq i32 %47, 0
  br i1 %.not68.us, label %48, label %52

48:                                               ; preds = %.lr.ph77.split.us
  %49 = load i32, ptr %15, align 4, !tbaa !9
  %50 = call noundef ptr @_ZL9get_glyphP9sth_stashP8sth_fontjs(ptr noundef nonnull %0, ptr noundef nonnull %.074, i32 noundef %49, i16 noundef signext %19)
  %.not69.us = icmp eq ptr %50, null
  br i1 %.not69.us, label %52, label %.thread.us

.thread.us:                                       ; preds = %48
  %51 = call noundef i32 @_ZL8get_quadP9sth_stashP8sth_fontP9sth_glyphsPfS5_P8sth_quad(ptr noundef nonnull %0, ptr noundef nonnull %.074, ptr noundef nonnull %50, i16 noundef signext %19, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef nonnull %17)
  br label %52

52:                                               ; preds = %.thread.us, %48, %.lr.ph77.split.us
  %53 = getelementptr inbounds i8, ptr %.05776.us, i64 1
  %54 = load i8, ptr %53, align 1, !tbaa !22
  %.not66.us = icmp eq i8 %54, 0
  br i1 %.not66.us, label %._crit_edge, label %.lr.ph77.split.us, !llvm.loop !23

.lr.ph77.split:                                   ; preds = %.lr.ph77, %108
  %55 = phi i8 [ %110, %108 ], [ %35, %.lr.ph77 ]
  %.05776 = phi ptr [ %109, %108 ], [ %5, %.lr.ph77 ]
  %56 = zext i8 %55 to i32
  %57 = call noundef i32 @_ZL7decutf8PjS_j(ptr noundef nonnull %16, ptr noundef nonnull %15, i32 noundef %56)
  %.not68 = icmp eq i32 %57, 0
  br i1 %.not68, label %58, label %108

58:                                               ; preds = %.lr.ph77.split
  %59 = load i32, ptr %15, align 4, !tbaa !9
  %60 = call noundef ptr @_ZL9get_glyphP9sth_stashP8sth_fontjs(ptr noundef nonnull %0, ptr noundef nonnull %.074, i32 noundef %59, i16 noundef signext %19)
  %.not69 = icmp eq ptr %60, null
  br i1 %.not69, label %108, label %61

61:                                               ; preds = %58
  %62 = getelementptr inbounds i8, ptr %60, i64 8
  %63 = load ptr, ptr %62, align 8, !tbaa !24
  %64 = getelementptr inbounds i8, ptr %63, i64 788
  %65 = load i32, ptr %64, align 4, !tbaa !27
  %66 = icmp sgt i32 %65, 2041
  br i1 %66, label %67, label %68

67:                                               ; preds = %61
  call void @_ZL10flush_drawP9sth_stash(ptr noundef nonnull %0)
  br label %68

68:                                               ; preds = %61, %67
  %69 = call noundef i32 @_ZL8get_quadP9sth_stashP8sth_fontP9sth_glyphsPfS5_P8sth_quad(ptr noundef nonnull %0, ptr noundef nonnull %.074, ptr noundef nonnull %60, i16 noundef signext %19, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef nonnull %17)
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %108, label %71

71:                                               ; preds = %68
  %72 = getelementptr inbounds i8, ptr %63, i64 792
  %73 = load i32, ptr %64, align 4, !tbaa !27
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [2048 x %struct.Vertex], ptr %72, i64 0, i64 %74
  %76 = load float, ptr %17, align 4, !tbaa !29
  %77 = load float, ptr %36, align 4, !tbaa !31
  %78 = load float, ptr %37, align 4, !tbaa !32
  %79 = load float, ptr %38, align 4, !tbaa !33
  %80 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef nonnull %75, float noundef %76, float noundef %77, float noundef %78, float noundef %79, float noundef %39, float noundef %40, ptr noundef %11)
  %81 = load float, ptr %41, align 4, !tbaa !34
  %82 = load float, ptr %36, align 4, !tbaa !31
  %83 = load float, ptr %42, align 4, !tbaa !35
  %84 = load float, ptr %38, align 4, !tbaa !33
  %85 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %80, float noundef %81, float noundef %82, float noundef %83, float noundef %84, float noundef %39, float noundef %40, ptr noundef %11)
  %86 = load float, ptr %41, align 4, !tbaa !34
  %87 = load float, ptr %43, align 4, !tbaa !36
  %88 = load float, ptr %42, align 4, !tbaa !35
  %89 = load float, ptr %44, align 4, !tbaa !37
  %90 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %85, float noundef %86, float noundef %87, float noundef %88, float noundef %89, float noundef %39, float noundef %40, ptr noundef %11)
  %91 = load float, ptr %17, align 4, !tbaa !29
  %92 = load float, ptr %36, align 4, !tbaa !31
  %93 = load float, ptr %37, align 4, !tbaa !32
  %94 = load float, ptr %38, align 4, !tbaa !33
  %95 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %90, float noundef %91, float noundef %92, float noundef %93, float noundef %94, float noundef %39, float noundef %40, ptr noundef %11)
  %96 = load float, ptr %41, align 4, !tbaa !34
  %97 = load float, ptr %43, align 4, !tbaa !36
  %98 = load float, ptr %42, align 4, !tbaa !35
  %99 = load float, ptr %44, align 4, !tbaa !37
  %100 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %95, float noundef %96, float noundef %97, float noundef %98, float noundef %99, float noundef %39, float noundef %40, ptr noundef %11)
  %101 = load float, ptr %17, align 4, !tbaa !29
  %102 = load float, ptr %43, align 4, !tbaa !36
  %103 = load float, ptr %37, align 4, !tbaa !32
  %104 = load float, ptr %44, align 4, !tbaa !37
  %105 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %100, float noundef %101, float noundef %102, float noundef %103, float noundef %104, float noundef %39, float noundef %40, ptr noundef %11)
  %106 = load i32, ptr %64, align 4, !tbaa !27
  %107 = add nsw i32 %106, 6
  store i32 %107, ptr %64, align 4, !tbaa !27
  br label %108

108:                                              ; preds = %71, %68, %58, %.lr.ph77.split
  %109 = getelementptr inbounds i8, ptr %.05776, i64 1
  %110 = load i8, ptr %109, align 1, !tbaa !22
  %.not66 = icmp eq i8 %110, 0
  br i1 %.not66, label %._crit_edge, label %.lr.ph77.split, !llvm.loop !23

._crit_edge:                                      ; preds = %52, %108, %34
  %.not67 = icmp eq ptr %6, null
  br i1 %.not67, label %.loopexit, label %111

111:                                              ; preds = %._crit_edge
  %112 = load float, ptr %13, align 4, !tbaa !5
  store float %112, ptr %6, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %27, %24, %._crit_edge, %111, %31, %21, %12
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #3
  ret void
}

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 = distinct !{!23, !19}
!24 = !{!25, !13, i64 8}
!25 = !{!"_ZTS9sth_glyph", !10, i64 0, !26, 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}
!26 = !{!"short", !7, i64 0}
!27 = !{!28, !10, i64 788}
!28 = !{!"_ZTS11sth_texture", !7, i64 0, !13, i64 8, !7, i64 16, !10, i64 784, !10, i64 788, !7, i64 792, !13, i64 82712}
!29 = !{!30, !6, i64 0}
!30 = !{!"_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}
!31 = !{!30, !6, i64 4}
!32 = !{!30, !6, i64 8}
!33 = !{!30, !6, i64 12}
!34 = !{!30, !6, i64 16}
!35 = !{!30, !6, i64 24}
!36 = !{!30, !6, i64 20}
!37 = !{!30, !6, i64 28}


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