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

; 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_table_name = type { ptr, ptr, ptr, ptr, ptr, ptr, 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.otfcc_NameRecord = type { i16, i16, i16, i16, ptr }
%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_iName = external dso_local constant %struct.__caryll_vectorinterface_table_name, align 8
@.str = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_readName(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 i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i16, align 2
  %17 = alloca %struct.otfcc_NameRecord, align 8
  %18 = alloca i16, align 2
  %19 = alloca i16, align 2
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca ptr, align 8
  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 %24

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

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

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

36:                                               ; preds = %30, %27, %24
  %37 = phi i1 [ false, %27 ], [ false, %24 ], [ %35, %30 ]
  br i1 %37, label %39, label %38

38:                                               ; preds = %36
  store i32 2, ptr %8, align 4
  br label %250

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

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

48:                                               ; preds = %45
  store i32 5, ptr %8, align 4
  br label %240

49:                                               ; preds = %45
  %50 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %9, i32 0, i32 0
  %51 = load i32, ptr %50, align 8, !tbaa !16
  %52 = icmp eq i32 %51, 1851878757
  br i1 %52, label %53, label %234

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

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

57:                                               ; preds = %54
  store i32 8, ptr %8, align 4
  br label %231

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

65:                                               ; preds = %58
  br label %210

66:                                               ; preds = %58
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 2
  %69 = call zeroext i16 @read_16u(ptr noundef %68)
  %70 = zext i16 %69 to i32
  store i32 %70, ptr %14, align 4, !tbaa !9
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %71, i64 4
  %73 = call zeroext i16 @read_16u(ptr noundef %72)
  %74 = zext i16 %73 to i32
  store i32 %74, ptr %15, align 4, !tbaa !9
  %75 = load i32, ptr %13, align 4, !tbaa !9
  %76 = load i32, ptr %14, align 4, !tbaa !9
  %77 = mul i32 12, %76
  %78 = add i32 6, %77
  %79 = icmp ult i32 %75, %78
  br i1 %79, label %80, label %81

80:                                               ; preds = %66
  br label %210

81:                                               ; preds = %66
  %82 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_table_name, ptr @table_iName, i32 0, i32 6), align 8, !tbaa !20
  %83 = call ptr (...) %82()
  store ptr %83, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #6
  store i16 0, ptr %16, align 2, !tbaa !22
  br label %84

84:                                               ; preds = %205, %81
  %85 = load i16, ptr %16, align 2, !tbaa !22
  %86 = zext i16 %85 to i32
  %87 = load i32, ptr %14, align 4, !tbaa !9
  %88 = icmp ult i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %84
  store i32 12, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #6
  br label %208

90:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %91, i64 6
  %93 = load i16, ptr %16, align 2, !tbaa !22
  %94 = zext i16 %93 to i32
  %95 = mul nsw i32 %94, 12
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i8, ptr %92, i64 %96
  %98 = call zeroext i16 @read_16u(ptr noundef %97)
  %99 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %17, i32 0, i32 0
  store i16 %98, ptr %99, align 8, !tbaa !23
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %100, i64 6
  %102 = load i16, ptr %16, align 2, !tbaa !22
  %103 = zext i16 %102 to i32
  %104 = mul nsw i32 %103, 12
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds i8, ptr %101, i64 %105
  %107 = getelementptr inbounds i8, ptr %106, i64 2
  %108 = call zeroext i16 @read_16u(ptr noundef %107)
  %109 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %17, i32 0, i32 1
  store i16 %108, ptr %109, align 2, !tbaa !25
  %110 = load ptr, ptr %12, align 8, !tbaa !5
  %111 = getelementptr inbounds i8, ptr %110, i64 6
  %112 = load i16, ptr %16, align 2, !tbaa !22
  %113 = zext i16 %112 to i32
  %114 = mul nsw i32 %113, 12
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i8, ptr %111, i64 %115
  %117 = getelementptr inbounds i8, ptr %116, i64 4
  %118 = call zeroext i16 @read_16u(ptr noundef %117)
  %119 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %17, i32 0, i32 2
  store i16 %118, ptr %119, align 4, !tbaa !26
  %120 = load ptr, ptr %12, align 8, !tbaa !5
  %121 = getelementptr inbounds i8, ptr %120, i64 6
  %122 = load i16, ptr %16, align 2, !tbaa !22
  %123 = zext i16 %122 to i32
  %124 = mul nsw i32 %123, 12
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i8, ptr %121, i64 %125
  %127 = getelementptr inbounds i8, ptr %126, i64 6
  %128 = call zeroext i16 @read_16u(ptr noundef %127)
  %129 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %17, i32 0, i32 3
  store i16 %128, ptr %129, align 2, !tbaa !27
  %130 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %17, i32 0, i32 4
  store ptr null, ptr %130, align 8, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #6
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = getelementptr inbounds i8, ptr %131, i64 6
  %133 = load i16, ptr %16, align 2, !tbaa !22
  %134 = zext i16 %133 to i32
  %135 = mul nsw i32 %134, 12
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i8, ptr %132, i64 %136
  %138 = getelementptr inbounds i8, ptr %137, i64 8
  %139 = call zeroext i16 @read_16u(ptr noundef %138)
  store i16 %139, ptr %18, align 2, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 2, ptr %19) #6
  %140 = load ptr, ptr %12, align 8, !tbaa !5
  %141 = getelementptr inbounds i8, ptr %140, i64 6
  %142 = load i16, ptr %16, align 2, !tbaa !22
  %143 = zext i16 %142 to i32
  %144 = mul nsw i32 %143, 12
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds i8, ptr %141, i64 %145
  %147 = getelementptr inbounds i8, ptr %146, i64 10
  %148 = call zeroext i16 @read_16u(ptr noundef %147)
  store i16 %148, ptr %19, align 2, !tbaa !22
  %149 = call zeroext i1 @shouldDecodeAsBytes(ptr noundef %17)
  br i1 %149, label %150, label %164

150:                                              ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %151 = load ptr, ptr %12, align 8, !tbaa !5
  %152 = load i32, ptr %15, align 4, !tbaa !9
  %153 = zext i32 %152 to i64
  %154 = getelementptr inbounds i8, ptr %151, i64 %153
  %155 = load i16, ptr %19, align 2, !tbaa !22
  %156 = zext i16 %155 to i32
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds i8, ptr %154, i64 %157
  %159 = load i16, ptr %18, align 2, !tbaa !22
  %160 = zext i16 %159 to i64
  %161 = call ptr @sdsnewlen(ptr noundef %158, i64 noundef %160)
  store ptr %161, ptr %20, align 8, !tbaa !5
  %162 = load ptr, ptr %20, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %17, i32 0, i32 4
  store ptr %162, ptr %163, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %198

164:                                              ; preds = %90
  %165 = call zeroext i1 @shouldDecodeAsUTF16(ptr noundef %17)
  br i1 %165, label %166, label %180

166:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %167 = load ptr, ptr %12, align 8, !tbaa !5
  %168 = load i32, ptr %15, align 4, !tbaa !9
  %169 = zext i32 %168 to i64
  %170 = getelementptr inbounds i8, ptr %167, i64 %169
  %171 = load i16, ptr %19, align 2, !tbaa !22
  %172 = zext i16 %171 to i32
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds i8, ptr %170, i64 %173
  %175 = load i16, ptr %18, align 2, !tbaa !22
  %176 = zext i16 %175 to i32
  %177 = call ptr @utf16be_to_utf8(ptr noundef %174, i32 noundef %176)
  store ptr %177, ptr %21, align 8, !tbaa !5
  %178 = load ptr, ptr %21, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %17, i32 0, i32 4
  store ptr %178, ptr %179, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %197

180:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  store i64 0, ptr %22, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %181 = load ptr, ptr %12, align 8, !tbaa !5
  %182 = load i32, ptr %15, align 4, !tbaa !9
  %183 = zext i32 %182 to i64
  %184 = getelementptr inbounds i8, ptr %181, i64 %183
  %185 = load i16, ptr %19, align 2, !tbaa !22
  %186 = zext i16 %185 to i32
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds i8, ptr %184, i64 %187
  %189 = load i16, ptr %18, align 2, !tbaa !22
  %190 = zext i16 %189 to i64
  %191 = call ptr @base64_encode(ptr noundef %188, i64 noundef %190, ptr noundef %22)
  store ptr %191, ptr %23, align 8, !tbaa !5
  %192 = load ptr, ptr %23, align 8, !tbaa !5
  %193 = load i64, ptr %22, align 8, !tbaa !29
  %194 = call ptr @sdsnewlen(ptr noundef %192, i64 noundef %193)
  %195 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %17, i32 0, i32 4
  store ptr %194, ptr %195, align 8, !tbaa !28
  %196 = load ptr, ptr %23, align 8, !tbaa !5
  call void @free(ptr noundef %196) #6
  store ptr null, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %197

197:                                              ; preds = %180, %166
  br label %198

198:                                              ; preds = %197, %150
  %199 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_table_name, ptr @table_iName, i32 0, i32 13), align 8, !tbaa !31
  %200 = load ptr, ptr %11, align 8, !tbaa !5
  %201 = getelementptr inbounds { i64, ptr }, ptr %17, i32 0, i32 0
  %202 = load i64, ptr %201, align 8
  %203 = getelementptr inbounds { i64, ptr }, ptr %17, i32 0, i32 1
  %204 = load ptr, ptr %203, align 8
  call void %199(ptr noundef %200, i64 %202, ptr %204)
  call void @llvm.lifetime.end.p0(i64 2, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  br label %205

205:                                              ; preds = %198
  %206 = load i16, ptr %16, align 2, !tbaa !22
  %207 = add i16 %206, 1
  store i16 %207, ptr %16, align 2, !tbaa !22
  br label %84, !llvm.loop !32

208:                                              ; preds = %89
  %209 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %209, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %227

210:                                              ; preds = %80, %65
  %211 = load ptr, ptr %4, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.otfcc_Options, ptr %211, i32 0, i32 24
  %213 = load ptr, ptr %212, align 8, !tbaa !34
  %214 = getelementptr inbounds %struct.otfcc_ILogger, ptr %213, i32 0, i32 6
  %215 = load ptr, ptr %214, align 8, !tbaa !37
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.otfcc_Options, ptr %216, i32 0, i32 24
  %218 = load ptr, ptr %217, align 8, !tbaa !34
  %219 = call ptr @sdsempty()
  %220 = call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %219, ptr noundef @.str)
  call void %215(ptr noundef %218, i8 noundef zeroext 1, i32 noundef 1, ptr noundef %220)
  %221 = load ptr, ptr %11, align 8, !tbaa !5
  %222 = icmp ne ptr %221, null
  br i1 %222, label %223, label %226

223:                                              ; preds = %210
  %224 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_table_name, ptr @table_iName, i32 0, i32 7), align 8, !tbaa !39
  %225 = load ptr, ptr %11, align 8, !tbaa !5
  call void %224(ptr noundef %225)
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %226

226:                                              ; preds = %223, %210
  store i32 0, ptr %8, align 4
  br label %227

227:                                              ; preds = %226, %208
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  %228 = load i32, ptr %8, align 4
  switch i32 %228, label %231 [
    i32 0, label %229
  ]

229:                                              ; preds = %227
  br label %230

230:                                              ; preds = %229
  store i32 0, ptr %10, align 4, !tbaa !9
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %54, !llvm.loop !40

231:                                              ; preds = %227, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %232 = load i32, ptr %8, align 4
  switch i32 %232, label %240 [
    i32 8, label %233
  ]

233:                                              ; preds = %231
  br label %234

234:                                              ; preds = %233, %49
  br label %235

235:                                              ; preds = %234
  %236 = load i32, ptr %5, align 4, !tbaa !9
  %237 = icmp ne i32 %236, 0
  %238 = xor i1 %237, true
  %239 = zext i1 %238 to i32
  store i32 %239, ptr %5, align 4, !tbaa !9
  br label %45, !llvm.loop !41

240:                                              ; preds = %231, %48
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  %241 = load i32, ptr %8, align 4
  switch i32 %241, label %250 [
    i32 5, label %242
  ]

242:                                              ; preds = %240
  br label %243

243:                                              ; preds = %242
  %244 = load i32, ptr %5, align 4, !tbaa !9
  %245 = icmp ne i32 %244, 0
  %246 = xor i1 %245, true
  %247 = zext i1 %246 to i32
  store i32 %247, ptr %5, align 4, !tbaa !9
  %248 = load i32, ptr %6, align 4, !tbaa !9
  %249 = add nsw i32 %248, 1
  store i32 %249, ptr %6, align 4, !tbaa !9
  br label %24, !llvm.loop !42

250:                                              ; preds = %240, %38
  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
  %251 = load i32, ptr %8, align 4
  switch i32 %251, label %255 [
    i32 2, label %252
    i32 1, label %253
  ]

252:                                              ; preds = %250
  store ptr null, ptr %3, align 8
  br label %253

253:                                              ; preds = %252, %250
  %254 = load ptr, ptr %3, align 8
  ret ptr %254

255:                                              ; preds = %250
  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 zeroext i16 @read_16u(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @shouldDecodeAsBytes(ptr noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @shouldDecodeAsUTF16(ptr noundef) #0

declare ptr @utf16be_to_utf8(ptr noundef, i32 noundef) #4

declare ptr @base64_encode(ptr noundef, i64 noundef, ptr noundef) #4

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

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 "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 = !{!17, !10, i64 12}
!20 = !{!21, !6, i64 48}
!21 = !{!"__caryll_vectorinterface_table_name", !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}
!22 = !{!13, !13, i64 0}
!23 = !{!24, !13, i64 0}
!24 = !{!"", !13, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !6, i64 8}
!25 = !{!24, !13, i64 2}
!26 = !{!24, !13, i64 4}
!27 = !{!24, !13, i64 6}
!28 = !{!24, !6, i64 8}
!29 = !{!30, !30, i64 0}
!30 = !{!"long", !7, i64 0}
!31 = !{!21, !6, i64 104}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!35, !6, i64 32}
!35 = !{!"", !36, i64 0, !36, i64 1, !36, i64 2, !36, i64 3, !36, i64 4, !36, i64 5, !36, i64 6, !36, i64 7, !36, i64 8, !36, i64 9, !36, i64 10, !36, i64 11, !36, i64 12, !36, i64 13, !36, i64 14, !36, i64 15, !36, i64 16, !36, i64 17, !36, i64 18, !36, i64 19, !36, i64 20, !36, i64 21, !36, i64 22, !6, i64 24, !6, i64 32}
!36 = !{!"_Bool", !7, i64 0}
!37 = !{!38, !6, i64 48}
!38 = !{!"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}
!39 = !{!21, !6, i64 56}
!40 = distinct !{!40, !33}
!41 = distinct !{!41, !33}
!42 = distinct !{!42, !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.__caryll_vectorinterface_table_name = type { ptr, ptr, ptr, ptr, ptr, ptr, 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_NameRecord = type { i16, i16, i16, i16, ptr }
%struct.otfcc_PacketPiece = type { i32, i32, i32, i32, ptr }

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

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

.lr.ph:                                           ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %1, i64 32
  %11 = load ptr, ptr getelementptr inbounds (i8, ptr @table_iName, i64 48), align 8
  %12 = getelementptr inbounds i8, ptr %3, i64 2
  %13 = getelementptr inbounds i8, ptr %3, i64 4
  %14 = getelementptr inbounds i8, ptr %3, i64 6
  %15 = getelementptr inbounds i8, ptr %3, i64 8
  %16 = load ptr, ptr getelementptr inbounds (i8, ptr @table_iName, i64 104), align 8
  %17 = zext i16 %6 to i64
  br label %18

18:                                               ; preds = %.lr.ph, %.split114.us
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %.split114.us ]
  %19 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %9, i64 %indvars.iv
  %.sroa.0.0.copyload = load i32, ptr %19, align 8, !tbaa !12
  %20 = icmp eq i32 %.sroa.0.0.copyload, 1851878757
  br i1 %20, label %.split.us, label %.split114.us

.split.us:                                        ; preds = %18
  %.sroa.443.0..sroa_idx.le = getelementptr inbounds i8, ptr %19, i64 12
  %.sroa.443.0.copyload.le = load i32, ptr %.sroa.443.0..sroa_idx.le, align 4, !tbaa !12
  %.sroa.5.0..sroa_idx.le = getelementptr inbounds i8, ptr %19, i64 16
  %.sroa.5.0.copyload.le = load ptr, ptr %.sroa.5.0..sroa_idx.le, align 8, !tbaa !13
  %21 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 6
  %22 = icmp ult i32 %.sroa.443.0.copyload.le, 6
  br i1 %22, label %.critedge.sink.split, label %.preheader.us

.preheader.us:                                    ; preds = %.split.us
  %23 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 4
  %24 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 2
  %25 = tail call zeroext i16 @read_16u(ptr noundef nonnull %24)
  %26 = zext i16 %25 to i32
  %27 = tail call zeroext i16 @read_16u(ptr noundef nonnull %23)
  %28 = mul nuw nsw i32 %26, 12
  %29 = add nuw nsw i32 %28, 6
  %30 = icmp ult i32 %.sroa.443.0.copyload.le, %29
  br i1 %30, label %.critedge.sink.split, label %31

31:                                               ; preds = %.preheader.us
  %32 = tail call ptr (...) %11() #5
  %.not = icmp eq i16 %25, 0
  br i1 %.not, label %.critedge, label %.lr.ph107.us

33:                                               ; preds = %.lr.ph107.us, %67
  %indvars.iv126 = phi i64 [ 0, %.lr.ph107.us ], [ %indvars.iv.next127, %67 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  %34 = mul nuw nsw i64 %indvars.iv126, 12
  %35 = getelementptr inbounds i8, ptr %21, i64 %34
  %36 = call zeroext i16 @read_16u(ptr noundef nonnull %35)
  store i16 %36, ptr %3, align 8, !tbaa !14
  %37 = getelementptr inbounds i8, ptr %35, i64 2
  %38 = call zeroext i16 @read_16u(ptr noundef nonnull %37)
  store i16 %38, ptr %12, align 2, !tbaa !16
  %39 = getelementptr inbounds i8, ptr %35, i64 4
  %40 = call zeroext i16 @read_16u(ptr noundef nonnull %39)
  store i16 %40, ptr %13, align 4, !tbaa !17
  %41 = getelementptr inbounds i8, ptr %35, i64 6
  %42 = call zeroext i16 @read_16u(ptr noundef nonnull %41)
  store i16 %42, ptr %14, align 2, !tbaa !18
  store ptr null, ptr %15, align 8, !tbaa !19
  %43 = getelementptr inbounds i8, ptr %35, i64 8
  %44 = call zeroext i16 @read_16u(ptr noundef nonnull %43)
  %45 = getelementptr inbounds i8, ptr %35, i64 10
  %46 = call zeroext i16 @read_16u(ptr noundef nonnull %45)
  %47 = call zeroext i1 @shouldDecodeAsBytes(ptr noundef nonnull %3)
  br i1 %47, label %62, label %48

48:                                               ; preds = %33
  %49 = call zeroext i1 @shouldDecodeAsUTF16(ptr noundef nonnull %3)
  br i1 %49, label %57, label %50

50:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store i64 0, ptr %4, align 8, !tbaa !20
  %51 = zext i16 %46 to i64
  %52 = getelementptr inbounds i8, ptr %71, i64 %51
  %53 = zext i16 %44 to i64
  %54 = call ptr @base64_encode(ptr noundef %52, i64 noundef %53, ptr noundef nonnull %4) #5
  %55 = load i64, ptr %4, align 8, !tbaa !20
  %56 = call ptr @sdsnewlen(ptr noundef %54, i64 noundef %55) #5
  store ptr %56, ptr %15, align 8, !tbaa !19
  call void @free(ptr noundef %54) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %.pre = load ptr, ptr %15, align 8
  br label %67

57:                                               ; preds = %48
  %58 = zext i16 %46 to i64
  %59 = getelementptr inbounds i8, ptr %71, i64 %58
  %60 = zext i16 %44 to i32
  %61 = call ptr @utf16be_to_utf8(ptr noundef %59, i32 noundef %60) #5
  store ptr %61, ptr %15, align 8, !tbaa !19
  br label %67

62:                                               ; preds = %33
  %63 = zext i16 %46 to i64
  %64 = getelementptr inbounds i8, ptr %71, i64 %63
  %65 = zext i16 %44 to i64
  %66 = call ptr @sdsnewlen(ptr noundef %64, i64 noundef %65) #5
  store ptr %66, ptr %15, align 8, !tbaa !19
  br label %67

67:                                               ; preds = %62, %57, %50
  %68 = phi ptr [ %66, %62 ], [ %61, %57 ], [ %.pre, %50 ]
  %69 = load i64, ptr %3, align 8
  call void %16(ptr noundef %32, i64 %69, ptr %68) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next127, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %33, !llvm.loop !22

.lr.ph107.us:                                     ; preds = %31
  %70 = zext i16 %27 to i64
  %71 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 %70
  %wide.trip.count = zext i16 %25 to i64
  br label %33

.split114.us:                                     ; preds = %18
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not148 = icmp ult i64 %indvars.iv.next, %17
  br i1 %.not148, label %18, label %.critedge, !llvm.loop !24

.critedge.sink.split:                             ; preds = %.preheader.us, %.split.us
  %72 = load ptr, ptr %10, align 8, !tbaa !25
  %73 = getelementptr inbounds i8, ptr %72, i64 48
  %74 = load ptr, ptr %73, align 8, !tbaa !28
  %75 = tail call ptr @sdsempty() #5
  %76 = tail call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %75, ptr noundef nonnull @.str) #5
  tail call void %74(ptr noundef %72, i8 noundef zeroext 1, i32 noundef 1, ptr noundef %76) #5
  br label %.critedge

.critedge:                                        ; preds = %.split114.us, %67, %.critedge.sink.split, %2, %31
  %spec.select = phi ptr [ %32, %31 ], [ null, %2 ], [ null, %.critedge.sink.split ], [ %32, %67 ], [ null, %.split114.us ]
  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 zeroext i16 @read_16u(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @shouldDecodeAsBytes(ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @shouldDecodeAsUTF16(ptr noundef) local_unnamed_addr #0

declare ptr @utf16be_to_utf8(ptr noundef, i32 noundef) local_unnamed_addr #3

declare ptr @base64_encode(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

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

declare ptr @sdsempty() local_unnamed_addr #3

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 = { "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = !{!11, !11, i64 0}
!14 = !{!15, !10, i64 0}
!15 = !{!"", !10, i64 0, !10, i64 2, !10, i64 4, !10, i64 6, !11, i64 8}
!16 = !{!15, !10, i64 2}
!17 = !{!15, !10, i64 4}
!18 = !{!15, !10, i64 6}
!19 = !{!15, !11, i64 8}
!20 = !{!21, !21, i64 0}
!21 = !{!"long", !8, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = !{!26, !11, i64 32}
!26 = !{!"", !27, i64 0, !27, i64 1, !27, i64 2, !27, i64 3, !27, i64 4, !27, i64 5, !27, i64 6, !27, i64 7, !27, i64 8, !27, i64 9, !27, i64 10, !27, i64 11, !27, i64 12, !27, i64 13, !27, i64 14, !27, i64 15, !27, i64 16, !27, i64 17, !27, i64 18, !27, i64 19, !27, i64 20, !27, i64 21, !27, i64 22, !11, i64 24, !11, i64 32}
!27 = !{!"_Bool", !8, i64 0}
!28 = !{!29, !11, i64 48}
!29 = !{!"otfcc_ILogger", !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}


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