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

; 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_post = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otfcc_GlyphOrderPackage = type { ptr, 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.table_post = type { i32, i32, i16, i16, i32, i32, i32, i32, i32, ptr }

@iTable_post = external dso_local constant %struct.__caryll_elementinterface_table_post, align 8
@otfcc_pkgGlyphOrder = external constant %struct.otfcc_GlyphOrderPackage, align 8
@standardMacNames = external hidden global [258 x ptr], align 16

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_readPost(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 i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.otfcc_PacketPiece, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca [65536 x ptr], align 16
  %15 = alloca i16, align 2
  %16 = alloca i32, align 4
  %17 = alloca i16, align 2
  %18 = alloca i8, align 1
  %19 = alloca ptr, align 8
  %20 = alloca i16, align 2
  %21 = alloca i16, align 2
  %22 = alloca i32, align 4
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %248, %2
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %35

26:                                               ; preds = %23
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %35

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

35:                                               ; preds = %29, %26, %23
  %36 = phi i1 [ false, %26 ], [ false, %23 ], [ %34, %29 ]
  br i1 %36, label %38, label %37

37:                                               ; preds = %35
  store i32 2, ptr %8, align 4
  br label %255

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

44:                                               ; preds = %240, %38
  %45 = load i32, ptr %5, align 4, !tbaa !9
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  store i32 5, ptr %8, align 4
  br label %245

48:                                               ; preds = %44
  %49 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %9, i32 0, i32 0
  %50 = load i32, ptr %49, align 8, !tbaa !16
  %51 = icmp eq i32 %50, 1886352244
  br i1 %51, label %52, label %239

52:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %235, %52
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %57, label %56

56:                                               ; preds = %53
  store i32 8, ptr %8, align 4
  br label %236

57:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %58 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %9, i32 0, i32 4
  %59 = load ptr, ptr %58, align 8, !tbaa !18
  store ptr %59, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %60 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_table_post, ptr @iTable_post, i32 0, i32 6), align 8, !tbaa !19
  %61 = call ptr (...) %60()
  store ptr %61, ptr %12, align 8, !tbaa !5
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = call i32 @read_32s(ptr noundef %62)
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.table_post, ptr %64, i32 0, i32 0
  store i32 %63, ptr %65, align 8, !tbaa !21
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 4
  %68 = call i32 @read_32u(ptr noundef %67)
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.table_post, ptr %69, i32 0, i32 1
  store i32 %68, ptr %70, align 4, !tbaa !23
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %71, i64 8
  %73 = call zeroext i16 @read_16u(ptr noundef %72)
  %74 = load ptr, ptr %12, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.table_post, ptr %74, i32 0, i32 2
  store i16 %73, ptr %75, align 8, !tbaa !24
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i64 10
  %78 = call zeroext i16 @read_16u(ptr noundef %77)
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.table_post, ptr %79, i32 0, i32 3
  store i16 %78, ptr %80, align 2, !tbaa !25
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i64 12
  %83 = call i32 @read_32u(ptr noundef %82)
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.table_post, ptr %84, i32 0, i32 4
  store i32 %83, ptr %85, align 4, !tbaa !26
  %86 = load ptr, ptr %11, align 8, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %86, i64 16
  %88 = call i32 @read_32u(ptr noundef %87)
  %89 = load ptr, ptr %12, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.table_post, ptr %89, i32 0, i32 5
  store i32 %88, ptr %90, align 8, !tbaa !27
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %91, i64 20
  %93 = call i32 @read_32u(ptr noundef %92)
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.table_post, ptr %94, i32 0, i32 6
  store i32 %93, ptr %95, align 4, !tbaa !28
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = getelementptr inbounds i8, ptr %96, i64 24
  %98 = call i32 @read_32u(ptr noundef %97)
  %99 = load ptr, ptr %12, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.table_post, ptr %99, i32 0, i32 7
  store i32 %98, ptr %100, align 8, !tbaa !29
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = getelementptr inbounds i8, ptr %101, i64 28
  %103 = call i32 @read_32u(ptr noundef %102)
  %104 = load ptr, ptr %12, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.table_post, ptr %104, i32 0, i32 8
  store i32 %103, ptr %105, align 4, !tbaa !30
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.table_post, ptr %106, i32 0, i32 9
  store ptr null, ptr %107, align 8, !tbaa !31
  %108 = load ptr, ptr %12, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.table_post, ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 8, !tbaa !21
  %111 = icmp eq i32 %110, 131072
  br i1 %111, label %112, label %233

112:                                              ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %113 = load ptr, ptr getelementptr inbounds (%struct.otfcc_GlyphOrderPackage, ptr @otfcc_pkgGlyphOrder, i32 0, i32 6), align 8, !tbaa !32
  %114 = call ptr (...) %113()
  store ptr %114, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 524288, ptr %14) #6
  %115 = getelementptr inbounds [65536 x ptr], ptr %14, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %115, i8 0, i64 524288, i1 false)
  call void @llvm.lifetime.start.p0(i64 2, ptr %15) #6
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = getelementptr inbounds i8, ptr %116, i64 32
  %118 = call zeroext i16 @read_16u(ptr noundef %117)
  store i16 %118, ptr %15, align 2, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %119 = load i16, ptr %15, align 2, !tbaa !34
  %120 = zext i16 %119 to i32
  %121 = mul nsw i32 2, %120
  %122 = add nsw i32 34, %121
  store i32 %122, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %17) #6
  store i16 0, ptr %17, align 2, !tbaa !34
  br label %123

123:                                              ; preds = %154, %112
  %124 = load i16, ptr %17, align 2, !tbaa !34
  %125 = zext i16 %124 to i32
  %126 = icmp sle i32 %125, 65535
  br i1 %126, label %127, label %132

127:                                              ; preds = %123
  %128 = load i32, ptr %16, align 4, !tbaa !9
  %129 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %9, i32 0, i32 3
  %130 = load i32, ptr %129, align 4, !tbaa !35
  %131 = icmp ult i32 %128, %130
  br label %132

132:                                              ; preds = %127, %123
  %133 = phi i1 [ false, %123 ], [ %131, %127 ]
  br i1 %133, label %134, label %168

134:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #6
  %135 = load ptr, ptr %11, align 8, !tbaa !5
  %136 = load i32, ptr %16, align 4, !tbaa !9
  %137 = zext i32 %136 to i64
  %138 = getelementptr inbounds i8, ptr %135, i64 %137
  %139 = load i8, ptr %138, align 1, !tbaa !36
  store i8 %139, ptr %18, align 1, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %140 = load i8, ptr %18, align 1, !tbaa !36
  %141 = zext i8 %140 to i32
  %142 = icmp sgt i32 %141, 0
  br i1 %142, label %143, label %152

143:                                              ; preds = %134
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = load i32, ptr %16, align 4, !tbaa !9
  %146 = zext i32 %145 to i64
  %147 = getelementptr inbounds i8, ptr %144, i64 %146
  %148 = getelementptr inbounds i8, ptr %147, i64 1
  %149 = load i8, ptr %18, align 1, !tbaa !36
  %150 = zext i8 %149 to i64
  %151 = call ptr @sdsnewlen(ptr noundef %148, i64 noundef %150)
  store ptr %151, ptr %19, align 8, !tbaa !5
  br label %154

152:                                              ; preds = %134
  %153 = call ptr @sdsempty()
  store ptr %153, ptr %19, align 8, !tbaa !5
  br label %154

154:                                              ; preds = %152, %143
  %155 = load i8, ptr %18, align 1, !tbaa !36
  %156 = zext i8 %155 to i32
  %157 = add nsw i32 %156, 1
  %158 = load i32, ptr %16, align 4, !tbaa !9
  %159 = add i32 %158, %157
  store i32 %159, ptr %16, align 4, !tbaa !9
  %160 = load ptr, ptr %19, align 8, !tbaa !5
  %161 = load i16, ptr %17, align 2, !tbaa !34
  %162 = zext i16 %161 to i64
  %163 = getelementptr inbounds [65536 x ptr], ptr %14, i64 0, i64 %162
  store ptr %160, ptr %163, align 8, !tbaa !5
  %164 = load i16, ptr %17, align 2, !tbaa !34
  %165 = zext i16 %164 to i32
  %166 = add nsw i32 %165, 1
  %167 = trunc i32 %166 to i16
  store i16 %167, ptr %17, align 2, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #6
  br label %123, !llvm.loop !37

168:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 2, ptr %20) #6
  store i16 0, ptr %20, align 2, !tbaa !34
  br label %169

169:                                              ; preds = %211, %168
  %170 = load i16, ptr %20, align 2, !tbaa !34
  %171 = zext i16 %170 to i32
  %172 = load i16, ptr %15, align 2, !tbaa !34
  %173 = zext i16 %172 to i32
  %174 = icmp slt i32 %171, %173
  br i1 %174, label %176, label %175

175:                                              ; preds = %169
  store i32 13, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %20) #6
  br label %214

176:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 2, ptr %21) #6
  %177 = load ptr, ptr %11, align 8, !tbaa !5
  %178 = getelementptr inbounds i8, ptr %177, i64 34
  %179 = load i16, ptr %20, align 2, !tbaa !34
  %180 = zext i16 %179 to i32
  %181 = mul nsw i32 2, %180
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds i8, ptr %178, i64 %182
  %184 = call zeroext i16 @read_16u(ptr noundef %183)
  store i16 %184, ptr %21, align 2, !tbaa !34
  %185 = load i16, ptr %21, align 2, !tbaa !34
  %186 = zext i16 %185 to i32
  %187 = icmp sge i32 %186, 258
  br i1 %187, label %188, label %200

188:                                              ; preds = %176
  %189 = load ptr, ptr getelementptr inbounds (%struct.otfcc_GlyphOrderPackage, ptr @otfcc_pkgGlyphOrder, i32 0, i32 8), align 8, !tbaa !39
  %190 = load ptr, ptr %13, align 8, !tbaa !5
  %191 = load i16, ptr %20, align 2, !tbaa !34
  %192 = load i16, ptr %21, align 2, !tbaa !34
  %193 = zext i16 %192 to i32
  %194 = sub nsw i32 %193, 258
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [65536 x ptr], ptr %14, i64 0, i64 %195
  %197 = load ptr, ptr %196, align 8, !tbaa !5
  %198 = call ptr @sdsdup(ptr noundef %197)
  %199 = call ptr %189(ptr noundef %190, i16 noundef zeroext %191, ptr noundef %198)
  br label %210

200:                                              ; preds = %176
  %201 = load ptr, ptr getelementptr inbounds (%struct.otfcc_GlyphOrderPackage, ptr @otfcc_pkgGlyphOrder, i32 0, i32 8), align 8, !tbaa !39
  %202 = load ptr, ptr %13, align 8, !tbaa !5
  %203 = load i16, ptr %20, align 2, !tbaa !34
  %204 = load i16, ptr %21, align 2, !tbaa !34
  %205 = zext i16 %204 to i64
  %206 = getelementptr inbounds [258 x ptr], ptr @standardMacNames, i64 0, i64 %205
  %207 = load ptr, ptr %206, align 8, !tbaa !5
  %208 = call ptr @sdsnew(ptr noundef %207)
  %209 = call ptr %201(ptr noundef %202, i16 noundef zeroext %203, ptr noundef %208)
  br label %210

210:                                              ; preds = %200, %188
  call void @llvm.lifetime.end.p0(i64 2, ptr %21) #6
  br label %211

211:                                              ; preds = %210
  %212 = load i16, ptr %20, align 2, !tbaa !34
  %213 = add i16 %212, 1
  store i16 %213, ptr %20, align 2, !tbaa !34
  br label %169, !llvm.loop !40

214:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %215

215:                                              ; preds = %226, %214
  %216 = load i32, ptr %22, align 4, !tbaa !9
  %217 = load i16, ptr %17, align 2, !tbaa !34
  %218 = zext i16 %217 to i32
  %219 = icmp ult i32 %216, %218
  br i1 %219, label %221, label %220

220:                                              ; preds = %215
  store i32 16, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %229

221:                                              ; preds = %215
  %222 = load i32, ptr %22, align 4, !tbaa !9
  %223 = zext i32 %222 to i64
  %224 = getelementptr inbounds [65536 x ptr], ptr %14, i64 0, i64 %223
  %225 = load ptr, ptr %224, align 8, !tbaa !5
  call void @sdsfree(ptr noundef %225)
  br label %226

226:                                              ; preds = %221
  %227 = load i32, ptr %22, align 4, !tbaa !9
  %228 = add i32 %227, 1
  store i32 %228, ptr %22, align 4, !tbaa !9
  br label %215, !llvm.loop !41

229:                                              ; preds = %220
  %230 = load ptr, ptr %13, align 8, !tbaa !5
  %231 = load ptr, ptr %12, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.table_post, ptr %231, i32 0, i32 9
  store ptr %230, ptr %232, align 8, !tbaa !31
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 524288, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %233

233:                                              ; preds = %229, %57
  %234 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %234, ptr %3, align 8
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %236

235:                                              ; No predecessors!
  store i32 0, ptr %10, align 4, !tbaa !9
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %53, !llvm.loop !42

236:                                              ; preds = %233, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %237 = load i32, ptr %8, align 4
  switch i32 %237, label %245 [
    i32 8, label %238
  ]

238:                                              ; preds = %236
  br label %239

239:                                              ; preds = %238, %48
  br label %240

240:                                              ; preds = %239
  %241 = load i32, ptr %5, align 4, !tbaa !9
  %242 = icmp ne i32 %241, 0
  %243 = xor i1 %242, true
  %244 = zext i1 %243 to i32
  store i32 %244, ptr %5, align 4, !tbaa !9
  br label %44, !llvm.loop !43

245:                                              ; preds = %236, %47
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  %246 = load i32, ptr %8, align 4
  switch i32 %246, label %255 [
    i32 5, label %247
  ]

247:                                              ; preds = %245
  br label %248

248:                                              ; preds = %247
  %249 = load i32, ptr %5, align 4, !tbaa !9
  %250 = icmp ne i32 %249, 0
  %251 = xor i1 %250, true
  %252 = zext i1 %251 to i32
  store i32 %252, ptr %5, align 4, !tbaa !9
  %253 = load i32, ptr %6, align 4, !tbaa !9
  %254 = add nsw i32 %253, 1
  store i32 %254, ptr %6, align 4, !tbaa !9
  br label %23, !llvm.loop !44

255:                                              ; preds = %245, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  %256 = load i32, ptr %8, align 4
  switch i32 %256, label %260 [
    i32 2, label %257
    i32 1, label %258
  ]

257:                                              ; preds = %255
  store ptr null, ptr %3, align 8
  br label %258

258:                                              ; preds = %257, %255
  %259 = load ptr, ptr %3, align 8
  ret ptr %259

260:                                              ; preds = %255
  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 i32 @read_32s(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @read_32u(ptr noundef) #3

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

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

declare ptr @sdsnewlen(ptr noundef, i64 noundef) #5

declare ptr @sdsempty() #5

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

declare ptr @sdsdup(ptr noundef) #5

declare ptr @sdsnew(ptr noundef) #5

declare void @sdsfree(ptr noundef) #5

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { "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 #6 = { 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 = !{!20, !6, i64 48}
!20 = !{!"__caryll_elementinterface_table_post", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!21 = !{!22, !10, i64 0}
!22 = !{!"", !10, i64 0, !10, i64 4, !13, i64 8, !13, i64 10, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !6, i64 32}
!23 = !{!22, !10, i64 4}
!24 = !{!22, !13, i64 8}
!25 = !{!22, !13, i64 10}
!26 = !{!22, !10, i64 12}
!27 = !{!22, !10, i64 16}
!28 = !{!22, !10, i64 20}
!29 = !{!22, !10, i64 24}
!30 = !{!22, !10, i64 28}
!31 = !{!22, !6, i64 32}
!32 = !{!33, !6, i64 48}
!33 = !{!"otfcc_GlyphOrderPackage", !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}
!34 = !{!13, !13, i64 0}
!35 = !{!17, !10, i64 12}
!36 = !{!7, !7, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!33, !6, i64 64}
!40 = distinct !{!40, !38}
!41 = distinct !{!41, !38}
!42 = distinct !{!42, !38}
!43 = distinct !{!43, !38}
!44 = distinct !{!44, !38}


; 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_elementinterface_table_post = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otfcc_GlyphOrderPackage = type { ptr, 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 }

@iTable_post = external dso_local local_unnamed_addr constant %struct.__caryll_elementinterface_table_post, align 8
@otfcc_pkgGlyphOrder = external local_unnamed_addr constant %struct.otfcc_GlyphOrderPackage, align 8
@standardMacNames = external hidden local_unnamed_addr global [258 x ptr], align 16

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

.lr.ph105:                                        ; 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 @iTable_post, i64 48), align 8
  %9 = load ptr, ptr getelementptr inbounds (i8, ptr @otfcc_pkgGlyphOrder, i64 48), align 8
  %10 = load ptr, ptr getelementptr inbounds (i8, ptr @otfcc_pkgGlyphOrder, i64 64), align 8
  %wide.trip.count = zext i16 %5 to i64
  br label %11

11:                                               ; preds = %.lr.ph105, %.thread87
  %indvars.iv = phi i64 [ 0, %.lr.ph105 ], [ %indvars.iv.next, %.thread87 ]
  %12 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %7, i64 %indvars.iv
  %.sroa.0.0.copyload = load i32, ptr %12, align 8, !tbaa !12
  %.sroa.0.0.copyload.fr = freeze i32 %.sroa.0.0.copyload
  %13 = icmp eq i32 %.sroa.0.0.copyload.fr, 1886352244
  br i1 %13, label %.split95.us, label %.thread87, !llvm.loop !13

.split95.us:                                      ; preds = %11
  %.sroa.456.0..sroa_idx.le = getelementptr inbounds i8, ptr %12, i64 12
  %.sroa.456.0.copyload.le = load i32, ptr %.sroa.456.0..sroa_idx.le, align 4, !tbaa !12
  %.sroa.5.0..sroa_idx.le = getelementptr inbounds i8, ptr %12, i64 16
  %.sroa.5.0.copyload.le = load ptr, ptr %.sroa.5.0..sroa_idx.le, align 8, !tbaa !15
  %14 = tail call ptr (...) %8() #5
  %15 = tail call i32 @read_32s(ptr noundef %.sroa.5.0.copyload.le)
  store i32 %15, ptr %14, align 8, !tbaa !16
  %16 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 4
  %17 = tail call i32 @read_32u(ptr noundef nonnull %16)
  %18 = getelementptr inbounds i8, ptr %14, i64 4
  store i32 %17, ptr %18, align 4, !tbaa !18
  %19 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 8
  %20 = tail call zeroext i16 @read_16u(ptr noundef nonnull %19)
  %21 = getelementptr inbounds i8, ptr %14, i64 8
  store i16 %20, ptr %21, align 8, !tbaa !19
  %22 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 10
  %23 = tail call zeroext i16 @read_16u(ptr noundef nonnull %22)
  %24 = getelementptr inbounds i8, ptr %14, i64 10
  store i16 %23, ptr %24, align 2, !tbaa !20
  %25 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 12
  %26 = tail call i32 @read_32u(ptr noundef nonnull %25)
  %27 = getelementptr inbounds i8, ptr %14, i64 12
  store i32 %26, ptr %27, align 4, !tbaa !21
  %28 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 16
  %29 = tail call i32 @read_32u(ptr noundef nonnull %28)
  %30 = getelementptr inbounds i8, ptr %14, i64 16
  store i32 %29, ptr %30, align 8, !tbaa !22
  %31 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 20
  %32 = tail call i32 @read_32u(ptr noundef nonnull %31)
  %33 = getelementptr inbounds i8, ptr %14, i64 20
  store i32 %32, ptr %33, align 4, !tbaa !23
  %34 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 24
  %35 = tail call i32 @read_32u(ptr noundef nonnull %34)
  %36 = getelementptr inbounds i8, ptr %14, i64 24
  store i32 %35, ptr %36, align 8, !tbaa !24
  %37 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 28
  %38 = tail call i32 @read_32u(ptr noundef nonnull %37)
  %39 = getelementptr inbounds i8, ptr %14, i64 28
  store i32 %38, ptr %39, align 4, !tbaa !25
  %40 = getelementptr inbounds i8, ptr %14, i64 32
  store ptr null, ptr %40, align 8, !tbaa !26
  %41 = load i32, ptr %14, align 8, !tbaa !16
  %42 = icmp eq i32 %41, 131072
  br i1 %42, label %43, label %.critedge

43:                                               ; preds = %.split95.us
  %44 = tail call ptr (...) %9() #5
  call void @llvm.lifetime.start.p0(i64 524288, ptr nonnull %3) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(524288) %3, i8 0, i64 524288, i1 false)
  %45 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 32
  %46 = tail call zeroext i16 @read_16u(ptr noundef nonnull %45)
  %47 = zext i16 %46 to i32
  %48 = shl nuw nsw i32 %47, 1
  %49 = add nuw nsw i32 %48, 34
  %50 = icmp ult i32 %49, %.sroa.456.0.copyload.le
  br i1 %50, label %.lr.ph, label %.preheader92

.preheader92:                                     ; preds = %62, %43
  %.074.lcssa = phi i16 [ 0, %43 ], [ %67, %62 ]
  %.not110 = icmp eq i16 %46, 0
  br i1 %.not110, label %.preheader, label %.lr.ph99

.lr.ph99:                                         ; preds = %.preheader92
  %51 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 34
  %wide.trip.count118 = zext i16 %46 to i64
  br label %69

.lr.ph:                                           ; preds = %43, %62
  %.07497 = phi i16 [ %67, %62 ], [ 0, %43 ]
  %.07596 = phi i32 [ %64, %62 ], [ %49, %43 ]
  %52 = zext i32 %.07596 to i64
  %53 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !27
  %55 = zext i8 %54 to i32
  %.not = icmp eq i8 %54, 0
  br i1 %.not, label %60, label %56

56:                                               ; preds = %.lr.ph
  %57 = getelementptr inbounds i8, ptr %53, i64 1
  %58 = zext i8 %54 to i64
  %59 = tail call ptr @sdsnewlen(ptr noundef nonnull %57, i64 noundef %58) #5
  br label %62

60:                                               ; preds = %.lr.ph
  %61 = tail call ptr @sdsempty() #5
  br label %62

62:                                               ; preds = %60, %56
  %.071 = phi ptr [ %59, %56 ], [ %61, %60 ]
  %63 = add nuw i32 %.07596, 1
  %64 = add i32 %63, %55
  %65 = zext i16 %.07497 to i64
  %66 = getelementptr inbounds [65536 x ptr], ptr %3, i64 0, i64 %65
  store ptr %.071, ptr %66, align 8, !tbaa !15
  %67 = add i16 %.07497, 1
  %68 = icmp ult i32 %64, %.sroa.456.0.copyload.le
  br i1 %68, label %.lr.ph, label %.preheader92, !llvm.loop !28

.preheader:                                       ; preds = %85, %.preheader92
  %.not111 = icmp eq i16 %.074.lcssa, 0
  br i1 %.not111, label %._crit_edge, label %.lr.ph101.preheader

.lr.ph101.preheader:                              ; preds = %.preheader
  %wide.trip.count123 = zext i16 %.074.lcssa to i64
  br label %.lr.ph101

69:                                               ; preds = %.lr.ph99, %85
  %indvars.iv115 = phi i64 [ 0, %.lr.ph99 ], [ %indvars.iv.next116, %85 ]
  %70 = shl nuw nsw i64 %indvars.iv115, 1
  %71 = getelementptr inbounds i8, ptr %51, i64 %70
  %72 = tail call zeroext i16 @read_16u(ptr noundef nonnull %71)
  %73 = icmp ugt i16 %72, 257
  %74 = zext i16 %72 to i64
  br i1 %73, label %75, label %81

75:                                               ; preds = %69
  %76 = add nuw nsw i64 %74, 4294967038
  %77 = and i64 %76, 4294967295
  %78 = getelementptr inbounds [65536 x ptr], ptr %3, i64 0, i64 %77
  %79 = load ptr, ptr %78, align 8, !tbaa !15
  %80 = tail call ptr @sdsdup(ptr noundef %79) #5
  br label %85

81:                                               ; preds = %69
  %82 = getelementptr inbounds [258 x ptr], ptr @standardMacNames, i64 0, i64 %74
  %83 = load ptr, ptr %82, align 8, !tbaa !15
  %84 = tail call ptr @sdsnew(ptr noundef %83) #5
  br label %85

85:                                               ; preds = %81, %75
  %.sink129 = phi ptr [ %84, %81 ], [ %80, %75 ]
  %86 = trunc nuw i64 %indvars.iv115 to i16
  %87 = tail call ptr %10(ptr noundef %44, i16 noundef zeroext %86, ptr noundef %.sink129) #5
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %exitcond119.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count118
  br i1 %exitcond119.not, label %.preheader, label %69, !llvm.loop !29

.lr.ph101:                                        ; preds = %.lr.ph101.preheader, %.lr.ph101
  %indvars.iv120 = phi i64 [ 0, %.lr.ph101.preheader ], [ %indvars.iv.next121, %.lr.ph101 ]
  %88 = getelementptr inbounds [65536 x ptr], ptr %3, i64 0, i64 %indvars.iv120
  %89 = load ptr, ptr %88, align 8, !tbaa !15
  tail call void @sdsfree(ptr noundef %89) #5
  %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
  %exitcond124.not = icmp eq i64 %indvars.iv.next121, %wide.trip.count123
  br i1 %exitcond124.not, label %._crit_edge, label %.lr.ph101, !llvm.loop !30

._crit_edge:                                      ; preds = %.lr.ph101, %.preheader
  store ptr %44, ptr %40, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 524288, ptr nonnull %3) #5
  br label %.critedge

.thread87:                                        ; preds = %11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %11, !llvm.loop !31

.critedge:                                        ; preds = %.thread87, %.split95.us, %._crit_edge, %2
  %spec.select = phi ptr [ %14, %._crit_edge ], [ null, %2 ], [ %14, %.split95.us ], [ null, %.thread87 ]
  ret ptr %spec.select
}

; 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 i32 @read_32s(ptr noundef) local_unnamed_addr #2

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

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

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

declare ptr @sdsnewlen(ptr noundef, i64 noundef) local_unnamed_addr #4

declare ptr @sdsempty() local_unnamed_addr #4

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

declare ptr @sdsdup(ptr noundef) local_unnamed_addr #4

declare ptr @sdsnew(ptr noundef) local_unnamed_addr #4

declare void @sdsfree(ptr noundef) local_unnamed_addr #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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, !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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !7, i64 0}
!17 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 10, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !11, i64 32}
!18 = !{!17, !7, i64 4}
!19 = !{!17, !10, i64 8}
!20 = !{!17, !10, i64 10}
!21 = !{!17, !7, i64 12}
!22 = !{!17, !7, i64 16}
!23 = !{!17, !7, i64 20}
!24 = !{!17, !7, i64 24}
!25 = !{!17, !7, i64 28}
!26 = !{!17, !11, i64 32}
!27 = !{!8, !8, i64 0}
!28 = distinct !{!28, !14}
!29 = distinct !{!29, !14}
!30 = distinct !{!30, !14}
!31 = distinct !{!31, !14}


; 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