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

; 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_vmtx = 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_vhea = type { i32, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
%struct.table_maxp = type { i32, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
%struct.table_vmtx = type { ptr, ptr }
%struct.vertical_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_iVmtx = external dso_local constant %struct.__caryll_elementinterface_table_vmtx, align 8
@.str = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_readVmtx(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 %43

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

27:                                               ; preds = %24
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.table_vhea, ptr %28, i32 0, i32 16
  %30 = load i16, ptr %29, align 2, !tbaa !9
  %31 = zext i16 %30 to i32
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %43, label %33

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

43:                                               ; preds = %33, %27, %24, %4
  store ptr null, ptr %5, align 8
  br label %239

44:                                               ; preds = %33
  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 %45

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

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

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

57:                                               ; preds = %51, %48, %45
  %58 = phi i1 [ false, %48 ], [ false, %45 ], [ %56, %51 ]
  br i1 %58, label %60, label %59

59:                                               ; preds = %57
  store i32 2, ptr %12, align 4
  br label %236

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

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

69:                                               ; preds = %66
  store i32 5, ptr %12, align 4
  br label %226

70:                                               ; preds = %66
  %71 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %13, i32 0, i32 0
  %72 = load i32, ptr %71, align 8, !tbaa !20
  %73 = icmp eq i32 %72, 1986884728
  br i1 %73, label %74, label %220

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

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

78:                                               ; preds = %75
  store i32 8, ptr %12, align 4
  br label %217

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

106:                                              ; preds = %79
  br label %196

107:                                              ; preds = %79
  %108 = call ptr @__caryll_allocate_clean(i64 noundef 16, i64 noundef 27)
  store ptr %108, ptr %17, align 8, !tbaa !5
  %109 = load i16, ptr %18, align 2, !tbaa !24
  %110 = zext i16 %109 to i64
  %111 = mul i64 16, %110
  %112 = call ptr @__caryll_allocate_clean(i64 noundef %111, i64 noundef 28)
  %113 = load ptr, ptr %17, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.table_vmtx, ptr %113, i32 0, i32 0
  store ptr %112, ptr %114, align 8, !tbaa !25
  %115 = load i16, ptr %19, align 2, !tbaa !24
  %116 = zext i16 %115 to i64
  %117 = mul i64 8, %116
  %118 = call ptr @__caryll_allocate_clean(i64 noundef %117, i64 noundef 29)
  %119 = load ptr, ptr %17, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.table_vmtx, ptr %119, i32 0, i32 1
  store ptr %118, ptr %120, 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 %121

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

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

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

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

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

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

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

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

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

194:                                              ; preds = %170
  %195 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %195, ptr %5, align 8
  store i32 1, ptr %12, align 4
  br label %213

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

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

212:                                              ; preds = %209, %196
  store i32 0, ptr %12, align 4
  br label %213

213:                                              ; preds = %212, %194
  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
  %214 = load i32, ptr %12, align 4
  switch i32 %214, label %217 [
    i32 0, label %215
  ]

215:                                              ; preds = %213
  br label %216

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

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

219:                                              ; preds = %217
  br label %220

220:                                              ; preds = %219, %70
  br label %221

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

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

228:                                              ; preds = %226
  br label %229

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

236:                                              ; preds = %226, %59
  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
  %237 = load i32, ptr %12, align 4
  switch i32 %237, label %241 [
    i32 2, label %238
    i32 1, label %239
  ]

238:                                              ; preds = %236
  store ptr null, ptr %5, align 8
  br label %239

239:                                              ; preds = %238, %236, %43
  %240 = load ptr, ptr %5, align 8
  ret ptr %240

241:                                              ; preds = %236
  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, !12, i64 24, !12, i64 26, !12, i64 28, !12, i64 30, !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_vmtx", !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.vertical_metric = type { double, double }

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

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_readVmtx(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
  %10 = icmp eq i16 %9, 0
  br i1 %10, label %.critedge, label %11

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

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

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

22:                                               ; preds = %.lr.ph, %.split120.us
  %indvars.iv136 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next137, %.split120.us ]
  %23 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %19, i64 %indvars.iv136
  %.sroa.0.0.copyload = load i32, ptr %23, align 8, !tbaa !16
  %24 = icmp eq i32 %.sroa.0.0.copyload, 1986884728
  br i1 %24, label %.lr.ph.us, label %.split120.us

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

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

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

.preheader.us:                                    ; preds = %.lr.ph114.us, %25
  %.not129 = icmp eq i16 %53, %52
  br i1 %.not129, label %.critedge, label %.lr.ph116.us

.lr.ph.us:                                        ; preds = %22
  %.sroa.5.0..sroa_idx.le = getelementptr inbounds i8, ptr %23, 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 %23, i64 12
  %.sroa.434.0.copyload = load i32, ptr %.sroa.434.0..sroa_idx, align 4, !tbaa !16
  %52 = load i16, ptr %8, align 2, !tbaa !5
  %53 = load i16, ptr %12, align 4, !tbaa !11
  %54 = zext i16 %52 to i32
  %55 = sub i16 %53, %52
  %56 = shl nuw nsw i32 %54, 2
  %57 = zext i16 %55 to i32
  %58 = shl nuw nsw i32 %57, 1
  %59 = add nuw nsw i32 %58, %56
  %60 = icmp ult i32 %.sroa.434.0.copyload, %59
  br i1 %60, label %.split120.us.thread, label %25

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

.lr.ph116.us:                                     ; preds = %.preheader.us
  %66 = zext nneg i32 %56 to i64
  %67 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 %66
  br label %34

.split120.us:                                     ; preds = %22
  %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
  %.not145 = icmp ult i64 %indvars.iv.next137, %21
  br i1 %.not145, label %22, label %.critedge, !llvm.loop !34

.critedge:                                        ; preds = %.split120.us, %34, %.preheader.us, %.split120.us.thread, %.preheader98, %4, %7, %11
  %.8 = phi ptr [ null, %11 ], [ null, %7 ], [ null, %4 ], [ null, %.preheader98 ], [ %26, %.preheader.us ], [ null, %.split120.us.thread ], [ %26, %34 ], [ null, %.split120.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, !10, i64 24, !10, i64 26, !10, i64 28, !10, i64 30, !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