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

; 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_vectorinterface_otl_LigCaretTable = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__caryll_elementinterface_table_GDEF = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__otfcc_IClassDef = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__otfcc_ICoverage = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otfcc_HandlePackage = type { ptr, ptr, ptr, ptr, 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.otl_CaretValueRecord = type { %struct.otfcc_Handle, %struct.otl_CaretValueList }
%struct.otfcc_Handle = type { i32, i16, ptr }
%struct.otl_CaretValueList = type { i64, i64, ptr }
%struct.table_GDEF = type { ptr, ptr, %struct.otl_LigCaretTable }
%struct.otl_LigCaretTable = type { i64, i64, ptr }
%struct.otl_Coverage = type { i16, i32, ptr }

@otl_iLigCaretTable = external dso_local constant %struct.__caryll_vectorinterface_otl_LigCaretTable, align 8
@table_iGDEF = external dso_local constant %struct.__caryll_elementinterface_table_GDEF, align 8
@otl_iClassDef = external constant %struct.__otfcc_IClassDef, align 8
@otl_iCoverage = external constant %struct.__otfcc_ICoverage, align 8
@otfcc_iHandle = external constant %struct.otfcc_HandlePackage, align 8

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_readGDEF(ptr noundef byval(%struct.otfcc_Packet) align 8 %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.otfcc_PacketPiece, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i16, align 2
  %15 = alloca i16, align 2
  %16 = alloca ptr, align 8
  %17 = alloca i16, align 2
  %18 = alloca %struct.otl_CaretValueRecord, align 8
  %19 = alloca %struct.otfcc_Handle, align 8
  %20 = alloca i16, align 2
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %232, %2
  %22 = load i32, ptr %8, align 4, !tbaa !9
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %33

24:                                               ; preds = %21
  %25 = load i32, ptr %6, align 4, !tbaa !9
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %33

27:                                               ; preds = %24
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = getelementptr inbounds %struct.otfcc_Packet, ptr %0, i32 0, i32 1
  %30 = load i16, ptr %29, align 4, !tbaa !11
  %31 = zext i16 %30 to i32
  %32 = icmp slt i32 %28, %31
  br label %33

33:                                               ; preds = %27, %24, %21
  %34 = phi i1 [ false, %24 ], [ false, %21 ], [ %32, %27 ]
  br i1 %34, label %36, label %35

35:                                               ; preds = %33
  store i32 2, ptr %9, align 4
  br label %239

36:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #4
  %37 = getelementptr inbounds %struct.otfcc_Packet, ptr %0, i32 0, i32 5
  %38 = load ptr, ptr %37, align 8, !tbaa !14
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %38, i64 %40
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %41, i64 24, i1 false), !tbaa.struct !15
  br label %42

42:                                               ; preds = %224, %36
  %43 = load i32, ptr %6, align 4, !tbaa !9
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  store i32 5, ptr %9, align 4
  br label %229

46:                                               ; preds = %42
  %47 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %10, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !16
  %49 = icmp eq i32 %48, 1195656518
  br i1 %49, label %50, label %223

50:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %219, %50
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %55, label %54

54:                                               ; preds = %51
  store i32 8, ptr %9, align 4
  br label %220

55:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %56 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %10, i32 0, i32 4
  %57 = load ptr, ptr %56, align 8, !tbaa !18
  store ptr %57, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %58 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %10, i32 0, i32 3
  %59 = load i32, ptr %58, align 4, !tbaa !19
  store i32 %59, ptr %13, align 4, !tbaa !9
  %60 = load i32, ptr %13, align 4, !tbaa !9
  %61 = icmp ult i32 %60, 12
  br i1 %61, label %62, label %63

62:                                               ; preds = %55
  br label %213

63:                                               ; preds = %55
  %64 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_table_GDEF, ptr @table_iGDEF, i32 0, i32 6), align 8, !tbaa !20
  %65 = call ptr (...) %64()
  store ptr %65, ptr %5, align 8, !tbaa !5
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 4
  %68 = call zeroext i16 @read_16u(ptr noundef %67)
  store i16 %68, ptr %14, align 2, !tbaa !22
  %69 = load i16, ptr %14, align 2, !tbaa !22
  %70 = icmp ne i16 %69, 0
  br i1 %70, label %71, label %80

71:                                               ; preds = %63
  %72 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_IClassDef, ptr @otl_iClassDef, i32 0, i32 9), align 8, !tbaa !23
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  %74 = load i32, ptr %13, align 4, !tbaa !9
  %75 = load i16, ptr %14, align 2, !tbaa !22
  %76 = zext i16 %75 to i32
  %77 = call ptr %72(ptr noundef %73, i32 noundef %74, i32 noundef %76)
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.table_GDEF, ptr %78, i32 0, i32 0
  store ptr %77, ptr %79, align 8, !tbaa !25
  br label %80

80:                                               ; preds = %71, %63
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i64 8
  %83 = call zeroext i16 @read_16u(ptr noundef %82)
  store i16 %83, ptr %15, align 2, !tbaa !22
  %84 = load i16, ptr %15, align 2, !tbaa !22
  %85 = icmp ne i16 %84, 0
  br i1 %85, label %86, label %196

86:                                               ; preds = %80
  %87 = load i32, ptr %13, align 4, !tbaa !9
  %88 = load i16, ptr %15, align 2, !tbaa !22
  %89 = zext i16 %88 to i32
  %90 = add nsw i32 %89, 4
  %91 = icmp ult i32 %87, %90
  br i1 %91, label %92, label %93

92:                                               ; preds = %86
  br label %213

93:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %94 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 9), align 8, !tbaa !29
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = load i32, ptr %13, align 4, !tbaa !9
  %97 = load i16, ptr %15, align 2, !tbaa !22
  %98 = zext i16 %97 to i32
  %99 = load ptr, ptr %12, align 8, !tbaa !5
  %100 = load i16, ptr %15, align 2, !tbaa !22
  %101 = zext i16 %100 to i32
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i8, ptr %99, i64 %102
  %104 = call zeroext i16 @read_16u(ptr noundef %103)
  %105 = zext i16 %104 to i32
  %106 = add nsw i32 %98, %105
  %107 = call ptr %94(ptr noundef %95, i32 noundef %96, i32 noundef %106)
  store ptr %107, ptr %16, align 8, !tbaa !5
  %108 = load ptr, ptr %16, align 8, !tbaa !5
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %124

110:                                              ; preds = %93
  %111 = load ptr, ptr %16, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.otl_Coverage, ptr %111, i32 0, i32 0
  %113 = load i16, ptr %112, align 8, !tbaa !31
  %114 = zext i16 %113 to i32
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = load i16, ptr %15, align 2, !tbaa !22
  %117 = zext i16 %116 to i32
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds i8, ptr %115, i64 %118
  %120 = getelementptr inbounds i8, ptr %119, i64 2
  %121 = call zeroext i16 @read_16u(ptr noundef %120)
  %122 = zext i16 %121 to i32
  %123 = icmp ne i32 %114, %122
  br i1 %123, label %124, label %125

124:                                              ; preds = %110, %93
  store i32 11, ptr %9, align 4
  br label %193

125:                                              ; preds = %110
  %126 = load i32, ptr %13, align 4, !tbaa !9
  %127 = load i16, ptr %15, align 2, !tbaa !22
  %128 = zext i16 %127 to i32
  %129 = add nsw i32 %128, 4
  %130 = load ptr, ptr %16, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.otl_Coverage, ptr %130, i32 0, i32 0
  %132 = load i16, ptr %131, align 8, !tbaa !31
  %133 = zext i16 %132 to i32
  %134 = mul nsw i32 %133, 2
  %135 = add nsw i32 %129, %134
  %136 = icmp ult i32 %126, %135
  br i1 %136, label %137, label %138

137:                                              ; preds = %125
  store i32 11, ptr %9, align 4
  br label %193

138:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 2, ptr %17) #4
  store i16 0, ptr %17, align 2, !tbaa !22
  br label %139

139:                                              ; preds = %187, %138
  %140 = load i16, ptr %17, align 2, !tbaa !22
  %141 = zext i16 %140 to i32
  %142 = load ptr, ptr %16, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.otl_Coverage, ptr %142, i32 0, i32 0
  %144 = load i16, ptr %143, align 8, !tbaa !31
  %145 = zext i16 %144 to i32
  %146 = icmp slt i32 %141, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %139
  store i32 12, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #4
  br label %190

148:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 40, ptr %18) #4
  %149 = load ptr, ptr %12, align 8, !tbaa !5
  %150 = load i32, ptr %13, align 4, !tbaa !9
  %151 = load i16, ptr %15, align 2, !tbaa !22
  %152 = zext i16 %151 to i32
  %153 = load ptr, ptr %12, align 8, !tbaa !5
  %154 = load i16, ptr %15, align 2, !tbaa !22
  %155 = zext i16 %154 to i32
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds i8, ptr %153, i64 %156
  %158 = getelementptr inbounds i8, ptr %157, i64 4
  %159 = load i16, ptr %17, align 2, !tbaa !22
  %160 = zext i16 %159 to i32
  %161 = mul nsw i32 %160, 2
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds i8, ptr %158, i64 %162
  %164 = call zeroext i16 @read_16u(ptr noundef %163)
  %165 = zext i16 %164 to i32
  %166 = add nsw i32 %152, %165
  call void @readLigCaretRecord(ptr dead_on_unwind writable sret(%struct.otl_CaretValueRecord) align 8 %18, ptr noundef %149, i32 noundef %150, i32 noundef %166)
  %167 = getelementptr inbounds %struct.otl_CaretValueRecord, ptr %18, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #4
  %168 = load ptr, ptr getelementptr inbounds (%struct.otfcc_HandlePackage, ptr @otfcc_iHandle, i32 0, i32 7), align 8, !tbaa !33
  %169 = load ptr, ptr %16, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.otl_Coverage, ptr %169, i32 0, i32 2
  %171 = load ptr, ptr %170, align 8, !tbaa !35
  %172 = load i16, ptr %17, align 2, !tbaa !22
  %173 = zext i16 %172 to i64
  %174 = getelementptr inbounds %struct.otfcc_Handle, ptr %171, i64 %173
  %175 = getelementptr inbounds { i64, ptr }, ptr %174, i32 0, i32 0
  %176 = load i64, ptr %175, align 8
  %177 = getelementptr inbounds { i64, ptr }, ptr %174, i32 0, i32 1
  %178 = load ptr, ptr %177, align 8
  %179 = call { i64, ptr } %168(i64 %176, ptr %178)
  %180 = getelementptr inbounds { i64, ptr }, ptr %19, i32 0, i32 0
  %181 = extractvalue { i64, ptr } %179, 0
  store i64 %181, ptr %180, align 8
  %182 = getelementptr inbounds { i64, ptr }, ptr %19, i32 0, i32 1
  %183 = extractvalue { i64, ptr } %179, 1
  store ptr %183, ptr %182, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %167, ptr align 8 %19, i64 16, i1 false), !tbaa.struct !36
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #4
  %184 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_otl_LigCaretTable, ptr @otl_iLigCaretTable, i32 0, i32 13), align 8, !tbaa !37
  %185 = load ptr, ptr %5, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.table_GDEF, ptr %185, i32 0, i32 2
  call void %184(ptr noundef %186, ptr noundef byval(%struct.otl_CaretValueRecord) align 8 %18)
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #4
  br label %187

187:                                              ; preds = %148
  %188 = load i16, ptr %17, align 2, !tbaa !22
  %189 = add i16 %188, 1
  store i16 %189, ptr %17, align 2, !tbaa !22
  br label %139, !llvm.loop !39

190:                                              ; preds = %147
  %191 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 7), align 8, !tbaa !41
  %192 = load ptr, ptr %16, align 8, !tbaa !5
  call void %191(ptr noundef %192)
  store i32 0, ptr %9, align 4
  br label %193

193:                                              ; preds = %190, %137, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %194 = load i32, ptr %9, align 4
  switch i32 %194, label %216 [
    i32 0, label %195
    i32 11, label %213
  ]

195:                                              ; preds = %193
  br label %196

196:                                              ; preds = %195, %80
  %197 = load ptr, ptr %12, align 8, !tbaa !5
  %198 = getelementptr inbounds i8, ptr %197, i64 10
  %199 = call zeroext i16 @read_16u(ptr noundef %198)
  store i16 %199, ptr %20, align 2, !tbaa !22
  %200 = load i16, ptr %20, align 2, !tbaa !22
  %201 = icmp ne i16 %200, 0
  br i1 %201, label %202, label %211

202:                                              ; preds = %196
  %203 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_IClassDef, ptr @otl_iClassDef, i32 0, i32 9), align 8, !tbaa !23
  %204 = load ptr, ptr %12, align 8, !tbaa !5
  %205 = load i32, ptr %13, align 4, !tbaa !9
  %206 = load i16, ptr %20, align 2, !tbaa !22
  %207 = zext i16 %206 to i32
  %208 = call ptr %203(ptr noundef %204, i32 noundef %205, i32 noundef %207)
  %209 = load ptr, ptr %5, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.table_GDEF, ptr %209, i32 0, i32 1
  store ptr %208, ptr %210, align 8, !tbaa !42
  br label %211

211:                                              ; preds = %202, %196
  %212 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %212, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %216

213:                                              ; preds = %193, %92, %62
  %214 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_table_GDEF, ptr @table_iGDEF, i32 0, i32 7), align 8, !tbaa !43
  %215 = load ptr, ptr %5, align 8, !tbaa !5
  call void %214(ptr noundef %215)
  store ptr null, ptr %5, align 8, !tbaa !5
  store i32 0, ptr %9, align 4
  br label %216

216:                                              ; preds = %213, %211, %193
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %217 = load i32, ptr %9, align 4
  switch i32 %217, label %220 [
    i32 0, label %218
  ]

218:                                              ; preds = %216
  br label %219

219:                                              ; preds = %218
  store i32 0, ptr %11, align 4, !tbaa !9
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %51, !llvm.loop !44

220:                                              ; preds = %216, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  %221 = load i32, ptr %9, align 4
  switch i32 %221, label %229 [
    i32 8, label %222
  ]

222:                                              ; preds = %220
  br label %223

223:                                              ; preds = %222, %46
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %6, align 4, !tbaa !9
  %226 = icmp ne i32 %225, 0
  %227 = xor i1 %226, true
  %228 = zext i1 %227 to i32
  store i32 %228, ptr %6, align 4, !tbaa !9
  br label %42, !llvm.loop !45

229:                                              ; preds = %220, %45
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  %230 = load i32, ptr %9, align 4
  switch i32 %230, label %239 [
    i32 5, label %231
  ]

231:                                              ; preds = %229
  br label %232

232:                                              ; preds = %231
  %233 = load i32, ptr %6, align 4, !tbaa !9
  %234 = icmp ne i32 %233, 0
  %235 = xor i1 %234, true
  %236 = zext i1 %235 to i32
  store i32 %236, ptr %6, align 4, !tbaa !9
  %237 = load i32, ptr %7, align 4, !tbaa !9
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr %7, align 4, !tbaa !9
  br label %21, !llvm.loop !46

239:                                              ; preds = %229, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %240 = load i32, ptr %9, align 4
  switch i32 %240, label %243 [
    i32 2, label %241
  ]

241:                                              ; preds = %239
  %242 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %242, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %243

243:                                              ; preds = %241, %239
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  %244 = load ptr, ptr %3, align 8
  ret ptr %244
}

; 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 zeroext i16 @read_16u(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @readLigCaretRecord(ptr dead_on_unwind noalias writable sret(%struct.otl_CaretValueRecord) align 8, ptr noundef, i32 noundef, i32 noundef) #0

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

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 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 4}
!12 = !{!"", !10, i64 0, !13, i64 4, !13, i64 6, !13, i64 8, !13, i64 10, !6, i64 16}
!13 = !{!"short", !7, i64 0}
!14 = !{!12, !6, i64 16}
!15 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9, i64 16, i64 8, !5}
!16 = !{!17, !10, i64 0}
!17 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16}
!18 = !{!17, !6, i64 16}
!19 = !{!17, !10, i64 12}
!20 = !{!21, !6, i64 48}
!21 = !{!"__caryll_elementinterface_table_GDEF", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!22 = !{!13, !13, i64 0}
!23 = !{!24, !6, i64 72}
!24 = !{!"__otfcc_IClassDef", !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, !6, i64 96, !6, i64 104, !6, i64 112}
!25 = !{!26, !6, i64 0}
!26 = !{!"", !6, i64 0, !6, i64 8, !27, i64 16}
!27 = !{!"", !28, i64 0, !28, i64 8, !6, i64 16}
!28 = !{!"long", !7, i64 0}
!29 = !{!30, !6, i64 72}
!30 = !{!"__otfcc_ICoverage", !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, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!31 = !{!32, !13, i64 0}
!32 = !{!"", !13, i64 0, !10, i64 4, !6, i64 8}
!33 = !{!34, !6, i64 56}
!34 = !{!"otfcc_HandlePackage", !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}
!35 = !{!32, !6, i64 8}
!36 = !{i64 0, i64 4, !9, i64 4, i64 2, !22, i64 8, i64 8, !5}
!37 = !{!38, !6, i64 104}
!38 = !{!"__caryll_vectorinterface_otl_LigCaretTable", !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, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{!30, !6, i64 56}
!42 = !{!26, !6, i64 8}
!43 = !{!21, !6, i64 56}
!44 = distinct !{!44, !40}
!45 = distinct !{!45, !40}
!46 = distinct !{!46, !40}


; 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.__caryll_vectorinterface_otl_LigCaretTable = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__caryll_elementinterface_table_GDEF = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__otfcc_IClassDef = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__otfcc_ICoverage = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otfcc_HandlePackage = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otfcc_Packet = type { i32, i16, i16, i16, i16, ptr }
%struct.otl_CaretValueRecord = type { %struct.otfcc_Handle, %struct.otl_CaretValueList }
%struct.otfcc_Handle = type { i32, i16, ptr }
%struct.otl_CaretValueList = type { i64, i64, ptr }
%struct.otfcc_PacketPiece = type { i32, i32, i32, i32, ptr }

@otl_iLigCaretTable = external dso_local local_unnamed_addr constant %struct.__caryll_vectorinterface_otl_LigCaretTable, align 8
@table_iGDEF = external dso_local local_unnamed_addr constant %struct.__caryll_elementinterface_table_GDEF, align 8
@otl_iClassDef = external local_unnamed_addr constant %struct.__otfcc_IClassDef, align 8
@otl_iCoverage = external local_unnamed_addr constant %struct.__otfcc_ICoverage, align 8
@otfcc_iHandle = external local_unnamed_addr constant %struct.otfcc_HandlePackage, align 8

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_readGDEF(ptr nocapture noundef readonly byval(%struct.otfcc_Packet) align 8 %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca %struct.otl_CaretValueRecord, align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 4
  %5 = load i16, ptr %4, align 4
  %.not = icmp eq i16 %5, 0
  br i1 %.not, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = load ptr, ptr getelementptr inbounds (i8, ptr @table_iGDEF, i64 48), align 8
  %9 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iClassDef, i64 72), align 8
  %10 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 72), align 8
  %11 = load ptr, ptr getelementptr inbounds (i8, ptr @table_iGDEF, i64 56), align 8
  %12 = zext i16 %5 to i64
  br label %13

13:                                               ; preds = %.lr.ph, %.split156.us
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %.split156.us ]
  %14 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %7, i64 %indvars.iv
  %.sroa.043.0.copyload = load i32, ptr %14, align 8, !tbaa !12
  %.not186 = icmp eq i32 %.sroa.043.0.copyload, 1195656518
  br i1 %.not186, label %.split.us, label %.split156.us

.split.us:                                        ; preds = %13
  %.sroa.445.0..sroa_idx.le = getelementptr inbounds i8, ptr %14, i64 12
  %.sroa.445.0.copyload.le = load i32, ptr %.sroa.445.0..sroa_idx.le, align 4, !tbaa !12
  %.sroa.5.0..sroa_idx.le = getelementptr inbounds i8, ptr %14, i64 16
  %.sroa.5.0.copyload.le = load ptr, ptr %.sroa.5.0..sroa_idx.le, align 8, !tbaa !13
  %15 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 8
  %16 = icmp ult i32 %.sroa.445.0.copyload.le, 12
  br i1 %16, label %.thread.us.us.us, label %.preheader130.us

.thread.us.us.us:                                 ; preds = %.split.us
  tail call void %11(ptr noundef null) #3
  br label %.critedge

.preheader130.us:                                 ; preds = %.split.us
  %17 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 4
  %18 = tail call ptr (...) %8() #3
  %19 = tail call zeroext i16 @read_16u(ptr noundef nonnull %17)
  %.not97.us = icmp eq i16 %19, 0
  br i1 %.not97.us, label %23, label %20

20:                                               ; preds = %.preheader130.us
  %21 = zext i16 %19 to i32
  %22 = tail call ptr %9(ptr noundef %.sroa.5.0.copyload.le, i32 noundef %.sroa.445.0.copyload.le, i32 noundef %21) #3
  store ptr %22, ptr %18, align 8, !tbaa !14
  br label %23

23:                                               ; preds = %20, %.preheader130.us
  %24 = tail call zeroext i16 @read_16u(ptr noundef nonnull %15)
  %.not98.us = icmp eq i16 %24, 0
  br i1 %.not98.us, label %.loopexit, label %25

25:                                               ; preds = %23
  %26 = zext i16 %24 to i32
  %27 = add nuw nsw i32 %26, 4
  %28 = icmp ult i32 %.sroa.445.0.copyload.le, %27
  br i1 %28, label %.thread.us144, label %29

29:                                               ; preds = %25
  %30 = zext i16 %24 to i64
  %31 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 %30
  %32 = tail call zeroext i16 @read_16u(ptr noundef nonnull %31)
  %33 = zext i16 %32 to i32
  %34 = add nuw nsw i32 %33, %26
  %35 = tail call ptr %10(ptr noundef %.sroa.5.0.copyload.le, i32 noundef %.sroa.445.0.copyload.le, i32 noundef %34) #3
  %.not99.us = icmp eq ptr %35, null
  br i1 %.not99.us, label %.thread.us144, label %36

36:                                               ; preds = %29
  %37 = load i16, ptr %35, align 8, !tbaa !18
  %38 = getelementptr inbounds i8, ptr %31, i64 2
  %39 = tail call zeroext i16 @read_16u(ptr noundef nonnull %38)
  %.not100.us = icmp eq i16 %37, %39
  br i1 %.not100.us, label %40, label %.thread.us144

40:                                               ; preds = %36
  %41 = load i16, ptr %35, align 8, !tbaa !18
  %42 = zext i16 %41 to i32
  %43 = shl nuw nsw i32 %42, 1
  %44 = add nuw nsw i32 %43, %27
  %45 = icmp ult i32 %.sroa.445.0.copyload.le, %44
  br i1 %45, label %.thread.us144, label %.preheader

.thread.us144:                                    ; preds = %40, %36, %29, %25
  tail call void %11(ptr noundef %18) #3
  br label %.critedge

.preheader:                                       ; preds = %40
  %.not161 = icmp eq i16 %41, 0
  br i1 %.not161, label %._crit_edge, label %.lr.ph160

.lr.ph160:                                        ; preds = %.preheader
  %46 = getelementptr inbounds i8, ptr %31, i64 4
  %47 = load ptr, ptr getelementptr inbounds (i8, ptr @otfcc_iHandle, i64 56), align 8
  %48 = getelementptr inbounds i8, ptr %35, i64 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  %49 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iLigCaretTable, i64 104), align 8
  %50 = getelementptr inbounds i8, ptr %18, i64 16
  br label %51

51:                                               ; preds = %.lr.ph160, %51
  %indvars.iv173 = phi i64 [ 0, %.lr.ph160 ], [ %indvars.iv.next174, %51 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #3
  %52 = shl nuw nsw i64 %indvars.iv173, 1
  %53 = getelementptr inbounds i8, ptr %46, i64 %52
  %54 = call zeroext i16 @read_16u(ptr noundef nonnull %53)
  %55 = zext i16 %54 to i32
  %56 = add nuw nsw i32 %55, %26
  call void @readLigCaretRecord(ptr dead_on_unwind nonnull writable sret(%struct.otl_CaretValueRecord) align 8 %3, ptr noundef %.sroa.5.0.copyload.le, i32 noundef %.sroa.445.0.copyload.le, i32 noundef %56)
  %57 = load ptr, ptr %48, align 8, !tbaa !20
  %58 = getelementptr inbounds %struct.otfcc_Handle, ptr %57, i64 %indvars.iv173
  %59 = load i64, ptr %58, align 8
  %60 = getelementptr inbounds i8, ptr %58, i64 8
  %61 = load ptr, ptr %60, align 8
  %62 = call { i64, ptr } %47(i64 %59, ptr %61) #3
  %63 = extractvalue { i64, ptr } %62, 0
  %64 = extractvalue { i64, ptr } %62, 1
  store i64 %63, ptr %3, align 8
  store ptr %64, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !13
  call void %49(ptr noundef nonnull %50, ptr noundef nonnull byval(%struct.otl_CaretValueRecord) align 8 %3) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #3
  %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
  %65 = load i16, ptr %35, align 8, !tbaa !18
  %66 = zext i16 %65 to i64
  %67 = icmp ult i64 %indvars.iv.next174, %66
  br i1 %67, label %51, label %._crit_edge, !llvm.loop !21

._crit_edge:                                      ; preds = %51, %.preheader
  %68 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 56), align 8, !tbaa !23
  call void %68(ptr noundef nonnull %35) #3
  br label %.loopexit

.loopexit:                                        ; preds = %23, %._crit_edge
  %69 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 10
  %70 = call zeroext i16 @read_16u(ptr noundef nonnull %69)
  %.not101 = icmp eq i16 %70, 0
  br i1 %.not101, label %.critedge, label %71

71:                                               ; preds = %.loopexit
  %72 = zext i16 %70 to i32
  %73 = call ptr %9(ptr noundef %.sroa.5.0.copyload.le, i32 noundef %.sroa.445.0.copyload.le, i32 noundef %72) #3
  %74 = getelementptr inbounds i8, ptr %18, i64 8
  store ptr %73, ptr %74, align 8, !tbaa !25
  br label %.critedge

.split156.us:                                     ; preds = %13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %75 = icmp ult i64 %indvars.iv.next, %12
  br i1 %75, label %13, label %.critedge, !llvm.loop !26

.critedge:                                        ; preds = %.split156.us, %.thread.us.us.us, %.thread.us144, %2, %.loopexit, %71
  %76 = phi ptr [ %18, %71 ], [ %18, %.loopexit ], [ null, %2 ], [ null, %.thread.us144 ], [ null, %.thread.us.us.us ], [ null, %.split156.us ]
  ret ptr %76
}

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

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

; Function Attrs: nounwind uwtable
declare hidden void @readLigCaretRecord(ptr dead_on_unwind noalias writable sret(%struct.otl_CaretValueRecord) align 8, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !11, i64 16}
!6 = !{!"", !7, i64 0, !10, i64 4, !10, i64 6, !10, i64 8, !10, i64 10, !11, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !11, i64 0}
!15 = !{!"", !11, i64 0, !11, i64 8, !16, i64 16}
!16 = !{!"", !17, i64 0, !17, i64 8, !11, i64 16}
!17 = !{!"long", !8, i64 0}
!18 = !{!19, !10, i64 0}
!19 = !{!"", !10, i64 0, !7, i64 4, !11, i64 8}
!20 = !{!19, !11, i64 8}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !11, i64 56}
!24 = !{!"__otfcc_ICoverage", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120}
!25 = !{!15, !11, i64 8}
!26 = distinct !{!26, !22}


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