; LLVM IR from reworks-org/galaxy :: deps/sfml_deps/freetype-src/src/pshinter (pshalgo)

; 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.PSH_GlyphRec_ = type { i32, i32, ptr, ptr, ptr, ptr, ptr, [2 x %struct.PSH_Hint_TableRec_], i8, i8, i8, i8, i8 }
%struct.PSH_Hint_TableRec_ = type { i32, i32, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr }
%struct.FT_Outline_ = type { i16, i16, ptr, ptr, ptr, i32 }
%struct.PSH_GlobalsRec_ = type { ptr, [2 x %struct.PSH_DimensionRec_], %struct.PSH_BluesRec_ }
%struct.PSH_DimensionRec_ = type { %struct.PSH_WidthsRec_, i64, i64 }
%struct.PSH_WidthsRec_ = type { i32, [16 x %struct.PSH_WidthRec_] }
%struct.PSH_WidthRec_ = type { i32, i64, i64 }
%struct.PSH_BluesRec_ = type { %struct.PSH_Blue_TableRec_, %struct.PSH_Blue_TableRec_, %struct.PSH_Blue_TableRec_, %struct.PSH_Blue_TableRec_, i64, i32, i32, i32, i8 }
%struct.PSH_Blue_TableRec_ = type { i32, [16 x %struct.PSH_Blue_ZoneRec_] }
%struct.PSH_Blue_ZoneRec_ = type { i32, i32, i32, i32, i64, i64, i64, i64 }

; Function Attrs: nounwind uwtable
define dso_local i32 @ps_hints_apply(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %struct.PSH_GlyphRec_, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i8, align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 200, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store ptr %10, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.FT_Outline_, ptr %24, i32 0, i32 1
  %26 = load i16, ptr %25, align 2, !tbaa !11
  %27 = sext i16 %26 to i32
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %35, label %29

29:                                               ; preds = %4
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.FT_Outline_, ptr %30, i32 0, i32 0
  %32 = load i16, ptr %31, align 8, !tbaa !14
  %33 = sext i16 %32 to i32
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %29, %4
  store i32 0, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %200

36:                                               ; preds = %29
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = call i32 @psh_glyph_init(ptr noundef %37, ptr noundef %38, ptr noundef %39, ptr noundef %40)
  store i32 %41, ptr %12, align 4, !tbaa !9
  %42 = load i32, ptr %12, align 4, !tbaa !9
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %45

44:                                               ; preds = %36
  br label %197

45:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.PSH_GlyphRec_, ptr %46, i32 0, i32 6
  %48 = load ptr, ptr %47, align 8, !tbaa !15
  %49 = getelementptr inbounds %struct.PSH_GlobalsRec_, ptr %48, i32 0, i32 1
  %50 = getelementptr inbounds [2 x %struct.PSH_DimensionRec_], ptr %49, i64 0, i64 0
  store ptr %50, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.PSH_GlyphRec_, ptr %51, i32 0, i32 6
  %53 = load ptr, ptr %52, align 8, !tbaa !15
  %54 = getelementptr inbounds %struct.PSH_GlobalsRec_, ptr %53, i32 0, i32 1
  %55 = getelementptr inbounds [2 x %struct.PSH_DimensionRec_], ptr %54, i64 0, i64 1
  store ptr %55, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %56 = load ptr, ptr %15, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.PSH_DimensionRec_, ptr %56, i32 0, i32 1
  %58 = load i64, ptr %57, align 8, !tbaa !17
  store i64 %58, ptr %17, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %59 = load ptr, ptr %16, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.PSH_DimensionRec_, ptr %59, i32 0, i32 1
  %61 = load i64, ptr %60, align 8, !tbaa !17
  store i64 %61, ptr %18, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %62 = load i64, ptr %17, align 8, !tbaa !21
  store i64 %62, ptr %19, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %63 = load i64, ptr %18, align 8, !tbaa !21
  store i64 %63, ptr %20, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  store i64 0, ptr %21, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  store i64 0, ptr %22, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #4
  store i8 0, ptr %23, align 1, !tbaa !22
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.PSH_GlobalsRec_, ptr %64, i32 0, i32 2
  %66 = getelementptr inbounds %struct.PSH_BluesRec_, ptr %65, i32 0, i32 0
  %67 = getelementptr inbounds %struct.PSH_Blue_TableRec_, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 8, !tbaa !23
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %85

70:                                               ; preds = %45
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.PSH_GlobalsRec_, ptr %71, i32 0, i32 2
  %73 = getelementptr inbounds %struct.PSH_BluesRec_, ptr %72, i32 0, i32 0
  %74 = getelementptr inbounds %struct.PSH_Blue_TableRec_, ptr %73, i32 0, i32 1
  %75 = getelementptr inbounds [16 x %struct.PSH_Blue_ZoneRec_], ptr %74, i64 0, i64 0
  %76 = getelementptr inbounds %struct.PSH_Blue_ZoneRec_, ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 8, !tbaa !27
  %78 = load i64, ptr %18, align 8, !tbaa !21
  %79 = trunc i64 %78 to i32
  %80 = call i32 @FT_MulFix_x86_64(i32 noundef %77, i32 noundef %79)
  %81 = sext i32 %80 to i64
  store i64 %81, ptr %21, align 8, !tbaa !21
  %82 = load i64, ptr %21, align 8, !tbaa !21
  %83 = add nsw i64 %82, 32
  %84 = and i64 %83, -64
  store i64 %84, ptr %22, align 8, !tbaa !21
  br label %85

85:                                               ; preds = %70, %45
  %86 = load i64, ptr %22, align 8, !tbaa !21
  %87 = icmp ne i64 %86, 0
  br i1 %87, label %88, label %111

88:                                               ; preds = %85
  %89 = load i64, ptr %21, align 8, !tbaa !21
  %90 = load i64, ptr %22, align 8, !tbaa !21
  %91 = icmp ne i64 %89, %90
  br i1 %91, label %92, label %111

92:                                               ; preds = %88
  store i8 1, ptr %23, align 1, !tbaa !22
  %93 = load i64, ptr %18, align 8, !tbaa !21
  %94 = load i64, ptr %22, align 8, !tbaa !21
  %95 = load i64, ptr %21, align 8, !tbaa !21
  %96 = call i64 @FT_MulDiv(i64 noundef %93, i64 noundef %94, i64 noundef %95)
  store i64 %96, ptr %18, align 8, !tbaa !21
  %97 = load i64, ptr %22, align 8, !tbaa !21
  %98 = load i64, ptr %21, align 8, !tbaa !21
  %99 = icmp slt i64 %97, %98
  br i1 %99, label %100, label %105

100:                                              ; preds = %92
  %101 = load i64, ptr %17, align 8, !tbaa !21
  %102 = sdiv i64 %101, 50
  %103 = load i64, ptr %17, align 8, !tbaa !21
  %104 = sub nsw i64 %103, %102
  store i64 %104, ptr %17, align 8, !tbaa !21
  br label %105

105:                                              ; preds = %100, %92
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.PSH_GlyphRec_, ptr %106, i32 0, i32 6
  %108 = load ptr, ptr %107, align 8, !tbaa !15
  %109 = load i64, ptr %17, align 8, !tbaa !21
  %110 = load i64, ptr %18, align 8, !tbaa !21
  call void @psh_globals_set_scale(ptr noundef %108, i64 noundef %109, i64 noundef %110, i64 noundef 0, i64 noundef 0)
  br label %111

111:                                              ; preds = %105, %88, %85
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.PSH_GlyphRec_, ptr %112, i32 0, i32 8
  store i8 1, ptr %113, align 8, !tbaa !29
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.PSH_GlyphRec_, ptr %114, i32 0, i32 9
  store i8 1, ptr %115, align 1, !tbaa !30
  %116 = load i32, ptr %9, align 4, !tbaa !9
  %117 = icmp eq i32 %116, 2
  br i1 %117, label %121, label %118

118:                                              ; preds = %111
  %119 = load i32, ptr %9, align 4, !tbaa !9
  %120 = icmp eq i32 %119, 3
  br label %121

121:                                              ; preds = %118, %111
  %122 = phi i1 [ true, %111 ], [ %120, %118 ]
  %123 = zext i1 %122 to i32
  %124 = icmp ne i32 %123, 0
  %125 = zext i1 %124 to i32
  %126 = trunc i32 %125 to i8
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.PSH_GlyphRec_, ptr %127, i32 0, i32 10
  store i8 %126, ptr %128, align 2, !tbaa !31
  %129 = load i32, ptr %9, align 4, !tbaa !9
  %130 = icmp eq i32 %129, 2
  br i1 %130, label %134, label %131

131:                                              ; preds = %121
  %132 = load i32, ptr %9, align 4, !tbaa !9
  %133 = icmp eq i32 %132, 4
  br label %134

134:                                              ; preds = %131, %121
  %135 = phi i1 [ true, %121 ], [ %133, %131 ]
  %136 = zext i1 %135 to i32
  %137 = icmp ne i32 %136, 0
  %138 = zext i1 %137 to i32
  %139 = trunc i32 %138 to i8
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.PSH_GlyphRec_, ptr %140, i32 0, i32 11
  store i8 %139, ptr %141, align 1, !tbaa !32
  %142 = load i32, ptr %9, align 4, !tbaa !9
  %143 = icmp ne i32 %142, 1
  %144 = zext i1 %143 to i32
  %145 = icmp ne i32 %144, 0
  %146 = zext i1 %145 to i32
  %147 = trunc i32 %146 to i8
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.PSH_GlyphRec_, ptr %148, i32 0, i32 12
  store i8 %147, ptr %149, align 4, !tbaa !33
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %150

150:                                              ; preds = %193, %134
  %151 = load i32, ptr %13, align 4, !tbaa !9
  %152 = icmp slt i32 %151, 2
  br i1 %152, label %153, label %196

153:                                              ; preds = %150
  %154 = load ptr, ptr %11, align 8, !tbaa !5
  %155 = load i32, ptr %13, align 4, !tbaa !9
  call void @psh_glyph_load_points(ptr noundef %154, i32 noundef %155)
  %156 = load ptr, ptr %11, align 8, !tbaa !5
  call void @psh_glyph_compute_extrema(ptr noundef %156)
  %157 = load ptr, ptr %11, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.PSH_GlyphRec_, ptr %157, i32 0, i32 7
  %159 = load i32, ptr %13, align 4, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [2 x %struct.PSH_Hint_TableRec_], ptr %158, i64 0, i64 %160
  %162 = load ptr, ptr %11, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.PSH_GlyphRec_, ptr %162, i32 0, i32 6
  %164 = load ptr, ptr %163, align 8, !tbaa !15
  %165 = load i32, ptr %13, align 4, !tbaa !9
  %166 = load ptr, ptr %11, align 8, !tbaa !5
  call void @psh_hint_table_align_hints(ptr noundef %161, ptr noundef %164, i32 noundef %165, ptr noundef %166)
  %167 = load ptr, ptr %11, align 8, !tbaa !5
  %168 = load i32, ptr %13, align 4, !tbaa !9
  call void @psh_glyph_find_strong_points(ptr noundef %167, i32 noundef %168)
  %169 = load i32, ptr %13, align 4, !tbaa !9
  %170 = icmp eq i32 %169, 1
  br i1 %170, label %171, label %175

171:                                              ; preds = %153
  %172 = load ptr, ptr %8, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.PSH_GlobalsRec_, ptr %172, i32 0, i32 2
  %174 = load ptr, ptr %11, align 8, !tbaa !5
  call void @psh_glyph_find_blue_points(ptr noundef %173, ptr noundef %174)
  br label %175

175:                                              ; preds = %171, %153
  %176 = load ptr, ptr %11, align 8, !tbaa !5
  %177 = load i32, ptr %13, align 4, !tbaa !9
  call void @psh_glyph_interpolate_strong_points(ptr noundef %176, i32 noundef %177)
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  %179 = load i32, ptr %13, align 4, !tbaa !9
  call void @psh_glyph_interpolate_normal_points(ptr noundef %178, i32 noundef %179)
  %180 = load ptr, ptr %11, align 8, !tbaa !5
  %181 = load i32, ptr %13, align 4, !tbaa !9
  call void @psh_glyph_interpolate_other_points(ptr noundef %180, i32 noundef %181)
  %182 = load ptr, ptr %11, align 8, !tbaa !5
  %183 = load i32, ptr %13, align 4, !tbaa !9
  call void @psh_glyph_save_points(ptr noundef %182, i32 noundef %183)
  %184 = load i8, ptr %23, align 1, !tbaa !22
  %185 = icmp ne i8 %184, 0
  br i1 %185, label %186, label %192

186:                                              ; preds = %175
  %187 = load ptr, ptr %11, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.PSH_GlyphRec_, ptr %187, i32 0, i32 6
  %189 = load ptr, ptr %188, align 8, !tbaa !15
  %190 = load i64, ptr %19, align 8, !tbaa !21
  %191 = load i64, ptr %20, align 8, !tbaa !21
  call void @psh_globals_set_scale(ptr noundef %189, i64 noundef %190, i64 noundef %191, i64 noundef 0, i64 noundef 0)
  br label %192

192:                                              ; preds = %186, %175
  br label %193

193:                                              ; preds = %192
  %194 = load i32, ptr %13, align 4, !tbaa !9
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %13, align 4, !tbaa !9
  br label %150, !llvm.loop !34

196:                                              ; preds = %150
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %197

197:                                              ; preds = %196, %44
  %198 = load ptr, ptr %11, align 8, !tbaa !5
  call void @psh_glyph_done(ptr noundef %198)
  %199 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %199, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %200

200:                                              ; preds = %197, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 200, ptr %10) #4
  %201 = load i32, ptr %5, align 4
  ret i32 %201
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @psh_glyph_init(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @FT_MulFix_x86_64(i32 noundef, i32 noundef) #2

declare i64 @FT_MulDiv(i64 noundef, i64 noundef, i64 noundef) #3

declare hidden void @psh_globals_set_scale(ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_load_points(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_compute_extrema(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_hint_table_align_hints(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_find_strong_points(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_find_blue_points(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_interpolate_strong_points(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_interpolate_normal_points(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_interpolate_other_points(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_save_points(ptr noundef, i32 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_done(ptr noundef) #0

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 2}
!12 = !{!"FT_Outline_", !13, i64 0, !13, i64 2, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32}
!13 = !{!"short", !7, i64 0}
!14 = !{!12, !13, i64 0}
!15 = !{!16, !6, i64 40}
!16 = !{!"PSH_GlyphRec_", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !7, i64 48, !7, i64 192, !7, i64 193, !7, i64 194, !7, i64 195, !7, i64 196}
!17 = !{!18, !20, i64 392}
!18 = !{!"PSH_DimensionRec_", !19, i64 0, !20, i64 392, !20, i64 400}
!19 = !{!"PSH_WidthsRec_", !10, i64 0, !7, i64 8}
!20 = !{!"long", !7, i64 0}
!21 = !{!20, !20, i64 0}
!22 = !{!7, !7, i64 0}
!23 = !{!24, !10, i64 824}
!24 = !{!"PSH_GlobalsRec_", !6, i64 0, !7, i64 8, !25, i64 824}
!25 = !{!"PSH_BluesRec_", !26, i64 0, !26, i64 776, !26, i64 1552, !26, i64 2328, !20, i64 3104, !10, i64 3112, !10, i64 3116, !10, i64 3120, !7, i64 3124}
!26 = !{!"PSH_Blue_TableRec_", !10, i64 0, !7, i64 8}
!27 = !{!28, !10, i64 0}
!28 = !{!"PSH_Blue_ZoneRec_", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !20, i64 16, !20, i64 24, !20, i64 32, !20, i64 40}
!29 = !{!16, !7, i64 192}
!30 = !{!16, !7, i64 193}
!31 = !{!16, !7, i64 194}
!32 = !{!16, !7, i64 195}
!33 = !{!16, !7, i64 196}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.PSH_GlyphRec_ = type { i32, i32, ptr, ptr, ptr, ptr, ptr, [2 x %struct.PSH_Hint_TableRec_], i8, i8, i8, i8, i8 }
%struct.PSH_Hint_TableRec_ = type { i32, i32, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr }

; Function Attrs: nounwind uwtable
define dso_local i32 @ps_hints_apply(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = alloca %struct.PSH_GlyphRec_, align 8
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %5) #4
  %6 = getelementptr inbounds i8, ptr %1, i64 2
  %7 = load i16, ptr %6, align 2, !tbaa !5
  %8 = icmp eq i16 %7, 0
  br i1 %8, label %60, label %9

9:                                                ; preds = %4
  %10 = load i16, ptr %1, align 8, !tbaa !12
  %11 = icmp eq i16 %10, 0
  br i1 %11, label %60, label %12

12:                                               ; preds = %9
  %13 = call i32 @psh_glyph_init(ptr noundef nonnull %5, ptr noundef nonnull %1, ptr noundef %0, ptr noundef %2)
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %.loopexit

14:                                               ; preds = %12
  %15 = getelementptr inbounds i8, ptr %5, i64 40
  %16 = load ptr, ptr %15, align 8, !tbaa !13
  %17 = getelementptr inbounds i8, ptr %16, i64 400
  %18 = load i64, ptr %17, align 8, !tbaa !15
  %19 = getelementptr inbounds i8, ptr %16, i64 808
  %20 = load i64, ptr %19, align 8, !tbaa !15
  %21 = getelementptr inbounds i8, ptr %2, i64 824
  %22 = load i32, ptr %21, align 8, !tbaa !19
  %.not74 = icmp eq i32 %22, 0
  br i1 %.not74, label %.thread, label %23

23:                                               ; preds = %14
  %24 = getelementptr inbounds i8, ptr %2, i64 832
  %25 = load i32, ptr %24, align 8, !tbaa !23
  %26 = trunc i64 %20 to i32
  %27 = call i32 @FT_MulFix_x86_64(i32 noundef %25, i32 noundef %26)
  %28 = sext i32 %27 to i64
  %29 = add nsw i64 %28, 32
  %30 = and i64 %29, -64
  %.not75 = icmp eq i64 %30, 0
  %.not76 = icmp eq i64 %30, %28
  %or.cond = or i1 %.not75, %.not76
  br i1 %or.cond, label %.thread, label %31

31:                                               ; preds = %23
  %32 = call i64 @FT_MulDiv(i64 noundef %20, i64 noundef %30, i64 noundef %28) #4
  %33 = icmp slt i64 %30, %28
  br i1 %33, label %34, label %36

34:                                               ; preds = %31
  %.neg = sdiv i64 %18, -50
  %35 = add i64 %.neg, %18
  br label %36

36:                                               ; preds = %34, %31
  %.073 = phi i64 [ %35, %34 ], [ %18, %31 ]
  %37 = load ptr, ptr %15, align 8, !tbaa !13
  call void @psh_globals_set_scale(ptr noundef %37, i64 noundef %.073, i64 noundef %32, i64 noundef 0, i64 noundef 0) #4
  br label %.thread

.thread:                                          ; preds = %14, %36, %23
  %.not77 = phi i1 [ false, %36 ], [ true, %23 ], [ true, %14 ]
  %38 = getelementptr inbounds i8, ptr %5, i64 192
  store i8 1, ptr %38, align 8, !tbaa !25
  %39 = getelementptr inbounds i8, ptr %5, i64 193
  store i8 1, ptr %39, align 1, !tbaa !26
  %40 = icmp eq i32 %3, 2
  %41 = and i32 %3, -2
  %42 = icmp eq i32 %41, 2
  %43 = zext i1 %42 to i8
  %44 = getelementptr inbounds i8, ptr %5, i64 194
  store i8 %43, ptr %44, align 2, !tbaa !27
  %45 = icmp eq i32 %3, 4
  %46 = or i1 %40, %45
  %47 = zext i1 %46 to i8
  %48 = getelementptr inbounds i8, ptr %5, i64 195
  store i8 %47, ptr %48, align 1, !tbaa !28
  %49 = icmp ne i32 %3, 1
  %50 = zext i1 %49 to i8
  %51 = getelementptr inbounds i8, ptr %5, i64 196
  store i8 %50, ptr %51, align 4, !tbaa !29
  %52 = getelementptr inbounds i8, ptr %5, i64 48
  call void @psh_glyph_load_points(ptr noundef nonnull %5, i32 noundef 0)
  call void @psh_glyph_compute_extrema(ptr noundef nonnull %5)
  %53 = load ptr, ptr %15, align 8, !tbaa !13
  call void @psh_hint_table_align_hints(ptr noundef nonnull %52, ptr noundef %53, i32 noundef 0, ptr noundef nonnull %5)
  call void @psh_glyph_find_strong_points(ptr noundef nonnull %5, i32 noundef 0)
  call void @psh_glyph_interpolate_strong_points(ptr noundef nonnull %5, i32 noundef 0)
  call void @psh_glyph_interpolate_normal_points(ptr noundef nonnull %5, i32 noundef 0)
  call void @psh_glyph_interpolate_other_points(ptr noundef nonnull %5, i32 noundef 0)
  call void @psh_glyph_save_points(ptr noundef nonnull %5, i32 noundef 0)
  br i1 %.not77, label %.loopexit.loopexit, label %.loopexit.loopexit84

.loopexit.loopexit:                               ; preds = %.thread
  call void @psh_glyph_load_points(ptr noundef nonnull %5, i32 noundef 1)
  call void @psh_glyph_compute_extrema(ptr noundef nonnull %5)
  %54 = getelementptr inbounds i8, ptr %5, i64 120
  %55 = load ptr, ptr %15, align 8, !tbaa !13
  call void @psh_hint_table_align_hints(ptr noundef nonnull %54, ptr noundef %55, i32 noundef 1, ptr noundef nonnull %5)
  call void @psh_glyph_find_strong_points(ptr noundef nonnull %5, i32 noundef 1)
  call void @psh_glyph_find_blue_points(ptr noundef nonnull %21, ptr noundef nonnull %5)
  call void @psh_glyph_interpolate_strong_points(ptr noundef nonnull %5, i32 noundef 1)
  call void @psh_glyph_interpolate_normal_points(ptr noundef nonnull %5, i32 noundef 1)
  call void @psh_glyph_interpolate_other_points(ptr noundef nonnull %5, i32 noundef 1)
  call void @psh_glyph_save_points(ptr noundef nonnull %5, i32 noundef 1)
  br label %.loopexit

.loopexit.loopexit84:                             ; preds = %.thread
  %56 = load ptr, ptr %15, align 8, !tbaa !13
  call void @psh_globals_set_scale(ptr noundef %56, i64 noundef %18, i64 noundef %20, i64 noundef 0, i64 noundef 0) #4
  call void @psh_glyph_load_points(ptr noundef nonnull %5, i32 noundef 1)
  call void @psh_glyph_compute_extrema(ptr noundef nonnull %5)
  %57 = getelementptr inbounds i8, ptr %5, i64 120
  %58 = load ptr, ptr %15, align 8, !tbaa !13
  call void @psh_hint_table_align_hints(ptr noundef nonnull %57, ptr noundef %58, i32 noundef 1, ptr noundef nonnull %5)
  call void @psh_glyph_find_strong_points(ptr noundef nonnull %5, i32 noundef 1)
  call void @psh_glyph_find_blue_points(ptr noundef nonnull %21, ptr noundef nonnull %5)
  call void @psh_glyph_interpolate_strong_points(ptr noundef nonnull %5, i32 noundef 1)
  call void @psh_glyph_interpolate_normal_points(ptr noundef nonnull %5, i32 noundef 1)
  call void @psh_glyph_interpolate_other_points(ptr noundef nonnull %5, i32 noundef 1)
  call void @psh_glyph_save_points(ptr noundef nonnull %5, i32 noundef 1)
  %59 = load ptr, ptr %15, align 8, !tbaa !13
  call void @psh_globals_set_scale(ptr noundef %59, i64 noundef %18, i64 noundef %20, i64 noundef 0, i64 noundef 0) #4
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit84, %.loopexit.loopexit, %12
  call void @psh_glyph_done(ptr noundef nonnull %5)
  br label %60

60:                                               ; preds = %4, %9, %.loopexit
  %.071 = phi i32 [ %13, %.loopexit ], [ 0, %9 ], [ 0, %4 ]
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %5) #4
  ret i32 %.071
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @psh_glyph_init(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @FT_MulFix_x86_64(i32 noundef, i32 noundef) local_unnamed_addr #2

declare i64 @FT_MulDiv(i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

declare hidden void @psh_globals_set_scale(ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_load_points(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_compute_extrema(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_hint_table_align_hints(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_find_strong_points(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_find_blue_points(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_interpolate_strong_points(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_interpolate_normal_points(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_interpolate_other_points(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_save_points(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare hidden void @psh_glyph_done(ptr noundef) local_unnamed_addr #0

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !7, i64 2}
!6 = !{!"FT_Outline_", !7, i64 0, !7, i64 2, !10, i64 8, !10, i64 16, !10, i64 24, !11, i64 32}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !7, i64 0}
!13 = !{!14, !10, i64 40}
!14 = !{!"PSH_GlyphRec_", !11, i64 0, !11, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !8, i64 48, !8, i64 192, !8, i64 193, !8, i64 194, !8, i64 195, !8, i64 196}
!15 = !{!16, !18, i64 392}
!16 = !{!"PSH_DimensionRec_", !17, i64 0, !18, i64 392, !18, i64 400}
!17 = !{!"PSH_WidthsRec_", !11, i64 0, !8, i64 8}
!18 = !{!"long", !8, i64 0}
!19 = !{!20, !11, i64 824}
!20 = !{!"PSH_GlobalsRec_", !10, i64 0, !8, i64 8, !21, i64 824}
!21 = !{!"PSH_BluesRec_", !22, i64 0, !22, i64 776, !22, i64 1552, !22, i64 2328, !18, i64 3104, !11, i64 3112, !11, i64 3116, !11, i64 3120, !8, i64 3124}
!22 = !{!"PSH_Blue_TableRec_", !11, i64 0, !8, i64 8}
!23 = !{!24, !11, i64 0}
!24 = !{!"PSH_Blue_ZoneRec_", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !18, i64 16, !18, i64 24, !18, i64 32, !18, i64 40}
!25 = !{!14, !8, i64 192}
!26 = !{!14, !8, i64 193}
!27 = !{!14, !8, i64 194}
!28 = !{!14, !8, i64 195}
!29 = !{!14, !8, i64 196}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,SCCPPass,SROAPass,SimplifyCFGPass