; LLVM IR from caryll/otfcc :: lib/table (hmtx)

; 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.__caryll_elementinterface_table_hmtx = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otfcc_Packet = type { i32, i16, i16, i16, i16, ptr }
%struct.otfcc_PacketPiece = type { i32, i32, i32, i32, ptr }
%struct.table_hhea = type { i32, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, [4 x i16], i16, i16 }
%struct.table_maxp = type { i32, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
%struct.table_hmtx = type { ptr, ptr }
%struct.horizontal_metric = type { double, double }
%struct.otfcc_Options = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, ptr, ptr }
%struct.otfcc_ILogger = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@table_iHmtx = external dso_local constant %struct.__caryll_elementinterface_table_hmtx, align 8
@.str = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_readHmtx(ptr noundef byval(%struct.otfcc_Packet) align 8 %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.otfcc_PacketPiece, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i16, align 2
  %19 = alloca i16, align 2
  %20 = alloca i16, align 2
  %21 = alloca i16, align 2
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %42

24:                                               ; preds = %4
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %42

27:                                               ; preds = %24
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.table_hhea, ptr %28, i32 0, i32 13
  %30 = load i16, ptr %29, align 2, !tbaa !9
  %31 = icmp ne i16 %30, 0
  br i1 %31, label %32, label %42

32:                                               ; preds = %27
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.table_maxp, ptr %33, i32 0, i32 1
  %35 = load i16, ptr %34, align 4, !tbaa !13
  %36 = zext i16 %35 to i32
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.table_hhea, ptr %37, i32 0, i32 13
  %39 = load i16, ptr %38, align 2, !tbaa !9
  %40 = zext i16 %39 to i32
  %41 = icmp slt i32 %36, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %32, %27, %24, %4
  store ptr null, ptr %5, align 8
  br label %238

43:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !15
  br label %44

44:                                               ; preds = %228, %43
  %45 = load i32, ptr %11, align 4, !tbaa !15
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %56

47:                                               ; preds = %44
  %48 = load i32, ptr %9, align 4, !tbaa !15
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %56

50:                                               ; preds = %47
  %51 = load i32, ptr %10, align 4, !tbaa !15
  %52 = getelementptr inbounds %struct.otfcc_Packet, ptr %0, i32 0, i32 1
  %53 = load i16, ptr %52, align 4, !tbaa !16
  %54 = zext i16 %53 to i32
  %55 = icmp slt i32 %51, %54
  br label %56

56:                                               ; preds = %50, %47, %44
  %57 = phi i1 [ false, %47 ], [ false, %44 ], [ %55, %50 ]
  br i1 %57, label %59, label %58

58:                                               ; preds = %56
  store i32 2, ptr %12, align 4
  br label %235

59:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  %60 = getelementptr inbounds %struct.otfcc_Packet, ptr %0, i32 0, i32 5
  %61 = load ptr, ptr %60, align 8, !tbaa !18
  %62 = load i32, ptr %10, align 4, !tbaa !15
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %61, i64 %63
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %64, i64 24, i1 false), !tbaa.struct !19
  br label %65

65:                                               ; preds = %220, %59
  %66 = load i32, ptr %9, align 4, !tbaa !15
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %69, label %68

68:                                               ; preds = %65
  store i32 5, ptr %12, align 4
  br label %225

69:                                               ; preds = %65
  %70 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %13, i32 0, i32 0
  %71 = load i32, ptr %70, align 8, !tbaa !20
  %72 = icmp eq i32 %71, 1752003704
  br i1 %72, label %73, label %219

73:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 1, ptr %14, align 4, !tbaa !15
  br label %74

74:                                               ; preds = %215, %73
  %75 = load i32, ptr %14, align 4, !tbaa !15
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %78, label %77

77:                                               ; preds = %74
  store i32 8, ptr %12, align 4
  br label %216

78:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %79 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %13, i32 0, i32 4
  %80 = load ptr, ptr %79, align 8, !tbaa !22
  store ptr %80, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %81 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %13, i32 0, i32 3
  %82 = load i32, ptr %81, align 4, !tbaa !23
  store i32 %82, ptr %16, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store ptr null, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #5
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.table_hhea, ptr %83, i32 0, i32 13
  %85 = load i16, ptr %84, align 2, !tbaa !9
  store i16 %85, ptr %18, align 2, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 2, ptr %19) #5
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.table_maxp, ptr %86, i32 0, i32 1
  %88 = load i16, ptr %87, align 4, !tbaa !13
  %89 = zext i16 %88 to i32
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.table_hhea, ptr %90, i32 0, i32 13
  %92 = load i16, ptr %91, align 2, !tbaa !9
  %93 = zext i16 %92 to i32
  %94 = sub nsw i32 %89, %93
  %95 = trunc i32 %94 to i16
  store i16 %95, ptr %19, align 2, !tbaa !24
  %96 = load i32, ptr %16, align 4, !tbaa !15
  %97 = load i16, ptr %18, align 2, !tbaa !24
  %98 = zext i16 %97 to i32
  %99 = mul nsw i32 %98, 4
  %100 = load i16, ptr %19, align 2, !tbaa !24
  %101 = zext i16 %100 to i32
  %102 = mul nsw i32 %101, 2
  %103 = add nsw i32 %99, %102
  %104 = icmp ult i32 %96, %103
  br i1 %104, label %105, label %106

105:                                              ; preds = %78
  br label %195

106:                                              ; preds = %78
  %107 = call ptr @__caryll_allocate_clean(i64 noundef 16, i64 noundef 27)
  store ptr %107, ptr %17, align 8, !tbaa !5
  %108 = load i16, ptr %18, align 2, !tbaa !24
  %109 = zext i16 %108 to i64
  %110 = mul i64 16, %109
  %111 = call ptr @__caryll_allocate_clean(i64 noundef %110, i64 noundef 28)
  %112 = load ptr, ptr %17, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.table_hmtx, ptr %112, i32 0, i32 0
  store ptr %111, ptr %113, align 8, !tbaa !25
  %114 = load i16, ptr %19, align 2, !tbaa !24
  %115 = zext i16 %114 to i64
  %116 = mul i64 8, %115
  %117 = call ptr @__caryll_allocate_clean(i64 noundef %116, i64 noundef 29)
  %118 = load ptr, ptr %17, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.table_hmtx, ptr %118, i32 0, i32 1
  store ptr %117, ptr %119, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 2, ptr %20) #5
  store i16 0, ptr %20, align 2, !tbaa !24
  br label %120

120:                                              ; preds = %159, %106
  %121 = load i16, ptr %20, align 2, !tbaa !24
  %122 = zext i16 %121 to i32
  %123 = load i16, ptr %18, align 2, !tbaa !24
  %124 = zext i16 %123 to i32
  %125 = icmp slt i32 %122, %124
  br i1 %125, label %127, label %126

126:                                              ; preds = %120
  store i32 12, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %20) #5
  br label %162

127:                                              ; preds = %120
  %128 = load ptr, ptr %15, align 8, !tbaa !5
  %129 = load i16, ptr %20, align 2, !tbaa !24
  %130 = zext i16 %129 to i32
  %131 = mul nsw i32 %130, 4
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds i8, ptr %128, i64 %132
  %134 = call zeroext i16 @read_16u(ptr noundef %133)
  %135 = uitofp i16 %134 to double
  %136 = load ptr, ptr %17, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.table_hmtx, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !25
  %139 = load i16, ptr %20, align 2, !tbaa !24
  %140 = zext i16 %139 to i64
  %141 = getelementptr inbounds %struct.horizontal_metric, ptr %138, i64 %140
  %142 = getelementptr inbounds %struct.horizontal_metric, ptr %141, i32 0, i32 0
  store double %135, ptr %142, align 8, !tbaa !28
  %143 = load ptr, ptr %15, align 8, !tbaa !5
  %144 = load i16, ptr %20, align 2, !tbaa !24
  %145 = zext i16 %144 to i32
  %146 = mul nsw i32 %145, 4
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds i8, ptr %143, i64 %147
  %149 = getelementptr inbounds i8, ptr %148, i64 2
  %150 = call signext i16 @read_16s(ptr noundef %149)
  %151 = sitofp i16 %150 to double
  %152 = load ptr, ptr %17, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.table_hmtx, ptr %152, i32 0, i32 0
  %154 = load ptr, ptr %153, align 8, !tbaa !25
  %155 = load i16, ptr %20, align 2, !tbaa !24
  %156 = zext i16 %155 to i64
  %157 = getelementptr inbounds %struct.horizontal_metric, ptr %154, i64 %156
  %158 = getelementptr inbounds %struct.horizontal_metric, ptr %157, i32 0, i32 1
  store double %151, ptr %158, align 8, !tbaa !31
  br label %159

159:                                              ; preds = %127
  %160 = load i16, ptr %20, align 2, !tbaa !24
  %161 = add i16 %160, 1
  store i16 %161, ptr %20, align 2, !tbaa !24
  br label %120, !llvm.loop !32

162:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 2, ptr %21) #5
  store i16 0, ptr %21, align 2, !tbaa !24
  br label %163

163:                                              ; preds = %190, %162
  %164 = load i16, ptr %21, align 2, !tbaa !24
  %165 = zext i16 %164 to i32
  %166 = load i16, ptr %19, align 2, !tbaa !24
  %167 = zext i16 %166 to i32
  %168 = icmp slt i32 %165, %167
  br i1 %168, label %170, label %169

169:                                              ; preds = %163
  store i32 15, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %21) #5
  br label %193

170:                                              ; preds = %163
  %171 = load ptr, ptr %15, align 8, !tbaa !5
  %172 = load i16, ptr %18, align 2, !tbaa !24
  %173 = zext i16 %172 to i32
  %174 = mul nsw i32 %173, 4
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds i8, ptr %171, i64 %175
  %177 = load i16, ptr %21, align 2, !tbaa !24
  %178 = zext i16 %177 to i32
  %179 = mul nsw i32 %178, 2
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds i8, ptr %176, i64 %180
  %182 = call signext i16 @read_16s(ptr noundef %181)
  %183 = sitofp i16 %182 to double
  %184 = load ptr, ptr %17, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.table_hmtx, ptr %184, i32 0, i32 1
  %186 = load ptr, ptr %185, align 8, !tbaa !27
  %187 = load i16, ptr %21, align 2, !tbaa !24
  %188 = zext i16 %187 to i64
  %189 = getelementptr inbounds double, ptr %186, i64 %188
  store double %183, ptr %189, align 8, !tbaa !34
  br label %190

190:                                              ; preds = %170
  %191 = load i16, ptr %21, align 2, !tbaa !24
  %192 = add i16 %191, 1
  store i16 %192, ptr %21, align 2, !tbaa !24
  br label %163, !llvm.loop !35

193:                                              ; preds = %169
  %194 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %194, ptr %5, align 8
  store i32 1, ptr %12, align 4
  br label %212

195:                                              ; preds = %105
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.otfcc_Options, ptr %196, i32 0, i32 24
  %198 = load ptr, ptr %197, align 8, !tbaa !36
  %199 = getelementptr inbounds %struct.otfcc_ILogger, ptr %198, i32 0, i32 6
  %200 = load ptr, ptr %199, align 8, !tbaa !39
  %201 = load ptr, ptr %6, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.otfcc_Options, ptr %201, i32 0, i32 24
  %203 = load ptr, ptr %202, align 8, !tbaa !36
  %204 = call ptr @sdsempty()
  %205 = call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %204, ptr noundef @.str)
  call void %200(ptr noundef %203, i8 noundef zeroext 1, i32 noundef 1, ptr noundef %205)
  %206 = load ptr, ptr %17, align 8, !tbaa !5
  %207 = icmp ne ptr %206, null
  br i1 %207, label %208, label %211

208:                                              ; preds = %195
  %209 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_table_hmtx, ptr @table_iHmtx, i32 0, i32 7), align 8, !tbaa !41
  %210 = load ptr, ptr %17, align 8, !tbaa !5
  call void %209(ptr noundef %210)
  store ptr null, ptr %17, align 8, !tbaa !5
  br label %211

211:                                              ; preds = %208, %195
  store i32 0, ptr %12, align 4
  br label %212

212:                                              ; preds = %211, %193
  call void @llvm.lifetime.end.p0(i64 2, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  %213 = load i32, ptr %12, align 4
  switch i32 %213, label %216 [
    i32 0, label %214
  ]

214:                                              ; preds = %212
  br label %215

215:                                              ; preds = %214
  store i32 0, ptr %14, align 4, !tbaa !15
  store i32 0, ptr %11, align 4, !tbaa !15
  br label %74, !llvm.loop !43

216:                                              ; preds = %212, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  %217 = load i32, ptr %12, align 4
  switch i32 %217, label %225 [
    i32 8, label %218
  ]

218:                                              ; preds = %216
  br label %219

219:                                              ; preds = %218, %69
  br label %220

220:                                              ; preds = %219
  %221 = load i32, ptr %9, align 4, !tbaa !15
  %222 = icmp ne i32 %221, 0
  %223 = xor i1 %222, true
  %224 = zext i1 %223 to i32
  store i32 %224, ptr %9, align 4, !tbaa !15
  br label %65, !llvm.loop !44

225:                                              ; preds = %216, %68
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  %226 = load i32, ptr %12, align 4
  switch i32 %226, label %235 [
    i32 5, label %227
  ]

227:                                              ; preds = %225
  br label %228

228:                                              ; preds = %227
  %229 = load i32, ptr %9, align 4, !tbaa !15
  %230 = icmp ne i32 %229, 0
  %231 = xor i1 %230, true
  %232 = zext i1 %231 to i32
  store i32 %232, ptr %9, align 4, !tbaa !15
  %233 = load i32, ptr %10, align 4, !tbaa !15
  %234 = add nsw i32 %233, 1
  store i32 %234, ptr %10, align 4, !tbaa !15
  br label %44, !llvm.loop !45

235:                                              ; preds = %225, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %236 = load i32, ptr %12, align 4
  switch i32 %236, label %240 [
    i32 2, label %237
    i32 1, label %238
  ]

237:                                              ; preds = %235
  store ptr null, ptr %5, align 8
  br label %238

238:                                              ; preds = %237, %235, %42
  %239 = load ptr, ptr %5, align 8
  ret ptr %239

240:                                              ; preds = %235
  unreachable
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @__caryll_allocate_clean(i64 noundef, i64 noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @read_16u(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden signext i16 @read_16s(ptr noundef) #3

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

declare ptr @sdscatprintf(ptr noundef, ptr noundef, ...) #4

declare ptr @sdsempty() #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { "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 #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !12, i64 34}
!10 = !{!"", !11, i64 0, !12, i64 4, !12, i64 6, !12, i64 8, !12, i64 10, !12, i64 12, !12, i64 14, !12, i64 16, !12, i64 18, !12, i64 20, !12, i64 22, !7, i64 24, !12, i64 32, !12, i64 34}
!11 = !{!"int", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !12, i64 4}
!14 = !{!"", !11, i64 0, !12, i64 4, !12, i64 6, !12, i64 8, !12, i64 10, !12, i64 12, !12, i64 14, !12, i64 16, !12, i64 18, !12, i64 20, !12, i64 22, !12, i64 24, !12, i64 26, !12, i64 28, !12, i64 30}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !12, i64 4}
!17 = !{!"", !11, i64 0, !12, i64 4, !12, i64 6, !12, i64 8, !12, i64 10, !6, i64 16}
!18 = !{!17, !6, i64 16}
!19 = !{i64 0, i64 4, !15, i64 4, i64 4, !15, i64 8, i64 4, !15, i64 12, i64 4, !15, i64 16, i64 8, !5}
!20 = !{!21, !11, i64 0}
!21 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16}
!22 = !{!21, !6, i64 16}
!23 = !{!21, !11, i64 12}
!24 = !{!12, !12, i64 0}
!25 = !{!26, !6, i64 0}
!26 = !{!"", !6, i64 0, !6, i64 8}
!27 = !{!26, !6, i64 8}
!28 = !{!29, !30, i64 0}
!29 = !{!"", !30, i64 0, !30, i64 8}
!30 = !{!"double", !7, i64 0}
!31 = !{!29, !30, i64 8}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!30, !30, i64 0}
!35 = distinct !{!35, !33}
!36 = !{!37, !6, i64 32}
!37 = !{!"", !38, i64 0, !38, i64 1, !38, i64 2, !38, i64 3, !38, i64 4, !38, i64 5, !38, i64 6, !38, i64 7, !38, i64 8, !38, i64 9, !38, i64 10, !38, i64 11, !38, i64 12, !38, i64 13, !38, i64 14, !38, i64 15, !38, i64 16, !38, i64 17, !38, i64 18, !38, i64 19, !38, i64 20, !38, i64 21, !38, i64 22, !6, i64 24, !6, i64 32}
!38 = !{!"_Bool", !7, i64 0}
!39 = !{!40, !6, i64 48}
!40 = !{!"otfcc_ILogger", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88}
!41 = !{!42, !6, i64 56}
!42 = !{!"__caryll_elementinterface_table_hmtx", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!43 = distinct !{!43, !33}
!44 = distinct !{!44, !33}
!45 = distinct !{!45, !33}


; 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.otfcc_Packet = type { i32, i16, i16, i16, i16, ptr }
%struct.otfcc_PacketPiece = type { i32, i32, i32, i32, ptr }
%struct.horizontal_metric = type { double, double }

@.str = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_readHmtx(ptr nocapture noundef readonly byval(%struct.otfcc_Packet) align 8 %0, ptr nocapture noundef readonly %1, ptr noundef readonly %2, ptr noundef readonly %3) local_unnamed_addr #0 {
  %5 = icmp ne ptr %2, null
  %6 = icmp ne ptr %3, null
  %or.cond = and i1 %5, %6
  br i1 %or.cond, label %7, label %.critedge

7:                                                ; preds = %4
  %8 = getelementptr inbounds i8, ptr %2, i64 34
  %9 = load i16, ptr %8, align 2, !tbaa !5
  %.not = icmp eq i16 %9, 0
  br i1 %.not, label %.critedge, label %10

10:                                               ; preds = %7
  %11 = getelementptr inbounds i8, ptr %3, i64 4
  %12 = load i16, ptr %11, align 4, !tbaa !11
  %13 = icmp ult i16 %12, %9
  br i1 %13, label %.critedge, label %.preheader99

.preheader99:                                     ; preds = %10
  %14 = getelementptr inbounds i8, ptr %0, i64 4
  %15 = load i16, ptr %14, align 4
  %16 = icmp eq i16 %15, 0
  br i1 %16, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader99
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  %18 = load ptr, ptr %17, align 8, !tbaa !13
  %19 = getelementptr inbounds i8, ptr %1, i64 32
  %20 = zext i16 %15 to i64
  br label %21

21:                                               ; preds = %.lr.ph, %.split121.us
  %indvars.iv138 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next139, %.split121.us ]
  %22 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %18, i64 %indvars.iv138
  %.sroa.0.0.copyload = load i32, ptr %22, align 8, !tbaa !16
  %23 = icmp eq i32 %.sroa.0.0.copyload, 1752003704
  br i1 %23, label %.lr.ph.us, label %.split121.us

24:                                               ; preds = %.lr.ph.us
  %25 = tail call ptr @__caryll_allocate_clean(i64 noundef 16, i64 noundef 27)
  %26 = zext i16 %51 to i64
  %27 = shl nuw nsw i64 %26, 4
  %28 = tail call ptr @__caryll_allocate_clean(i64 noundef %27, i64 noundef 28)
  store ptr %28, ptr %25, align 8, !tbaa !17
  %29 = zext i16 %54 to i64
  %30 = shl nuw nsw i64 %29, 3
  %31 = tail call ptr @__caryll_allocate_clean(i64 noundef %30, i64 noundef 29)
  %32 = getelementptr inbounds i8, ptr %25, i64 8
  store ptr %31, ptr %32, align 8, !tbaa !19
  %.not130 = icmp eq i16 %51, 0
  br i1 %.not130, label %.preheader.us, label %.lr.ph115.us

33:                                               ; preds = %.lr.ph117.us, %33
  %indvars.iv133 = phi i64 [ 0, %.lr.ph117.us ], [ %indvars.iv.next134, %33 ]
  %34 = shl nuw nsw i64 %indvars.iv133, 1
  %35 = getelementptr inbounds i8, ptr %66, i64 %34
  %36 = tail call signext i16 @read_16s(ptr noundef %35)
  %37 = sitofp i16 %36 to double
  %38 = load ptr, ptr %32, align 8, !tbaa !19
  %39 = getelementptr inbounds double, ptr %38, i64 %indvars.iv133
  store double %37, ptr %39, align 8, !tbaa !20
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %exitcond137.not = icmp eq i64 %indvars.iv.next134, %29
  br i1 %exitcond137.not, label %.critedge, label %33, !llvm.loop !22

.lr.ph115.us:                                     ; preds = %24, %.lr.ph115.us
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph115.us ], [ 0, %24 ]
  %40 = shl nuw nsw i64 %indvars.iv, 2
  %41 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 %40
  %42 = tail call zeroext i16 @read_16u(ptr noundef %41)
  %43 = uitofp i16 %42 to double
  %44 = load ptr, ptr %25, align 8, !tbaa !17
  %45 = getelementptr inbounds %struct.horizontal_metric, ptr %44, i64 %indvars.iv
  store double %43, ptr %45, align 8, !tbaa !24
  %46 = getelementptr inbounds i8, ptr %41, i64 2
  %47 = tail call signext i16 @read_16s(ptr noundef nonnull %46)
  %48 = sitofp i16 %47 to double
  %49 = load ptr, ptr %25, align 8, !tbaa !17
  %50 = getelementptr inbounds %struct.horizontal_metric, ptr %49, i64 %indvars.iv, i32 1
  store double %48, ptr %50, align 8, !tbaa !26
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %26
  br i1 %exitcond.not, label %.preheader.us, label %.lr.ph115.us, !llvm.loop !27

.preheader.us:                                    ; preds = %.lr.ph115.us, %24
  %.not131 = icmp eq i16 %52, %51
  br i1 %.not131, label %.critedge, label %.lr.ph117.us

.lr.ph.us:                                        ; preds = %21
  %.sroa.5.0..sroa_idx.le = getelementptr inbounds i8, ptr %22, i64 16
  %.sroa.5.0.copyload.le = load ptr, ptr %.sroa.5.0..sroa_idx.le, align 8, !tbaa !28
  %.sroa.434.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 12
  %.sroa.434.0.copyload = load i32, ptr %.sroa.434.0..sroa_idx, align 4, !tbaa !16
  %51 = load i16, ptr %8, align 2, !tbaa !5
  %52 = load i16, ptr %11, align 4, !tbaa !11
  %53 = zext i16 %51 to i32
  %54 = sub i16 %52, %51
  %55 = shl nuw nsw i32 %53, 2
  %56 = zext i16 %54 to i32
  %57 = shl nuw nsw i32 %56, 1
  %58 = add nuw nsw i32 %57, %55
  %59 = icmp ult i32 %.sroa.434.0.copyload, %58
  br i1 %59, label %.split121.us.thread, label %24

.split121.us.thread:                              ; preds = %.lr.ph.us
  %60 = load ptr, ptr %19, align 8, !tbaa !29
  %61 = getelementptr inbounds i8, ptr %60, i64 48
  %62 = load ptr, ptr %61, align 8, !tbaa !32
  %63 = tail call ptr @sdsempty() #3
  %64 = tail call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %63, ptr noundef nonnull @.str) #3
  tail call void %62(ptr noundef %60, i8 noundef zeroext 1, i32 noundef 1, ptr noundef %64) #3
  br label %.critedge

.lr.ph117.us:                                     ; preds = %.preheader.us
  %65 = zext nneg i32 %55 to i64
  %66 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 %65
  br label %33

.split121.us:                                     ; preds = %21
  %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1
  %.not147 = icmp ult i64 %indvars.iv.next139, %20
  br i1 %.not147, label %21, label %.critedge, !llvm.loop !34

.critedge:                                        ; preds = %.split121.us, %33, %.preheader.us, %.split121.us.thread, %.preheader99, %4, %7, %10
  %.8 = phi ptr [ null, %10 ], [ null, %7 ], [ null, %4 ], [ null, %.preheader99 ], [ %25, %.preheader.us ], [ null, %.split121.us.thread ], [ %25, %33 ], [ null, %.split121.us ]
  ret ptr %.8
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @__caryll_allocate_clean(i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @read_16u(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden signext i16 @read_16s(ptr noundef) local_unnamed_addr #1

declare ptr @sdscatprintf(ptr noundef, ptr noundef, ...) local_unnamed_addr #2

declare ptr @sdsempty() local_unnamed_addr #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 = { 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 #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 = { 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 34}
!6 = !{!"", !7, i64 0, !10, i64 4, !10, i64 6, !10, i64 8, !10, i64 10, !10, i64 12, !10, i64 14, !10, i64 16, !10, i64 18, !10, i64 20, !10, i64 22, !8, i64 24, !10, i64 32, !10, i64 34}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!12, !10, i64 4}
!12 = !{!"", !7, i64 0, !10, i64 4, !10, i64 6, !10, i64 8, !10, i64 10, !10, i64 12, !10, i64 14, !10, i64 16, !10, i64 18, !10, i64 20, !10, i64 22, !10, i64 24, !10, i64 26, !10, i64 28, !10, i64 30}
!13 = !{!14, !15, i64 16}
!14 = !{!"", !7, i64 0, !10, i64 4, !10, i64 6, !10, i64 8, !10, i64 10, !15, i64 16}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !15, i64 0}
!18 = !{!"", !15, i64 0, !15, i64 8}
!19 = !{!18, !15, i64 8}
!20 = !{!21, !21, i64 0}
!21 = !{!"double", !8, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!25, !21, i64 0}
!25 = !{!"", !21, i64 0, !21, i64 8}
!26 = !{!25, !21, i64 8}
!27 = distinct !{!27, !23}
!28 = !{!15, !15, i64 0}
!29 = !{!30, !15, i64 32}
!30 = !{!"", !31, i64 0, !31, i64 1, !31, i64 2, !31, i64 3, !31, i64 4, !31, i64 5, !31, i64 6, !31, i64 7, !31, i64 8, !31, i64 9, !31, i64 10, !31, i64 11, !31, i64 12, !31, i64 13, !31, i64 14, !31, i64 15, !31, i64 16, !31, i64 17, !31, i64 18, !31, i64 19, !31, i64 20, !31, i64 21, !31, i64 22, !15, i64 24, !15, i64 32}
!31 = !{!"_Bool", !8, i64 0}
!32 = !{!33, !15, i64 48}
!33 = !{!"otfcc_ILogger", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !15, i64 72, !15, i64 80, !15, i64 88}
!34 = distinct !{!34, !23}


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