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

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

; 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 uwtable
define dso_local void @_Z16sth_draw_textureP9sth_stashifffiiPKcPfS3_(ptr noundef %0, i32 noundef %1, float noundef %2, float noundef %3, float noundef %4, i32 noundef %5, i32 noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) #1 {
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %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
  %32 = 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 float %3, ptr %14, align 4, !tbaa !11
  store float %4, ptr %15, align 4, !tbaa !11
  store i32 %5, ptr %16, align 4, !tbaa !9
  store i32 %6, ptr %17, align 4, !tbaa !9
  store ptr %7, ptr %18, align 8, !tbaa !5
  store ptr %8, ptr %19, align 8, !tbaa !5
  store ptr %9, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  %33 = load ptr, ptr %11, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.sth_stash, ptr %33, i32 0, i32 0
  %35 = load i32, ptr %34, align 8, !tbaa !13
  store i32 %35, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.sth_stash, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !15
  store i32 %38, 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
  %39 = load float, ptr %13, align 4, !tbaa !11
  %40 = fmul float %39, 1.000000e+01
  %41 = fptosi float %40 to i16
  store i16 %41, ptr %28, align 2, !tbaa !16
  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
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = icmp eq ptr %42, null
  br i1 %43, label %44, label %45

44:                                               ; preds = %10
  store i32 1, ptr %31, align 4
  br label %227

45:                                               ; preds = %10
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.sth_stash, ptr %46, i32 0, i32 4
  %48 = load ptr, ptr %47, align 8, !tbaa !18
  %49 = icmp ne ptr %48, null
  br i1 %49, label %51, label %50

50:                                               ; preds = %45
  store i32 1, ptr %31, align 4
  br label %227

51:                                               ; preds = %45
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.sth_stash, ptr %52, i32 0, i32 5
  %54 = load ptr, ptr %53, align 8, !tbaa !19
  store ptr %54, ptr %30, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %66, %51
  %56 = load ptr, ptr %30, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %64

58:                                               ; preds = %55
  %59 = load ptr, ptr %30, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.sth_font, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !20
  %62 = load i32, ptr %12, align 4, !tbaa !9
  %63 = icmp ne i32 %61, %62
  br label %64

64:                                               ; preds = %58, %55
  %65 = phi i1 [ false, %55 ], [ %63, %58 ]
  br i1 %65, label %66, label %70

66:                                               ; preds = %64
  %67 = load ptr, ptr %30, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.sth_font, ptr %67, i32 0, i32 10
  %69 = load ptr, ptr %68, align 8, !tbaa !23
  store ptr %69, ptr %30, align 8, !tbaa !5
  br label %55, !llvm.loop !24

70:                                               ; preds = %64
  %71 = load ptr, ptr %30, align 8, !tbaa !5
  %72 = icmp eq ptr %71, null
  br i1 %72, label %73, label %74

73:                                               ; preds = %70
  store i32 1, ptr %31, align 4
  br label %227

74:                                               ; preds = %70
  %75 = load ptr, ptr %30, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.sth_font, ptr %75, i32 0, i32 1
  %77 = load i32, ptr %76, align 4, !tbaa !26
  %78 = icmp ne i32 %77, 3
  br i1 %78, label %79, label %85

79:                                               ; preds = %74
  %80 = load ptr, ptr %30, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.sth_font, ptr %80, i32 0, i32 3
  %82 = load ptr, ptr %81, align 8, !tbaa !27
  %83 = icmp ne ptr %82, null
  br i1 %83, label %85, label %84

84:                                               ; preds = %79
  store i32 1, ptr %31, align 4
  br label %227

85:                                               ; preds = %79, %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #3
  store i32 1, ptr %32, align 4, !tbaa !9
  br label %86

86:                                               ; preds = %216, %85
  %87 = load i32, ptr %32, align 4, !tbaa !9
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %219

89:                                               ; preds = %86
  store i32 0, ptr %32, align 4, !tbaa !9
  %90 = load ptr, ptr %18, align 8, !tbaa !5
  %91 = load i8, ptr %90, align 1, !tbaa !28
  %92 = zext i8 %91 to i32
  %93 = call noundef i32 @_ZL7decutf8PjS_j(ptr noundef %26, ptr noundef %23, i32 noundef %92)
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %89
  br label %216

96:                                               ; preds = %89
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  %98 = load ptr, ptr %30, align 8, !tbaa !5
  %99 = load i32, ptr %23, align 4, !tbaa !9
  %100 = load i16, ptr %28, align 2, !tbaa !16
  %101 = call noundef ptr @_ZL9get_glyphP9sth_stashP8sth_fontjs(ptr noundef %97, ptr noundef %98, i32 noundef %99, i16 noundef signext %100)
  store ptr %101, ptr %24, align 8, !tbaa !5
  %102 = load ptr, ptr %24, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  br i1 %103, label %105, label %104

104:                                              ; preds = %96
  br label %216

105:                                              ; preds = %96
  %106 = load ptr, ptr %24, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.sth_glyph, ptr %106, i32 0, i32 2
  %108 = load ptr, ptr %107, align 8, !tbaa !29
  store ptr %108, ptr %25, align 8, !tbaa !5
  %109 = load ptr, ptr %25, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.sth_texture, ptr %109, i32 0, i32 4
  %111 = load i32, ptr %110, align 4, !tbaa !31
  %112 = add nsw i32 %111, 6
  %113 = icmp sge i32 %112, 2048
  br i1 %113, label %114, label %116

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

116:                                              ; preds = %114, %105
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = load ptr, ptr %30, align 8, !tbaa !5
  %119 = load ptr, ptr %24, align 8, !tbaa !5
  %120 = load i16, ptr %28, align 2, !tbaa !16
  %121 = call noundef i32 @_ZL8get_quadP9sth_stashP8sth_fontP9sth_glyphsPfS5_P8sth_quad(ptr noundef %117, ptr noundef %118, ptr noundef %119, i16 noundef signext %120, ptr noundef %14, ptr noundef %15, ptr noundef %27)
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %124, label %123

123:                                              ; preds = %116
  br label %216

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

216:                                              ; preds = %124, %123, %104, %95
  %217 = load ptr, ptr %18, align 8, !tbaa !5
  %218 = getelementptr inbounds i8, ptr %217, i32 1
  store ptr %218, ptr %18, align 8, !tbaa !5
  br label %86, !llvm.loop !38

219:                                              ; preds = %86
  %220 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZL10flush_drawP9sth_stash(ptr noundef %220)
  %221 = load ptr, ptr %19, align 8, !tbaa !5
  %222 = icmp ne ptr %221, null
  br i1 %222, label %223, label %226

223:                                              ; preds = %219
  %224 = load float, ptr %14, align 4, !tbaa !11
  %225 = load ptr, ptr %19, align 8, !tbaa !5
  store float %224, ptr %225, align 4, !tbaa !11
  br label %226

226:                                              ; preds = %223, %219
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #3
  store i32 0, ptr %31, align 4
  br label %227

227:                                              ; preds = %226, %84, %73, %50, %44
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  %228 = load i32, ptr %31, align 4
  switch i32 %228, label %230 [
    i32 0, label %229
    i32 1, label %229
  ]

229:                                              ; preds = %227, %227
  ret void

230:                                              ; preds = %227
  unreachable
}

; 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

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


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

; 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 uwtable
define dso_local void @_Z16sth_draw_textureP9sth_stashifffiiPKcPfS3_(ptr noundef %0, i32 noundef %1, float noundef %2, float noundef %3, float noundef %4, i32 noundef %5, i32 noundef %6, ptr nocapture noundef readonly %7, ptr noundef writeonly %8, ptr noundef %9) local_unnamed_addr #1 {
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.sth_quad, align 8
  store float %3, ptr %11, align 4, !tbaa !5
  store float %4, ptr %12, align 4, !tbaa !5
  %16 = load <2 x i32>, ptr %0, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #3
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %15) #3
  %17 = fmul float %2, 1.000000e+01
  %18 = fptosi float %17 to i16
  %19 = getelementptr inbounds i8, ptr %0, i64 16
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %.not = icmp eq ptr %20, null
  br i1 %.not, label %.loopexit, label %21

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

.lr.ph:                                           ; preds = %21, %24
  %.05874 = phi ptr [ %.058, %24 ], [ %.05872, %21 ]
  %23 = load i32, ptr %.05874, align 8, !tbaa !15
  %.not63 = icmp eq i32 %23, %1
  br i1 %.not63, label %.critedge, label %24

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

.critedge:                                        ; preds = %.lr.ph
  %26 = getelementptr inbounds i8, ptr %.05874, i64 4
  %27 = load i32, ptr %26, align 4, !tbaa !20
  %.not64 = icmp eq i32 %27, 3
  br i1 %.not64, label %31, label %28

28:                                               ; preds = %.critedge
  %29 = getelementptr inbounds i8, ptr %.05874, i64 64
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  %.not65 = icmp eq ptr %30, null
  br i1 %.not65, label %.loopexit, label %31

31:                                               ; preds = %28, %.critedge
  %32 = getelementptr inbounds i8, ptr %15, i64 4
  %33 = getelementptr inbounds i8, ptr %15, i64 16
  %34 = sitofp <2 x i32> %16 to <2 x float>
  %35 = getelementptr inbounds i8, ptr %15, i64 20
  %36 = sitofp i32 %5 to float
  %37 = sitofp i32 %6 to float
  %38 = load i8, ptr %7, align 1, !tbaa !22
  %39 = zext i8 %38 to i32
  %40 = call noundef i32 @_ZL7decutf8PjS_j(ptr noundef nonnull %14, ptr noundef nonnull %13, i32 noundef %39)
  %.not68 = icmp eq i32 %40, 0
  br i1 %.not68, label %41, label %76

41:                                               ; preds = %31
  %42 = load i32, ptr %13, align 4, !tbaa !9
  %43 = call noundef ptr @_ZL9get_glyphP9sth_stashP8sth_fontjs(ptr noundef nonnull %0, ptr noundef nonnull %.05874, i32 noundef %42, i16 noundef signext %18)
  %.not69 = icmp eq ptr %43, null
  br i1 %.not69, label %76, label %44

44:                                               ; preds = %41
  %45 = getelementptr inbounds i8, ptr %43, i64 8
  %46 = load ptr, ptr %45, align 8, !tbaa !23
  %47 = getelementptr inbounds i8, ptr %46, i64 788
  %48 = load i32, ptr %47, align 4, !tbaa !26
  %49 = icmp sgt i32 %48, 2041
  br i1 %49, label %50, label %51

50:                                               ; preds = %44
  call void @_ZL10flush_drawP9sth_stash(ptr noundef nonnull %0)
  br label %51

51:                                               ; preds = %50, %44
  %52 = call noundef i32 @_ZL8get_quadP9sth_stashP8sth_fontP9sth_glyphsPfS5_P8sth_quad(ptr noundef nonnull %0, ptr noundef nonnull %.05874, ptr noundef nonnull %43, i16 noundef signext %18, ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %15)
  %.not70 = icmp eq i32 %52, 0
  br i1 %.not70, label %76, label %53

53:                                               ; preds = %51
  %54 = getelementptr inbounds i8, ptr %46, i64 792
  %55 = load i32, ptr %47, align 4, !tbaa !26
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [2048 x %struct.Vertex], ptr %54, i64 0, i64 %56
  store <2 x float> zeroinitializer, ptr %15, align 8, !tbaa !5
  store <2 x float> %34, ptr %33, align 8, !tbaa !5
  %58 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef nonnull %57, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef %36, float noundef %37, ptr noundef %9)
  %59 = load float, ptr %33, align 8, !tbaa !28
  %60 = load float, ptr %32, align 4, !tbaa !30
  %61 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %58, float noundef %59, float noundef %60, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef %36, float noundef %37, ptr noundef %9)
  %62 = load float, ptr %33, align 8, !tbaa !28
  %63 = load float, ptr %35, align 4, !tbaa !31
  %64 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %61, float noundef %62, float noundef %63, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef %36, float noundef %37, ptr noundef %9)
  %65 = load float, ptr %15, align 8, !tbaa !32
  %66 = load float, ptr %32, align 4, !tbaa !30
  %67 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %64, float noundef %65, float noundef %66, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef %36, float noundef %37, ptr noundef %9)
  %68 = load float, ptr %33, align 8, !tbaa !28
  %69 = load float, ptr %35, align 4, !tbaa !31
  %70 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %67, float noundef %68, float noundef %69, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef %36, float noundef %37, ptr noundef %9)
  %71 = load float, ptr %15, align 8, !tbaa !32
  %72 = load float, ptr %35, align 4, !tbaa !31
  %73 = call noundef ptr @_ZL4setvP6VertexffffffPf(ptr noundef %70, float noundef %71, float noundef %72, float noundef 0.000000e+00, float noundef 1.000000e+00, float noundef %36, float noundef %37, ptr noundef %9)
  %74 = load i32, ptr %47, align 4, !tbaa !26
  %75 = add nsw i32 %74, 6
  store i32 %75, ptr %47, align 4, !tbaa !26
  br label %76

76:                                               ; preds = %51, %41, %31, %53
  call void @_ZL10flush_drawP9sth_stash(ptr noundef nonnull %0)
  %.not67 = icmp eq ptr %8, null
  br i1 %.not67, label %.loopexit, label %77

77:                                               ; preds = %76
  %78 = load float, ptr %11, align 4, !tbaa !5
  store float %78, ptr %8, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %24, %21, %76, %77, %28, %10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #3
  ret void
}

; 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

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 16}
!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 20}
!32 = !{!29, !6, i64 0}


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