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

; 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.AF_GlyphHintsRec_ = type { ptr, i64, i64, i64, i64, i32, i32, ptr, i32, i32, ptr, [2 x %struct.AF_AxisHintsRec_], i32, i32, ptr, %struct.anon.0 }
%struct.AF_AxisHintsRec_ = type { i32, i32, ptr, i32, i32, ptr, i32, %struct.anon }
%struct.anon = type { [18 x %struct.AF_SegmentRec_], [12 x %struct.AF_EdgeRec_] }
%struct.AF_SegmentRec_ = type { i8, i8, i16, i16, i16, i16, i16, ptr, ptr, ptr, ptr, i64, i64, ptr, ptr }
%struct.AF_EdgeRec_ = type { i16, i64, i64, i8, i8, i64, ptr, ptr, ptr, i32, ptr, ptr }
%struct.anon.0 = type { [8 x ptr], [96 x %struct.AF_PointRec_] }
%struct.AF_PointRec_ = type { i16, i8, i8, i64, i64, i16, i16, i64, i64, i64, i64, ptr, ptr }
%struct.AF_CJKMetricsRec_ = type { %struct.AF_StyleMetricsRec_, i32, [2 x %struct.AF_CJKAxisRec_] }
%struct.AF_StyleMetricsRec_ = type { ptr, %struct.AF_ScalerRec_, i8, ptr }
%struct.AF_ScalerRec_ = type { ptr, i64, i64, i64, i64, i32, i32 }
%struct.AF_CJKAxisRec_ = type { i64, i64, i32, [16 x %struct.AF_WidthRec_], i64, i64, i8, i8, i32, [266 x %struct.AF_CJKBlueRec_], i64, i64 }
%struct.AF_WidthRec_ = type { i64, i64, i64 }
%struct.AF_CJKBlueRec_ = type { %struct.AF_WidthRec_, %struct.AF_WidthRec_, i32 }
%struct.FT_FaceRec_ = type { i64, i64, i64, i64, i64, ptr, ptr, i32, ptr, i32, ptr, %struct.FT_Generic_, %struct.FT_BBox_, i16, i16, i16, i16, i16, i16, i16, i16, ptr, ptr, ptr, ptr, ptr, ptr, %struct.FT_ListRec_, %struct.FT_Generic_, ptr, ptr }
%struct.FT_BBox_ = type { i64, i64, i64, i64 }
%struct.FT_ListRec_ = type { ptr, ptr }
%struct.FT_Generic_ = type { ptr, ptr }
%struct.AF_StyleClassRec_ = type { i32, i32, i32, i32, i32 }
%struct.AF_ScriptClassRec_ = type { i32, ptr, ptr, i8, ptr }
%struct.FT_GlyphSlotRec_ = type { ptr, ptr, ptr, i32, %struct.FT_Generic_, %struct.FT_Glyph_Metrics_, i64, i64, %struct.FT_Vector_, i32, %struct.FT_Bitmap_, i32, i32, %struct.FT_Outline_, i32, ptr, ptr, i64, i64, i64, ptr, ptr }
%struct.FT_Glyph_Metrics_ = type { i64, i64, i64, i64, i64, i64, i64, i64 }
%struct.FT_Vector_ = type { i64, i64 }
%struct.FT_Bitmap_ = type { i32, i32, i32, ptr, i16, i8, i8, ptr }
%struct.FT_Outline_ = type { i16, i16, ptr, ptr, ptr, i32 }
%struct.AF_LatinMetricsRec_ = type { %struct.AF_StyleMetricsRec_, i32, [2 x %struct.AF_LatinAxisRec_] }
%struct.AF_LatinAxisRec_ = type { i64, i64, i32, [16 x %struct.AF_WidthRec_], i64, i64, i8, i32, [266 x %struct.AF_LatinBlueRec_], i64, i64 }
%struct.AF_LatinBlueRec_ = type { %struct.AF_WidthRec_, %struct.AF_WidthRec_, i64, i64, i32 }

@af_script_classes = external hidden constant [0 x ptr], align 8

; Function Attrs: nounwind uwtable
define hidden void @af_cjk_metrics_init_widths(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [1 x %struct.AF_GlyphHintsRec_], align 16
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca [1 x %struct.AF_CJKMetricsRec_], align 16
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %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 ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i64, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12904, ptr %5) #4
  br label %27

27:                                               ; preds = %2
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  br label %32

32:                                               ; preds = %31
  br label %33

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33
  br label %35

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  %39 = getelementptr inbounds [1 x %struct.AF_GlyphHintsRec_], ptr %5, i64 0, i64 0
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.FT_FaceRec_, ptr %40, i32 0, i32 25
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  call void @af_glyph_hints_init(ptr noundef %39, ptr noundef %42)
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.AF_CJKMetricsRec_, ptr %43, i32 0, i32 2
  %45 = getelementptr inbounds [2 x %struct.AF_CJKAxisRec_], ptr %44, i64 0, i64 0
  %46 = getelementptr inbounds %struct.AF_CJKAxisRec_, ptr %45, i32 0, i32 2
  store i32 0, ptr %46, align 8, !tbaa !17
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.AF_CJKMetricsRec_, ptr %47, i32 0, i32 2
  %49 = getelementptr inbounds [2 x %struct.AF_CJKAxisRec_], ptr %48, i64 0, i64 1
  %50 = getelementptr inbounds %struct.AF_CJKAxisRec_, ptr %49, i32 0, i32 2
  store i32 0, ptr %50, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 30768, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %51 = getelementptr inbounds [1 x %struct.AF_CJKMetricsRec_], ptr %9, i64 0, i64 0
  %52 = getelementptr inbounds %struct.AF_CJKMetricsRec_, ptr %51, i32 0, i32 0
  %53 = getelementptr inbounds %struct.AF_StyleMetricsRec_, ptr %52, i32 0, i32 1
  store ptr %53, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.AF_CJKMetricsRec_, ptr %54, i32 0, i32 0
  %56 = getelementptr inbounds %struct.AF_StyleMetricsRec_, ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  store ptr %57, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.AF_StyleClassRec_, ptr %58, i32 0, i32 2
  %60 = load i32, ptr %59, align 4, !tbaa !23
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds [0 x ptr], ptr @af_script_classes, i64 0, i64 %61
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  store ptr %63, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  store ptr %13, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.AF_ScriptClassRec_, ptr %64, i32 0, i32 4
  %66 = load ptr, ptr %65, align 8, !tbaa !25
  store ptr %66, ptr %15, align 8, !tbaa !5
  store i64 0, ptr %7, align 8, !tbaa !27
  br label %67

67:                                               ; preds = %100, %98, %38
  %68 = load ptr, ptr %15, align 8, !tbaa !5
  %69 = load i8, ptr %68, align 1, !tbaa !28
  %70 = icmp ne i8 %69, 0
  br i1 %70, label %71, label %101

71:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  br label %72

72:                                               ; preds = %77, %71
  %73 = load ptr, ptr %15, align 8, !tbaa !5
  %74 = load i8, ptr %73, align 1, !tbaa !28
  %75 = sext i8 %74 to i32
  %76 = icmp eq i32 %75, 32
  br i1 %76, label %77, label %80

77:                                               ; preds = %72
  %78 = load ptr, ptr %15, align 8, !tbaa !5
  %79 = getelementptr inbounds i8, ptr %78, i32 1
  store ptr %79, ptr %15, align 8, !tbaa !5
  br label %72, !llvm.loop !29

80:                                               ; preds = %72
  %81 = load ptr, ptr %15, align 8, !tbaa !5
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.AF_CJKMetricsRec_, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %14, align 8, !tbaa !5
  %85 = call ptr @af_shaper_get_cluster(ptr noundef %81, ptr noundef %83, ptr noundef %84, ptr noundef %16)
  store ptr %85, ptr %15, align 8, !tbaa !5
  %86 = load i32, ptr %16, align 4, !tbaa !31
  %87 = icmp ugt i32 %86, 1
  br i1 %87, label %88, label %89

88:                                               ; preds = %80
  store i32 10, ptr %17, align 4
  br label %98, !llvm.loop !32

89:                                               ; preds = %80
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.AF_CJKMetricsRec_, ptr %90, i32 0, i32 0
  %92 = load ptr, ptr %14, align 8, !tbaa !5
  %93 = call i64 @af_shaper_get_elem(ptr noundef %91, ptr noundef %92, i32 noundef 0, ptr noundef null, ptr noundef null)
  store i64 %93, ptr %7, align 8, !tbaa !27
  %94 = load i64, ptr %7, align 8, !tbaa !27
  %95 = icmp ne i64 %94, 0
  br i1 %95, label %96, label %97

96:                                               ; preds = %89
  store i32 11, ptr %17, align 4
  br label %98

97:                                               ; preds = %89
  store i32 0, ptr %17, align 4
  br label %98

98:                                               ; preds = %97, %96, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  %99 = load i32, ptr %17, align 4
  switch i32 %99, label %315 [
    i32 0, label %100
    i32 10, label %67
    i32 11, label %101
  ]

100:                                              ; preds = %98
  br label %67, !llvm.loop !32

101:                                              ; preds = %98, %67
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = load ptr, ptr %14, align 8, !tbaa !5
  call void @af_shaper_buf_destroy(ptr noundef %102, ptr noundef %103)
  %104 = load i64, ptr %7, align 8, !tbaa !27
  %105 = icmp ne i64 %104, 0
  br i1 %105, label %107, label %106

106:                                              ; preds = %101
  br label %269

107:                                              ; preds = %101
  %108 = load i64, ptr %7, align 8, !tbaa !27
  %109 = icmp ne i64 %108, 0
  br i1 %109, label %111, label %110

110:                                              ; preds = %107
  br label %269

111:                                              ; preds = %107
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = load i64, ptr %7, align 8, !tbaa !27
  %117 = trunc i64 %116 to i32
  %118 = call i32 @FT_Load_Glyph(ptr noundef %115, i32 noundef %117, i32 noundef 1)
  store i32 %118, ptr %6, align 4, !tbaa !31
  %119 = load i32, ptr %6, align 4, !tbaa !31
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %130, label %121

121:                                              ; preds = %114
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.FT_FaceRec_, ptr %122, i32 0, i32 21
  %124 = load ptr, ptr %123, align 8, !tbaa !33
  %125 = getelementptr inbounds %struct.FT_GlyphSlotRec_, ptr %124, i32 0, i32 13
  %126 = getelementptr inbounds %struct.FT_Outline_, ptr %125, i32 0, i32 1
  %127 = load i16, ptr %126, align 2, !tbaa !34
  %128 = sext i16 %127 to i32
  %129 = icmp sle i32 %128, 0
  br i1 %129, label %130, label %131

130:                                              ; preds = %121, %114
  br label %269

131:                                              ; preds = %121
  %132 = getelementptr inbounds [1 x %struct.AF_CJKMetricsRec_], ptr %9, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %132, i8 0, i64 30768, i1 false)
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.AF_CJKMetricsRec_, ptr %133, i32 0, i32 1
  %135 = load i32, ptr %134, align 8, !tbaa !40
  %136 = getelementptr inbounds [1 x %struct.AF_CJKMetricsRec_], ptr %9, i64 0, i64 0
  %137 = getelementptr inbounds %struct.AF_CJKMetricsRec_, ptr %136, i32 0, i32 1
  store i32 %135, ptr %137, align 8, !tbaa !40
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.AF_ScalerRec_, ptr %138, i32 0, i32 1
  store i64 65536, ptr %139, align 8, !tbaa !41
  %140 = load ptr, ptr %10, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.AF_ScalerRec_, ptr %140, i32 0, i32 2
  store i64 65536, ptr %141, align 8, !tbaa !42
  %142 = load ptr, ptr %10, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.AF_ScalerRec_, ptr %142, i32 0, i32 3
  store i64 0, ptr %143, align 8, !tbaa !43
  %144 = load ptr, ptr %10, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.AF_ScalerRec_, ptr %144, i32 0, i32 4
  store i64 0, ptr %145, align 8, !tbaa !44
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = load ptr, ptr %10, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.AF_ScalerRec_, ptr %147, i32 0, i32 0
  store ptr %146, ptr %148, align 8, !tbaa !45
  %149 = load ptr, ptr %10, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.AF_ScalerRec_, ptr %149, i32 0, i32 5
  store i32 0, ptr %150, align 8, !tbaa !46
  %151 = load ptr, ptr %10, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.AF_ScalerRec_, ptr %151, i32 0, i32 6
  store i32 0, ptr %152, align 4, !tbaa !47
  %153 = getelementptr inbounds [1 x %struct.AF_GlyphHintsRec_], ptr %5, i64 0, i64 0
  %154 = getelementptr inbounds [1 x %struct.AF_CJKMetricsRec_], ptr %9, i64 0, i64 0
  call void @af_glyph_hints_rescale(ptr noundef %153, ptr noundef %154)
  %155 = getelementptr inbounds [1 x %struct.AF_GlyphHintsRec_], ptr %5, i64 0, i64 0
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.FT_FaceRec_, ptr %156, i32 0, i32 21
  %158 = load ptr, ptr %157, align 8, !tbaa !33
  %159 = getelementptr inbounds %struct.FT_GlyphSlotRec_, ptr %158, i32 0, i32 13
  %160 = call i32 @af_glyph_hints_reload(ptr noundef %155, ptr noundef %159)
  store i32 %160, ptr %6, align 4, !tbaa !31
  %161 = load i32, ptr %6, align 4, !tbaa !31
  %162 = icmp ne i32 %161, 0
  br i1 %162, label %163, label %164

163:                                              ; preds = %131
  br label %269

164:                                              ; preds = %131
  store i32 0, ptr %8, align 4, !tbaa !31
  br label %165

165:                                              ; preds = %265, %164
  %166 = load i32, ptr %8, align 4, !tbaa !31
  %167 = icmp slt i32 %166, 2
  br i1 %167, label %168, label %268

168:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %169 = load ptr, ptr %3, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.AF_CJKMetricsRec_, ptr %169, i32 0, i32 2
  %171 = load i32, ptr %8, align 4, !tbaa !31
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [2 x %struct.AF_CJKAxisRec_], ptr %170, i64 0, i64 %172
  store ptr %173, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %174 = getelementptr inbounds [1 x %struct.AF_GlyphHintsRec_], ptr %5, i64 0, i64 0
  %175 = getelementptr inbounds %struct.AF_GlyphHintsRec_, ptr %174, i32 0, i32 11
  %176 = load i32, ptr %8, align 4, !tbaa !31
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [2 x %struct.AF_AxisHintsRec_], ptr %175, i64 0, i64 %177
  store ptr %178, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store i32 0, ptr %23, align 4, !tbaa !31
  %179 = getelementptr inbounds [1 x %struct.AF_GlyphHintsRec_], ptr %5, i64 0, i64 0
  %180 = load i32, ptr %8, align 4, !tbaa !31
  %181 = call i32 @af_latin_hints_compute_segments(ptr noundef %179, i32 noundef %180)
  store i32 %181, ptr %6, align 4, !tbaa !31
  %182 = load i32, ptr %6, align 4, !tbaa !31
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %184, label %185

184:                                              ; preds = %168
  store i32 14, ptr %17, align 4
  br label %262

185:                                              ; preds = %168
  %186 = getelementptr inbounds [1 x %struct.AF_GlyphHintsRec_], ptr %5, i64 0, i64 0
  %187 = load i32, ptr %8, align 4, !tbaa !31
  call void @af_latin_hints_link_segments(ptr noundef %186, i32 noundef 0, ptr noundef null, i32 noundef %187)
  %188 = load ptr, ptr %19, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.AF_AxisHintsRec_, ptr %188, i32 0, i32 2
  %190 = load ptr, ptr %189, align 8, !tbaa !48
  store ptr %190, ptr %20, align 8, !tbaa !5
  %191 = load ptr, ptr %20, align 8, !tbaa !5
  %192 = load ptr, ptr %19, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.AF_AxisHintsRec_, ptr %192, i32 0, i32 0
  %194 = load i32, ptr %193, align 8, !tbaa !51
  %195 = zext i32 %194 to i64
  %196 = getelementptr inbounds %struct.AF_SegmentRec_, ptr %191, i64 %195
  store ptr %196, ptr %21, align 8, !tbaa !5
  br label %197

197:                                              ; preds = %247, %185
  %198 = load ptr, ptr %20, align 8, !tbaa !5
  %199 = load ptr, ptr %21, align 8, !tbaa !5
  %200 = icmp ult ptr %198, %199
  br i1 %200, label %201, label %250

201:                                              ; preds = %197
  %202 = load ptr, ptr %20, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.AF_SegmentRec_, ptr %202, i32 0, i32 9
  %204 = load ptr, ptr %203, align 8, !tbaa !52
  store ptr %204, ptr %22, align 8, !tbaa !5
  %205 = load ptr, ptr %22, align 8, !tbaa !5
  %206 = icmp ne ptr %205, null
  br i1 %206, label %207, label %246

207:                                              ; preds = %201
  %208 = load ptr, ptr %22, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.AF_SegmentRec_, ptr %208, i32 0, i32 9
  %210 = load ptr, ptr %209, align 8, !tbaa !52
  %211 = load ptr, ptr %20, align 8, !tbaa !5
  %212 = icmp eq ptr %210, %211
  br i1 %212, label %213, label %246

213:                                              ; preds = %207
  %214 = load ptr, ptr %22, align 8, !tbaa !5
  %215 = load ptr, ptr %20, align 8, !tbaa !5
  %216 = icmp ugt ptr %214, %215
  br i1 %216, label %217, label %246

217:                                              ; preds = %213
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %218 = load ptr, ptr %20, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.AF_SegmentRec_, ptr %218, i32 0, i32 2
  %220 = load i16, ptr %219, align 2, !tbaa !54
  %221 = sext i16 %220 to i32
  %222 = load ptr, ptr %22, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.AF_SegmentRec_, ptr %222, i32 0, i32 2
  %224 = load i16, ptr %223, align 2, !tbaa !54
  %225 = sext i16 %224 to i32
  %226 = sub nsw i32 %221, %225
  %227 = sext i32 %226 to i64
  store i64 %227, ptr %24, align 8, !tbaa !27
  %228 = load i64, ptr %24, align 8, !tbaa !27
  %229 = icmp slt i64 %228, 0
  br i1 %229, label %230, label %233

230:                                              ; preds = %217
  %231 = load i64, ptr %24, align 8, !tbaa !27
  %232 = sub nsw i64 0, %231
  store i64 %232, ptr %24, align 8, !tbaa !27
  br label %233

233:                                              ; preds = %230, %217
  %234 = load i32, ptr %23, align 4, !tbaa !31
  %235 = icmp ult i32 %234, 16
  br i1 %235, label %236, label %245

236:                                              ; preds = %233
  %237 = load i64, ptr %24, align 8, !tbaa !27
  %238 = load ptr, ptr %18, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.AF_CJKAxisRec_, ptr %238, i32 0, i32 3
  %240 = load i32, ptr %23, align 4, !tbaa !31
  %241 = add i32 %240, 1
  store i32 %241, ptr %23, align 4, !tbaa !31
  %242 = zext i32 %240 to i64
  %243 = getelementptr inbounds [16 x %struct.AF_WidthRec_], ptr %239, i64 0, i64 %242
  %244 = getelementptr inbounds %struct.AF_WidthRec_, ptr %243, i32 0, i32 0
  store i64 %237, ptr %244, align 8, !tbaa !55
  br label %245

245:                                              ; preds = %236, %233
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  br label %246

246:                                              ; preds = %245, %213, %207, %201
  br label %247

247:                                              ; preds = %246
  %248 = load ptr, ptr %20, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.AF_SegmentRec_, ptr %248, i32 1
  store ptr %249, ptr %20, align 8, !tbaa !5
  br label %197, !llvm.loop !57

250:                                              ; preds = %197
  %251 = load ptr, ptr %18, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.AF_CJKAxisRec_, ptr %251, i32 0, i32 3
  %253 = getelementptr inbounds [16 x %struct.AF_WidthRec_], ptr %252, i64 0, i64 0
  %254 = getelementptr inbounds [1 x %struct.AF_CJKMetricsRec_], ptr %9, i64 0, i64 0
  %255 = getelementptr inbounds %struct.AF_CJKMetricsRec_, ptr %254, i32 0, i32 1
  %256 = load i32, ptr %255, align 8, !tbaa !40
  %257 = udiv i32 %256, 100
  %258 = zext i32 %257 to i64
  call void @af_sort_and_quantize_widths(ptr noundef %23, ptr noundef %253, i64 noundef %258)
  %259 = load i32, ptr %23, align 4, !tbaa !31
  %260 = load ptr, ptr %18, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.AF_CJKAxisRec_, ptr %260, i32 0, i32 2
  store i32 %259, ptr %261, align 8, !tbaa !17
  store i32 0, ptr %17, align 4
  br label %262

262:                                              ; preds = %250, %184
  call void @llvm.lifetime.end.p0(i64 4, 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
  %263 = load i32, ptr %17, align 4
  switch i32 %263, label %315 [
    i32 0, label %264
    i32 14, label %269
  ]

264:                                              ; preds = %262
  br label %265

265:                                              ; preds = %264
  %266 = load i32, ptr %8, align 4, !tbaa !31
  %267 = add nsw i32 %266, 1
  store i32 %267, ptr %8, align 4, !tbaa !31
  br label %165, !llvm.loop !58

268:                                              ; preds = %165
  br label %269

269:                                              ; preds = %268, %262, %163, %130, %110, %106
  store i32 0, ptr %8, align 4, !tbaa !31
  br label %270

270:                                              ; preds = %307, %269
  %271 = load i32, ptr %8, align 4, !tbaa !31
  %272 = icmp slt i32 %271, 2
  br i1 %272, label %273, label %310

273:                                              ; preds = %270
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %274 = load ptr, ptr %3, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.AF_CJKMetricsRec_, ptr %274, i32 0, i32 2
  %276 = load i32, ptr %8, align 4, !tbaa !31
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [2 x %struct.AF_CJKAxisRec_], ptr %275, i64 0, i64 %277
  store ptr %278, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %279 = load ptr, ptr %25, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.AF_CJKAxisRec_, ptr %279, i32 0, i32 2
  %281 = load i32, ptr %280, align 8, !tbaa !17
  %282 = icmp ugt i32 %281, 0
  br i1 %282, label %283, label %289

283:                                              ; preds = %273
  %284 = load ptr, ptr %25, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.AF_CJKAxisRec_, ptr %284, i32 0, i32 3
  %286 = getelementptr inbounds [16 x %struct.AF_WidthRec_], ptr %285, i64 0, i64 0
  %287 = getelementptr inbounds %struct.AF_WidthRec_, ptr %286, i32 0, i32 0
  %288 = load i64, ptr %287, align 8, !tbaa !55
  br label %296

289:                                              ; preds = %273
  %290 = load ptr, ptr %3, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.AF_LatinMetricsRec_, ptr %290, i32 0, i32 1
  %292 = load i32, ptr %291, align 8, !tbaa !59
  %293 = zext i32 %292 to i64
  %294 = mul nsw i64 50, %293
  %295 = sdiv i64 %294, 2048
  br label %296

296:                                              ; preds = %289, %283
  %297 = phi i64 [ %288, %283 ], [ %295, %289 ]
  store i64 %297, ptr %26, align 8, !tbaa !27
  %298 = load i64, ptr %26, align 8, !tbaa !27
  %299 = sdiv i64 %298, 5
  %300 = load ptr, ptr %25, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.AF_CJKAxisRec_, ptr %300, i32 0, i32 4
  store i64 %299, ptr %301, align 8, !tbaa !61
  %302 = load i64, ptr %26, align 8, !tbaa !27
  %303 = load ptr, ptr %25, align 8, !tbaa !5
  %304 = getelementptr inbounds %struct.AF_CJKAxisRec_, ptr %303, i32 0, i32 5
  store i64 %302, ptr %304, align 8, !tbaa !62
  %305 = load ptr, ptr %25, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.AF_CJKAxisRec_, ptr %305, i32 0, i32 6
  store i8 0, ptr %306, align 8, !tbaa !63
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  br label %307

307:                                              ; preds = %296
  %308 = load i32, ptr %8, align 4, !tbaa !31
  %309 = add nsw i32 %308, 1
  store i32 %309, ptr %8, align 4, !tbaa !31
  br label %270, !llvm.loop !64

310:                                              ; preds = %270
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 30768, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %311

311:                                              ; preds = %310
  br label %312

312:                                              ; preds = %311
  br label %313

313:                                              ; preds = %312
  %314 = getelementptr inbounds [1 x %struct.AF_GlyphHintsRec_], ptr %5, i64 0, i64 0
  call void @af_glyph_hints_done(ptr noundef %314)
  call void @llvm.lifetime.end.p0(i64 12904, ptr %5) #4
  ret void

315:                                              ; preds = %262, %98
  unreachable
}

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

declare hidden void @af_glyph_hints_init(ptr noundef, ptr noundef) #2

declare ptr @af_shaper_get_cluster(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i64 @af_shaper_get_elem(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

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

declare void @af_shaper_buf_destroy(ptr noundef, ptr noundef) #2

declare i32 @FT_Load_Glyph(ptr noundef, i32 noundef, i32 noundef) #2

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

declare hidden void @af_glyph_hints_rescale(ptr noundef, ptr noundef) #2

declare hidden i32 @af_glyph_hints_reload(ptr noundef, ptr noundef) #2

declare hidden i32 @af_latin_hints_compute_segments(ptr noundef, i32 noundef) #2

declare hidden void @af_latin_hints_link_segments(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #2

declare hidden void @af_sort_and_quantize_widths(ptr noundef, ptr noundef, i64 noundef) #2

declare hidden void @af_glyph_hints_done(ptr noundef) #2

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }

!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, !6, i64 184}
!10 = !{!"FT_FaceRec_", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !6, i64 40, !6, i64 48, !12, i64 56, !6, i64 64, !12, i64 72, !6, i64 80, !13, i64 88, !14, i64 104, !15, i64 136, !15, i64 138, !15, i64 140, !15, i64 142, !15, i64 144, !15, i64 146, !15, i64 148, !15, i64 150, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !16, i64 200, !13, i64 216, !6, i64 232, !6, i64 240}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"FT_Generic_", !6, i64 0, !6, i64 8}
!14 = !{!"FT_BBox_", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!15 = !{!"short", !7, i64 0}
!16 = !{!"FT_ListRec_", !6, i64 0, !6, i64 8}
!17 = !{!18, !12, i64 16}
!18 = !{!"AF_CJKAxisRec_", !11, i64 0, !11, i64 8, !12, i64 16, !7, i64 24, !11, i64 408, !11, i64 416, !7, i64 424, !7, i64 425, !12, i64 428, !7, i64 432, !11, i64 15328, !11, i64 15336}
!19 = !{!20, !6, i64 0}
!20 = !{!"AF_CJKMetricsRec_", !21, i64 0, !12, i64 72, !7, i64 80}
!21 = !{!"AF_StyleMetricsRec_", !6, i64 0, !22, i64 8, !7, i64 56, !6, i64 64}
!22 = !{!"AF_ScalerRec_", !6, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !12, i64 40, !12, i64 44}
!23 = !{!24, !12, i64 8}
!24 = !{!"AF_StyleClassRec_", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16}
!25 = !{!26, !6, i64 32}
!26 = !{!"AF_ScriptClassRec_", !12, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !6, i64 32}
!27 = !{!11, !11, i64 0}
!28 = !{!7, !7, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!12, !12, i64 0}
!32 = distinct !{!32, !30}
!33 = !{!10, !6, i64 152}
!34 = !{!35, !15, i64 202}
!35 = !{!"FT_GlyphSlotRec_", !6, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !13, i64 32, !36, i64 48, !11, i64 112, !11, i64 120, !37, i64 128, !12, i64 144, !38, i64 152, !12, i64 192, !12, i64 196, !39, i64 200, !12, i64 240, !6, i64 248, !6, i64 256, !11, i64 264, !11, i64 272, !11, i64 280, !6, i64 288, !6, i64 296}
!36 = !{!"FT_Glyph_Metrics_", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56}
!37 = !{!"FT_Vector_", !11, i64 0, !11, i64 8}
!38 = !{!"FT_Bitmap_", !12, i64 0, !12, i64 4, !12, i64 8, !6, i64 16, !15, i64 24, !7, i64 26, !7, i64 27, !6, i64 32}
!39 = !{!"FT_Outline_", !15, i64 0, !15, i64 2, !6, i64 8, !6, i64 16, !6, i64 24, !12, i64 32}
!40 = !{!20, !12, i64 72}
!41 = !{!22, !11, i64 8}
!42 = !{!22, !11, i64 16}
!43 = !{!22, !11, i64 24}
!44 = !{!22, !11, i64 32}
!45 = !{!22, !6, i64 0}
!46 = !{!22, !12, i64 40}
!47 = !{!22, !12, i64 44}
!48 = !{!49, !6, i64 8}
!49 = !{!"AF_AxisHintsRec_", !12, i64 0, !12, i64 4, !6, i64 8, !12, i64 16, !12, i64 20, !6, i64 24, !12, i64 32, !50, i64 40}
!50 = !{!"", !7, i64 0, !7, i64 1440}
!51 = !{!49, !12, i64 0}
!52 = !{!53, !6, i64 32}
!53 = !{!"AF_SegmentRec_", !7, i64 0, !7, i64 1, !15, i64 2, !15, i64 4, !15, i64 6, !15, i64 8, !15, i64 10, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !11, i64 48, !11, i64 56, !6, i64 64, !6, i64 72}
!54 = !{!53, !15, i64 2}
!55 = !{!56, !11, i64 0}
!56 = !{!"AF_WidthRec_", !11, i64 0, !11, i64 8, !11, i64 16}
!57 = distinct !{!57, !30}
!58 = distinct !{!58, !30}
!59 = !{!60, !12, i64 72}
!60 = !{!"AF_LatinMetricsRec_", !21, i64 0, !12, i64 72, !7, i64 80}
!61 = !{!18, !11, i64 408}
!62 = !{!18, !11, i64 416}
!63 = !{!18, !7, i64 424}
!64 = distinct !{!64, !30}


; 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.AF_GlyphHintsRec_ = type { ptr, i64, i64, i64, i64, i32, i32, ptr, i32, i32, ptr, [2 x %struct.AF_AxisHintsRec_], i32, i32, ptr, %struct.anon.0 }
%struct.AF_AxisHintsRec_ = type { i32, i32, ptr, i32, i32, ptr, i32, %struct.anon }
%struct.anon = type { [18 x %struct.AF_SegmentRec_], [12 x %struct.AF_EdgeRec_] }
%struct.AF_SegmentRec_ = type { i8, i8, i16, i16, i16, i16, i16, ptr, ptr, ptr, ptr, i64, i64, ptr, ptr }
%struct.AF_EdgeRec_ = type { i16, i64, i64, i8, i8, i64, ptr, ptr, ptr, i32, ptr, ptr }
%struct.anon.0 = type { [8 x ptr], [96 x %struct.AF_PointRec_] }
%struct.AF_PointRec_ = type { i16, i8, i8, i64, i64, i16, i16, i64, i64, i64, i64, ptr, ptr }
%struct.AF_CJKMetricsRec_ = type { %struct.AF_StyleMetricsRec_, i32, [2 x %struct.AF_CJKAxisRec_] }
%struct.AF_StyleMetricsRec_ = type { ptr, %struct.AF_ScalerRec_, i8, ptr }
%struct.AF_ScalerRec_ = type { ptr, i64, i64, i64, i64, i32, i32 }
%struct.AF_CJKAxisRec_ = type { i64, i64, i32, [16 x %struct.AF_WidthRec_], i64, i64, i8, i8, i32, [266 x %struct.AF_CJKBlueRec_], i64, i64 }
%struct.AF_WidthRec_ = type { i64, i64, i64 }
%struct.AF_CJKBlueRec_ = type { %struct.AF_WidthRec_, %struct.AF_WidthRec_, i32 }

@af_script_classes = external hidden local_unnamed_addr constant [0 x ptr], align 8

; Function Attrs: nounwind uwtable
define hidden void @af_cjk_metrics_init_widths(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca [1 x %struct.AF_GlyphHintsRec_], align 16
  %4 = alloca [1 x %struct.AF_CJKMetricsRec_], align 16
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 12904, ptr nonnull %3) #5
  %8 = getelementptr inbounds i8, ptr %1, i64 184
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  call void @af_glyph_hints_init(ptr noundef nonnull %3, ptr noundef %9) #5
  %10 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 0, ptr %10, align 8, !tbaa !16
  %11 = getelementptr inbounds i8, ptr %0, i64 15440
  store i32 0, ptr %11, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 30768, ptr nonnull %4) #5
  %12 = getelementptr inbounds i8, ptr %4, i64 8
  %13 = load ptr, ptr %0, align 8, !tbaa !18
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = load i32, ptr %14, align 4, !tbaa !22
  %16 = zext i32 %15 to i64
  %17 = getelementptr inbounds [0 x ptr], ptr @af_script_classes, i64 0, i64 %16
  %18 = load ptr, ptr %17, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %19 = getelementptr inbounds i8, ptr %18, i64 32
  %20 = load ptr, ptr %19, align 8, !tbaa !25
  %21 = load i8, ptr %20, align 1, !tbaa !27
  %.not119 = icmp eq i8 %21, 0
  br i1 %.not119, label %._crit_edge123, label %.lr.ph122

.lr.ph122:                                        ; preds = %2, %select.unfold
  %.079120 = phi ptr [ %27, %select.unfold ], [ %20, %2 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  br label %22

22:                                               ; preds = %22, %.lr.ph122
  %.180 = phi ptr [ %.079120, %.lr.ph122 ], [ %25, %22 ]
  %23 = load i8, ptr %.180, align 1, !tbaa !27
  %24 = icmp eq i8 %23, 32
  %25 = getelementptr inbounds i8, ptr %.180, i64 1
  br i1 %24, label %22, label %26, !llvm.loop !28

26:                                               ; preds = %22
  %27 = call ptr @af_shaper_get_cluster(ptr noundef nonnull %.180, ptr noundef nonnull %0, ptr noundef nonnull %5, ptr noundef nonnull %6) #5
  %28 = load i32, ptr %6, align 4, !tbaa !30
  %29 = icmp ugt i32 %28, 1
  br i1 %29, label %select.unfold, label %30, !llvm.loop !31

30:                                               ; preds = %26
  %31 = call i64 @af_shaper_get_elem(ptr noundef nonnull %0, ptr noundef nonnull %5, i32 noundef 0, ptr noundef null, ptr noundef null) #5
  %.not90 = icmp eq i64 %31, 0
  br i1 %.not90, label %select.unfold, label %.thread112

.thread112:                                       ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @af_shaper_buf_destroy(ptr noundef %1, ptr noundef nonnull %5) #5
  %32 = trunc i64 %31 to i32
  %33 = call i32 @FT_Load_Glyph(ptr noundef %1, i32 noundef %32, i32 noundef 1) #5
  %.not92 = icmp eq i32 %33, 0
  br i1 %.not92, label %35, label %.loopexit

select.unfold:                                    ; preds = %30, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  %34 = load i8, ptr %27, align 1, !tbaa !27
  %.not = icmp eq i8 %34, 0
  br i1 %.not, label %._crit_edge123, label %.lr.ph122

._crit_edge123:                                   ; preds = %select.unfold, %2
  call void @af_shaper_buf_destroy(ptr noundef %1, ptr noundef nonnull %5) #5
  br label %.loopexit

35:                                               ; preds = %.thread112
  %36 = getelementptr inbounds i8, ptr %1, i64 152
  %37 = load ptr, ptr %36, align 8, !tbaa !32
  %38 = getelementptr inbounds i8, ptr %37, i64 202
  %39 = load i16, ptr %38, align 2, !tbaa !33
  %40 = icmp slt i16 %39, 1
  br i1 %40, label %.loopexit, label %41

41:                                               ; preds = %35
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(30768) %4, i8 0, i64 30768, i1 false)
  %42 = getelementptr inbounds i8, ptr %0, i64 72
  %43 = load i32, ptr %42, align 8, !tbaa !39
  %44 = getelementptr inbounds i8, ptr %4, i64 72
  store i32 %43, ptr %44, align 8, !tbaa !39
  %45 = getelementptr inbounds i8, ptr %4, i64 16
  store i64 65536, ptr %45, align 16, !tbaa !40
  %46 = getelementptr inbounds i8, ptr %4, i64 24
  store i64 65536, ptr %46, align 8, !tbaa !41
  %47 = getelementptr inbounds i8, ptr %4, i64 32
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %47, i8 0, i64 16, i1 false)
  store ptr %1, ptr %12, align 8, !tbaa !42
  %48 = getelementptr inbounds i8, ptr %4, i64 52
  store i32 0, ptr %48, align 4, !tbaa !43
  call void @af_glyph_hints_rescale(ptr noundef nonnull %3, ptr noundef nonnull %4) #5
  %49 = load ptr, ptr %36, align 8, !tbaa !32
  %50 = getelementptr inbounds i8, ptr %49, i64 200
  %51 = call i32 @af_glyph_hints_reload(ptr noundef nonnull %3, ptr noundef nonnull %50) #5
  %.not93 = icmp eq i32 %51, 0
  br i1 %.not93, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  store i32 0, ptr %7, align 4, !tbaa !30
  %52 = call i32 @af_latin_hints_compute_segments(ptr noundef nonnull %3, i32 noundef 0) #5
  %.not94 = icmp eq i32 %52, 0
  br i1 %.not94, label %53, label %88

53:                                               ; preds = %.preheader
  %54 = getelementptr inbounds i8, ptr %3, i64 72
  call void @af_latin_hints_link_segments(ptr noundef nonnull %3, i32 noundef 0, ptr noundef null, i32 noundef 0) #5
  %55 = getelementptr inbounds i8, ptr %3, i64 80
  %56 = load ptr, ptr %55, align 16, !tbaa !44
  %57 = load i32, ptr %54, align 8, !tbaa !47
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds %struct.AF_SegmentRec_, ptr %56, i64 %58
  %.not106 = icmp eq i32 %57, 0
  br i1 %.not106, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %53
  %60 = getelementptr inbounds i8, ptr %0, i64 104
  %.promoted = load i32, ptr %7, align 4, !tbaa !30
  br label %61

61:                                               ; preds = %.lr.ph, %83
  %62 = phi i32 [ %.promoted, %.lr.ph ], [ %84, %83 ]
  %.081102 = phi ptr [ %56, %.lr.ph ], [ %86, %83 ]
  %63 = phi i32 [ 0, %.lr.ph ], [ %85, %83 ]
  %64 = getelementptr inbounds i8, ptr %.081102, i64 32
  %65 = load ptr, ptr %64, align 8, !tbaa !48
  %.not95 = icmp eq ptr %65, null
  br i1 %.not95, label %83, label %66

66:                                               ; preds = %61
  %67 = getelementptr inbounds i8, ptr %65, i64 32
  %68 = load ptr, ptr %67, align 8, !tbaa !48
  %69 = icmp eq ptr %68, %.081102
  %70 = icmp ugt ptr %65, %.081102
  %or.cond = and i1 %70, %69
  %71 = icmp ult i32 %63, 16
  %or.cond105 = select i1 %or.cond, i1 %71, i1 false
  br i1 %or.cond105, label %72, label %83

72:                                               ; preds = %66
  %73 = getelementptr inbounds i8, ptr %.081102, i64 2
  %74 = load i16, ptr %73, align 2, !tbaa !50
  %75 = sext i16 %74 to i64
  %76 = getelementptr inbounds i8, ptr %65, i64 2
  %77 = load i16, ptr %76, align 2, !tbaa !50
  %78 = sext i16 %77 to i64
  %79 = sub nsw i64 %75, %78
  %spec.select = call i64 @llvm.abs.i64(i64 %79, i1 true)
  %80 = add nuw nsw i32 %63, 1
  %81 = zext nneg i32 %63 to i64
  %82 = getelementptr inbounds [16 x %struct.AF_WidthRec_], ptr %60, i64 0, i64 %81
  store i64 %spec.select, ptr %82, align 8, !tbaa !51
  br label %83

83:                                               ; preds = %72, %61, %66
  %84 = phi i32 [ %80, %72 ], [ %62, %61 ], [ %62, %66 ]
  %85 = phi i32 [ %80, %72 ], [ %63, %61 ], [ %63, %66 ]
  %86 = getelementptr inbounds i8, ptr %.081102, i64 80
  %87 = icmp ult ptr %86, %59
  br i1 %87, label %61, label %._crit_edge.loopexit, !llvm.loop !53

88:                                               ; preds = %._crit_edge, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  br label %.loopexit

._crit_edge.loopexit:                             ; preds = %83
  store i32 %84, ptr %7, align 4, !tbaa !30
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %53
  %89 = getelementptr inbounds i8, ptr %0, i64 104
  %90 = load i32, ptr %44, align 8, !tbaa !39
  %91 = udiv i32 %90, 100
  %92 = zext nneg i32 %91 to i64
  call void @af_sort_and_quantize_widths(ptr noundef nonnull %7, ptr noundef nonnull %89, i64 noundef %92) #5
  %93 = load i32, ptr %7, align 4, !tbaa !30
  %94 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 %93, ptr %94, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  store i32 0, ptr %7, align 4, !tbaa !30
  %95 = call i32 @af_latin_hints_compute_segments(ptr noundef nonnull %3, i32 noundef 1) #5
  %.not94.1 = icmp eq i32 %95, 0
  br i1 %.not94.1, label %96, label %88

96:                                               ; preds = %._crit_edge
  %97 = getelementptr inbounds i8, ptr %3, i64 2608
  call void @af_latin_hints_link_segments(ptr noundef nonnull %3, i32 noundef 0, ptr noundef null, i32 noundef 1) #5
  %98 = getelementptr inbounds i8, ptr %3, i64 2616
  %99 = load ptr, ptr %98, align 8, !tbaa !44
  %100 = load i32, ptr %97, align 16, !tbaa !47
  %101 = zext i32 %100 to i64
  %102 = getelementptr inbounds %struct.AF_SegmentRec_, ptr %99, i64 %101
  %.not106.1 = icmp eq i32 %100, 0
  br i1 %.not106.1, label %._crit_edge.1, label %.lr.ph.1

.lr.ph.1:                                         ; preds = %96
  %.promoted.1 = load i32, ptr %7, align 4, !tbaa !30
  %103 = getelementptr inbounds i8, ptr %0, i64 15448
  br label %104

104:                                              ; preds = %125, %.lr.ph.1
  %.081102.1 = phi ptr [ %99, %.lr.ph.1 ], [ %127, %125 ]
  %105 = phi i32 [ %.promoted.1, %.lr.ph.1 ], [ %126, %125 ]
  %106 = getelementptr inbounds i8, ptr %.081102.1, i64 32
  %107 = load ptr, ptr %106, align 8, !tbaa !48
  %.not95.1 = icmp eq ptr %107, null
  br i1 %.not95.1, label %125, label %108

108:                                              ; preds = %104
  %109 = getelementptr inbounds i8, ptr %107, i64 32
  %110 = load ptr, ptr %109, align 8, !tbaa !48
  %111 = icmp eq ptr %110, %.081102.1
  %112 = icmp ugt ptr %107, %.081102.1
  %or.cond.1 = and i1 %112, %111
  %113 = icmp ult i32 %105, 16
  %or.cond105.1 = select i1 %or.cond.1, i1 %113, i1 false
  br i1 %or.cond105.1, label %114, label %125

114:                                              ; preds = %108
  %115 = getelementptr inbounds i8, ptr %.081102.1, i64 2
  %116 = load i16, ptr %115, align 2, !tbaa !50
  %117 = sext i16 %116 to i64
  %118 = getelementptr inbounds i8, ptr %107, i64 2
  %119 = load i16, ptr %118, align 2, !tbaa !50
  %120 = sext i16 %119 to i64
  %121 = sub nsw i64 %117, %120
  %spec.select.1 = call i64 @llvm.abs.i64(i64 %121, i1 true)
  %122 = add nuw nsw i32 %105, 1
  store i32 %122, ptr %7, align 4, !tbaa !30
  %123 = zext nneg i32 %105 to i64
  %124 = getelementptr inbounds [16 x %struct.AF_WidthRec_], ptr %103, i64 0, i64 %123
  store i64 %spec.select.1, ptr %124, align 8, !tbaa !51
  br label %125

125:                                              ; preds = %114, %108, %104
  %126 = phi i32 [ %122, %114 ], [ %105, %104 ], [ %105, %108 ]
  %127 = getelementptr inbounds i8, ptr %.081102.1, i64 80
  %128 = icmp ult ptr %127, %102
  br i1 %128, label %104, label %._crit_edge.1, !llvm.loop !53

._crit_edge.1:                                    ; preds = %125, %96
  %129 = getelementptr inbounds i8, ptr %0, i64 15448
  %130 = load i32, ptr %44, align 8, !tbaa !39
  %131 = udiv i32 %130, 100
  %132 = zext nneg i32 %131 to i64
  call void @af_sort_and_quantize_widths(ptr noundef nonnull %7, ptr noundef nonnull %129, i64 noundef %132) #5
  %133 = load i32, ptr %7, align 4, !tbaa !30
  %134 = getelementptr inbounds i8, ptr %0, i64 15440
  store i32 %133, ptr %134, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  br label %.loopexit

.loopexit:                                        ; preds = %._crit_edge123, %._crit_edge.1, %88, %41, %.thread112, %35
  %135 = getelementptr inbounds i8, ptr %0, i64 72
  %136 = getelementptr inbounds i8, ptr %0, i64 96
  %137 = load i32, ptr %136, align 8, !tbaa !16
  %.not96 = icmp eq i32 %137, 0
  br i1 %.not96, label %141, label %138

138:                                              ; preds = %.loopexit
  %139 = getelementptr inbounds i8, ptr %0, i64 104
  %140 = load i64, ptr %139, align 8, !tbaa !51
  br label %146

141:                                              ; preds = %.loopexit
  %142 = load i32, ptr %135, align 8, !tbaa !54
  %143 = zext i32 %142 to i64
  %144 = mul nuw nsw i64 %143, 50
  %145 = lshr i64 %144, 11
  br label %146

146:                                              ; preds = %141, %138
  %147 = phi i64 [ %140, %138 ], [ %145, %141 ]
  %148 = sdiv i64 %147, 5
  %149 = getelementptr inbounds i8, ptr %0, i64 488
  store i64 %148, ptr %149, align 8, !tbaa !56
  %150 = getelementptr inbounds i8, ptr %0, i64 496
  store i64 %147, ptr %150, align 8, !tbaa !57
  %151 = getelementptr inbounds i8, ptr %0, i64 504
  store i8 0, ptr %151, align 8, !tbaa !58
  %152 = getelementptr inbounds i8, ptr %0, i64 15440
  %153 = load i32, ptr %152, align 8, !tbaa !16
  %.not96.1 = icmp eq i32 %153, 0
  br i1 %.not96.1, label %157, label %154

154:                                              ; preds = %146
  %155 = getelementptr inbounds i8, ptr %0, i64 15448
  %156 = load i64, ptr %155, align 8, !tbaa !51
  br label %162

157:                                              ; preds = %146
  %158 = load i32, ptr %135, align 8, !tbaa !54
  %159 = zext i32 %158 to i64
  %160 = mul nuw nsw i64 %159, 50
  %161 = lshr i64 %160, 11
  br label %162

162:                                              ; preds = %157, %154
  %163 = phi i64 [ %156, %154 ], [ %161, %157 ]
  %164 = sdiv i64 %163, 5
  %165 = getelementptr inbounds i8, ptr %0, i64 15832
  store i64 %164, ptr %165, align 8, !tbaa !56
  %166 = getelementptr inbounds i8, ptr %0, i64 15840
  store i64 %163, ptr %166, align 8, !tbaa !57
  %167 = getelementptr inbounds i8, ptr %0, i64 15848
  store i8 0, ptr %167, align 8, !tbaa !58
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 30768, ptr nonnull %4) #5
  call void @af_glyph_hints_done(ptr noundef nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 12904, ptr nonnull %3) #5
  ret void
}

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

declare hidden void @af_glyph_hints_init(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @af_shaper_get_cluster(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i64 @af_shaper_get_elem(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @af_shaper_buf_destroy(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @FT_Load_Glyph(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

declare hidden void @af_glyph_hints_rescale(ptr noundef, ptr noundef) local_unnamed_addr #2

declare hidden i32 @af_glyph_hints_reload(ptr noundef, ptr noundef) local_unnamed_addr #2

declare hidden i32 @af_latin_hints_compute_segments(ptr noundef, i32 noundef) local_unnamed_addr #2

declare hidden void @af_latin_hints_link_segments(ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare hidden void @af_sort_and_quantize_widths(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare hidden void @af_glyph_hints_done(ptr noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #4

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !10, i64 184}
!6 = !{!"FT_FaceRec_", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 48, !11, i64 56, !10, i64 64, !11, i64 72, !10, i64 80, !12, i64 88, !13, i64 104, !14, i64 136, !14, i64 138, !14, i64 140, !14, i64 142, !14, i64 144, !14, i64 146, !14, i64 148, !14, i64 150, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !15, i64 200, !12, i64 216, !10, i64 232, !10, i64 240}
!7 = !{!"long", !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 = !{!"FT_Generic_", !10, i64 0, !10, i64 8}
!13 = !{!"FT_BBox_", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!14 = !{!"short", !8, i64 0}
!15 = !{!"FT_ListRec_", !10, i64 0, !10, i64 8}
!16 = !{!17, !11, i64 16}
!17 = !{!"AF_CJKAxisRec_", !7, i64 0, !7, i64 8, !11, i64 16, !8, i64 24, !7, i64 408, !7, i64 416, !8, i64 424, !8, i64 425, !11, i64 428, !8, i64 432, !7, i64 15328, !7, i64 15336}
!18 = !{!19, !10, i64 0}
!19 = !{!"AF_CJKMetricsRec_", !20, i64 0, !11, i64 72, !8, i64 80}
!20 = !{!"AF_StyleMetricsRec_", !10, i64 0, !21, i64 8, !8, i64 56, !10, i64 64}
!21 = !{!"AF_ScalerRec_", !10, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !11, i64 40, !11, i64 44}
!22 = !{!23, !11, i64 8}
!23 = !{!"AF_StyleClassRec_", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16}
!24 = !{!10, !10, i64 0}
!25 = !{!26, !10, i64 32}
!26 = !{!"AF_ScriptClassRec_", !11, i64 0, !10, i64 8, !10, i64 16, !8, i64 24, !10, i64 32}
!27 = !{!8, !8, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!11, !11, i64 0}
!31 = distinct !{!31, !29}
!32 = !{!6, !10, i64 152}
!33 = !{!34, !14, i64 202}
!34 = !{!"FT_GlyphSlotRec_", !10, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !12, i64 32, !35, i64 48, !7, i64 112, !7, i64 120, !36, i64 128, !11, i64 144, !37, i64 152, !11, i64 192, !11, i64 196, !38, i64 200, !11, i64 240, !10, i64 248, !10, i64 256, !7, i64 264, !7, i64 272, !7, i64 280, !10, i64 288, !10, i64 296}
!35 = !{!"FT_Glyph_Metrics_", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56}
!36 = !{!"FT_Vector_", !7, i64 0, !7, i64 8}
!37 = !{!"FT_Bitmap_", !11, i64 0, !11, i64 4, !11, i64 8, !10, i64 16, !14, i64 24, !8, i64 26, !8, i64 27, !10, i64 32}
!38 = !{!"FT_Outline_", !14, i64 0, !14, i64 2, !10, i64 8, !10, i64 16, !10, i64 24, !11, i64 32}
!39 = !{!19, !11, i64 72}
!40 = !{!21, !7, i64 8}
!41 = !{!21, !7, i64 16}
!42 = !{!21, !10, i64 0}
!43 = !{!21, !11, i64 44}
!44 = !{!45, !10, i64 8}
!45 = !{!"AF_AxisHintsRec_", !11, i64 0, !11, i64 4, !10, i64 8, !11, i64 16, !11, i64 20, !10, i64 24, !11, i64 32, !46, i64 40}
!46 = !{!"", !8, i64 0, !8, i64 1440}
!47 = !{!45, !11, i64 0}
!48 = !{!49, !10, i64 32}
!49 = !{!"AF_SegmentRec_", !8, i64 0, !8, i64 1, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8, !14, i64 10, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !7, i64 48, !7, i64 56, !10, i64 64, !10, i64 72}
!50 = !{!49, !14, i64 2}
!51 = !{!52, !7, i64 0}
!52 = !{!"AF_WidthRec_", !7, i64 0, !7, i64 8, !7, i64 16}
!53 = distinct !{!53, !29}
!54 = !{!55, !11, i64 72}
!55 = !{!"AF_LatinMetricsRec_", !20, i64 0, !11, i64 72, !8, i64 80}
!56 = !{!17, !7, i64 408}
!57 = !{!17, !7, i64 416}
!58 = !{!17, !8, i64 424}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass