; LLVM IR from caryll/otfcc :: lib/table/otl/subtables (gpos-mark-to-ligature)

; 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_subtable_gpos_markToLigature = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.subtable_gpos_markToLigature = type { i16, %struct.otl_MarkArray, %struct.otl_LigatureArray }
%struct.otl_MarkArray = type { i64, i64, ptr }
%struct.otl_LigatureArray = type { i64, i64, ptr }
%struct.otl_ClassnameHash = type { ptr, i16, %struct.UT_hash_handle }
%struct.UT_hash_handle = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32 }
%struct.UT_hash_table = type { ptr, i32, i32, i32, ptr, i64, i32, i32, i32, i32, i32 }
%struct.UT_hash_bucket = type { ptr, i32, i32 }

@iSubtable_gpos_markToLigature = external dso_local constant %struct.__caryll_elementinterface_subtable_gpos_markToLigature, align 8
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

declare void @sdsfree(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @otl_gpos_parse_markToLigature(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = call ptr @json_obj_get_type(ptr noundef %16, ptr noundef @.str.5, i32 noundef 1)
  store ptr %17, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call ptr @json_obj_get_type(ptr noundef %18, ptr noundef @.str.6, i32 noundef 1)
  store ptr %19, ptr %7, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %25

22:                                               ; preds = %2
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %26, label %25

25:                                               ; preds = %22, %2
  store ptr null, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %258

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %27 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_subtable_gpos_markToLigature, ptr @iSubtable_gpos_markToLigature, i32 0, i32 6), align 8, !tbaa !9
  %28 = call ptr (...) %27()
  store ptr %28, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr null, ptr %10, align 8, !tbaa !5
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %30, i32 0, i32 1
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  call void @otl_parseMarkArray(ptr noundef %29, ptr noundef %31, ptr noundef %10, ptr noundef %32)
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %42

35:                                               ; preds = %26
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %36, i32 0, i32 2
  %38 = getelementptr inbounds %struct.UT_hash_handle, ptr %37, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %40 = getelementptr inbounds %struct.UT_hash_table, ptr %39, i32 0, i32 3
  %41 = load i32, ptr %40, align 8, !tbaa !16
  br label %43

42:                                               ; preds = %26
  br label %43

43:                                               ; preds = %42, %35
  %44 = phi i32 [ %41, %35 ], [ 0, %42 ]
  %45 = trunc i32 %44 to i16
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %46, i32 0, i32 0
  store i16 %45, ptr %47, align 8, !tbaa !19
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  call void @parseBases(ptr noundef %48, ptr noundef %49, ptr noundef %10, ptr noundef %50)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %51, ptr %11, align 8, !tbaa !5
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %59

54:                                               ; preds = %43
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %55, i32 0, i32 2
  %57 = getelementptr inbounds %struct.UT_hash_handle, ptr %56, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !22
  br label %60

59:                                               ; preds = %43
  br label %60

60:                                               ; preds = %59, %54
  %61 = phi ptr [ %58, %54 ], [ null, %59 ]
  store ptr %61, ptr %12, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %254, %60
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %256

65:                                               ; preds = %62
  br label %66

66:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %67, i32 0, i32 2
  store ptr %68, ptr %13, align 8, !tbaa !5
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.UT_hash_handle, ptr %69, i32 0, i32 1
  %71 = load ptr, ptr %70, align 8, !tbaa !23
  %72 = icmp eq ptr %71, null
  br i1 %72, label %73, label %89

73:                                               ; preds = %66
  %74 = load ptr, ptr %13, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.UT_hash_handle, ptr %74, i32 0, i32 2
  %76 = load ptr, ptr %75, align 8, !tbaa !24
  %77 = icmp eq ptr %76, null
  br i1 %77, label %78, label %89

78:                                               ; preds = %73
  %79 = load ptr, ptr %10, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %79, i32 0, i32 2
  %81 = getelementptr inbounds %struct.UT_hash_handle, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !11
  %83 = getelementptr inbounds %struct.UT_hash_table, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !25
  call void @free(ptr noundef %84) #5
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %85, i32 0, i32 2
  %87 = getelementptr inbounds %struct.UT_hash_handle, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8, !tbaa !11
  call void @free(ptr noundef %88) #5
  store ptr null, ptr %10, align 8, !tbaa !5
  br label %237

89:                                               ; preds = %73, %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %90 = load ptr, ptr %13, align 8, !tbaa !5
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %91, i32 0, i32 2
  %93 = getelementptr inbounds %struct.UT_hash_handle, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !11
  %95 = getelementptr inbounds %struct.UT_hash_table, ptr %94, i32 0, i32 4
  %96 = load ptr, ptr %95, align 8, !tbaa !26
  %97 = icmp eq ptr %90, %96
  br i1 %97, label %98, label %114

98:                                               ; preds = %89
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.UT_hash_handle, ptr %99, i32 0, i32 1
  %101 = load ptr, ptr %100, align 8, !tbaa !23
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %102, i32 0, i32 2
  %104 = getelementptr inbounds %struct.UT_hash_handle, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !11
  %106 = getelementptr inbounds %struct.UT_hash_table, ptr %105, i32 0, i32 5
  %107 = load i64, ptr %106, align 8, !tbaa !27
  %108 = getelementptr inbounds i8, ptr %101, i64 %107
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %109, i32 0, i32 2
  %111 = getelementptr inbounds %struct.UT_hash_handle, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !11
  %113 = getelementptr inbounds %struct.UT_hash_table, ptr %112, i32 0, i32 4
  store ptr %108, ptr %113, align 8, !tbaa !26
  br label %114

114:                                              ; preds = %98, %89
  %115 = load ptr, ptr %13, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.UT_hash_handle, ptr %115, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !23
  %118 = icmp ne ptr %117, null
  br i1 %118, label %119, label %134

119:                                              ; preds = %114
  %120 = load ptr, ptr %13, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.UT_hash_handle, ptr %120, i32 0, i32 2
  %122 = load ptr, ptr %121, align 8, !tbaa !24
  %123 = load ptr, ptr %13, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.UT_hash_handle, ptr %123, i32 0, i32 1
  %125 = load ptr, ptr %124, align 8, !tbaa !23
  %126 = load ptr, ptr %10, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %126, i32 0, i32 2
  %128 = getelementptr inbounds %struct.UT_hash_handle, ptr %127, i32 0, i32 0
  %129 = load ptr, ptr %128, align 8, !tbaa !11
  %130 = getelementptr inbounds %struct.UT_hash_table, ptr %129, i32 0, i32 5
  %131 = load i64, ptr %130, align 8, !tbaa !27
  %132 = getelementptr inbounds i8, ptr %125, i64 %131
  %133 = getelementptr inbounds %struct.UT_hash_handle, ptr %132, i32 0, i32 2
  store ptr %122, ptr %133, align 8, !tbaa !24
  br label %141

134:                                              ; preds = %114
  br label %135

135:                                              ; preds = %134
  %136 = load ptr, ptr %13, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.UT_hash_handle, ptr %136, i32 0, i32 2
  %138 = load ptr, ptr %137, align 8, !tbaa !24
  store ptr %138, ptr %10, align 8, !tbaa !5
  br label %139

139:                                              ; preds = %135
  br label %140

140:                                              ; preds = %139
  br label %141

141:                                              ; preds = %140, %119
  %142 = load ptr, ptr %13, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.UT_hash_handle, ptr %142, i32 0, i32 2
  %144 = load ptr, ptr %143, align 8, !tbaa !24
  %145 = icmp ne ptr %144, null
  br i1 %145, label %146, label %161

146:                                              ; preds = %141
  %147 = load ptr, ptr %13, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.UT_hash_handle, ptr %147, i32 0, i32 1
  %149 = load ptr, ptr %148, align 8, !tbaa !23
  %150 = load ptr, ptr %13, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.UT_hash_handle, ptr %150, i32 0, i32 2
  %152 = load ptr, ptr %151, align 8, !tbaa !24
  %153 = load ptr, ptr %10, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %153, i32 0, i32 2
  %155 = getelementptr inbounds %struct.UT_hash_handle, ptr %154, i32 0, i32 0
  %156 = load ptr, ptr %155, align 8, !tbaa !11
  %157 = getelementptr inbounds %struct.UT_hash_table, ptr %156, i32 0, i32 5
  %158 = load i64, ptr %157, align 8, !tbaa !27
  %159 = getelementptr inbounds i8, ptr %152, i64 %158
  %160 = getelementptr inbounds %struct.UT_hash_handle, ptr %159, i32 0, i32 1
  store ptr %149, ptr %160, align 8, !tbaa !23
  br label %161

161:                                              ; preds = %146, %141
  br label %162

162:                                              ; preds = %161
  %163 = load ptr, ptr %13, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.UT_hash_handle, ptr %163, i32 0, i32 7
  %165 = load i32, ptr %164, align 4, !tbaa !28
  %166 = load ptr, ptr %10, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %166, i32 0, i32 2
  %168 = getelementptr inbounds %struct.UT_hash_handle, ptr %167, i32 0, i32 0
  %169 = load ptr, ptr %168, align 8, !tbaa !11
  %170 = getelementptr inbounds %struct.UT_hash_table, ptr %169, i32 0, i32 1
  %171 = load i32, ptr %170, align 8, !tbaa !29
  %172 = sub i32 %171, 1
  %173 = and i32 %165, %172
  store i32 %173, ptr %14, align 4, !tbaa !30
  br label %174

174:                                              ; preds = %162
  br label %175

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %177 = load ptr, ptr %10, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %177, i32 0, i32 2
  %179 = getelementptr inbounds %struct.UT_hash_handle, ptr %178, i32 0, i32 0
  %180 = load ptr, ptr %179, align 8, !tbaa !11
  %181 = getelementptr inbounds %struct.UT_hash_table, ptr %180, i32 0, i32 0
  %182 = load ptr, ptr %181, align 8, !tbaa !25
  %183 = load i32, ptr %14, align 4, !tbaa !30
  %184 = zext i32 %183 to i64
  %185 = getelementptr inbounds %struct.UT_hash_bucket, ptr %182, i64 %184
  store ptr %185, ptr %15, align 8, !tbaa !5
  %186 = load ptr, ptr %15, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.UT_hash_bucket, ptr %186, i32 0, i32 1
  %188 = load i32, ptr %187, align 8, !tbaa !31
  %189 = add i32 %188, -1
  store i32 %189, ptr %187, align 8, !tbaa !31
  %190 = load ptr, ptr %15, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.UT_hash_bucket, ptr %190, i32 0, i32 0
  %192 = load ptr, ptr %191, align 8, !tbaa !33
  %193 = load ptr, ptr %13, align 8, !tbaa !5
  %194 = icmp eq ptr %192, %193
  br i1 %194, label %195, label %201

195:                                              ; preds = %176
  %196 = load ptr, ptr %13, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.UT_hash_handle, ptr %196, i32 0, i32 4
  %198 = load ptr, ptr %197, align 8, !tbaa !34
  %199 = load ptr, ptr %15, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.UT_hash_bucket, ptr %199, i32 0, i32 0
  store ptr %198, ptr %200, align 8, !tbaa !33
  br label %201

201:                                              ; preds = %195, %176
  %202 = load ptr, ptr %13, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.UT_hash_handle, ptr %202, i32 0, i32 3
  %204 = load ptr, ptr %203, align 8, !tbaa !35
  %205 = icmp ne ptr %204, null
  br i1 %205, label %206, label %214

206:                                              ; preds = %201
  %207 = load ptr, ptr %13, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.UT_hash_handle, ptr %207, i32 0, i32 4
  %209 = load ptr, ptr %208, align 8, !tbaa !34
  %210 = load ptr, ptr %13, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.UT_hash_handle, ptr %210, i32 0, i32 3
  %212 = load ptr, ptr %211, align 8, !tbaa !35
  %213 = getelementptr inbounds %struct.UT_hash_handle, ptr %212, i32 0, i32 4
  store ptr %209, ptr %213, align 8, !tbaa !34
  br label %214

214:                                              ; preds = %206, %201
  %215 = load ptr, ptr %13, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.UT_hash_handle, ptr %215, i32 0, i32 4
  %217 = load ptr, ptr %216, align 8, !tbaa !34
  %218 = icmp ne ptr %217, null
  br i1 %218, label %219, label %227

219:                                              ; preds = %214
  %220 = load ptr, ptr %13, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.UT_hash_handle, ptr %220, i32 0, i32 3
  %222 = load ptr, ptr %221, align 8, !tbaa !35
  %223 = load ptr, ptr %13, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.UT_hash_handle, ptr %223, i32 0, i32 4
  %225 = load ptr, ptr %224, align 8, !tbaa !34
  %226 = getelementptr inbounds %struct.UT_hash_handle, ptr %225, i32 0, i32 3
  store ptr %222, ptr %226, align 8, !tbaa !35
  br label %227

227:                                              ; preds = %219, %214
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %228

228:                                              ; preds = %227
  br label %229

229:                                              ; preds = %228
  %230 = load ptr, ptr %10, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %230, i32 0, i32 2
  %232 = getelementptr inbounds %struct.UT_hash_handle, ptr %231, i32 0, i32 0
  %233 = load ptr, ptr %232, align 8, !tbaa !11
  %234 = getelementptr inbounds %struct.UT_hash_table, ptr %233, i32 0, i32 3
  %235 = load i32, ptr %234, align 8, !tbaa !16
  %236 = add i32 %235, -1
  store i32 %236, ptr %234, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %237

237:                                              ; preds = %229, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %238

238:                                              ; preds = %237
  br label %239

239:                                              ; preds = %238
  %240 = load ptr, ptr %11, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %240, i32 0, i32 0
  %242 = load ptr, ptr %241, align 8, !tbaa !36
  call void @sdsfree(ptr noundef %242)
  %243 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %243) #5
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %244

244:                                              ; preds = %239
  %245 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %245, ptr %11, align 8, !tbaa !5
  %246 = load ptr, ptr %12, align 8, !tbaa !5
  %247 = icmp ne ptr %246, null
  br i1 %247, label %248, label %253

248:                                              ; preds = %244
  %249 = load ptr, ptr %12, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.otl_ClassnameHash, ptr %249, i32 0, i32 2
  %251 = getelementptr inbounds %struct.UT_hash_handle, ptr %250, i32 0, i32 2
  %252 = load ptr, ptr %251, align 8, !tbaa !22
  br label %254

253:                                              ; preds = %244
  br label %254

254:                                              ; preds = %253, %248
  %255 = phi ptr [ %252, %248 ], [ null, %253 ]
  store ptr %255, ptr %12, align 8, !tbaa !5
  br label %62, !llvm.loop !37

256:                                              ; preds = %62
  %257 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %257, ptr %3, align 8
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %258

258:                                              ; preds = %256, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %259 = load ptr, ptr %3, align 8
  ret ptr %259
}

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

declare void @otl_parseMarkArray(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @parseBases(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 48}
!10 = !{!"__caryll_elementinterface_subtable_gpos_markToLigature", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!11 = !{!12, !6, i64 16}
!12 = !{!"", !6, i64 0, !13, i64 8, !14, i64 16}
!13 = !{!"short", !7, i64 0}
!14 = !{!"UT_hash_handle", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !15, i64 48, !15, i64 52}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !15, i64 16}
!17 = !{!"UT_hash_table", !6, i64 0, !15, i64 8, !15, i64 12, !15, i64 16, !6, i64 24, !18, i64 32, !15, i64 40, !15, i64 44, !15, i64 48, !15, i64 52, !15, i64 56}
!18 = !{!"long", !7, i64 0}
!19 = !{!20, !13, i64 0}
!20 = !{!"", !13, i64 0, !21, i64 8, !21, i64 32}
!21 = !{!"", !18, i64 0, !18, i64 8, !6, i64 16}
!22 = !{!12, !6, i64 32}
!23 = !{!14, !6, i64 8}
!24 = !{!14, !6, i64 16}
!25 = !{!17, !6, i64 0}
!26 = !{!17, !6, i64 24}
!27 = !{!17, !18, i64 32}
!28 = !{!14, !15, i64 52}
!29 = !{!17, !15, i64 8}
!30 = !{!15, !15, i64 0}
!31 = !{!32, !15, i64 8}
!32 = !{!"UT_hash_bucket", !6, i64 0, !15, i64 8, !15, i64 12}
!33 = !{!32, !6, i64 0}
!34 = !{!14, !6, i64 32}
!35 = !{!14, !6, i64 24}
!36 = !{!12, !6, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}


; 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_subtable_gpos_markToLigature = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.UT_hash_bucket = type { ptr, i32, i32 }

@iSubtable_gpos_markToLigature = external dso_local local_unnamed_addr constant %struct.__caryll_elementinterface_subtable_gpos_markToLigature, align 8
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

declare void @sdsfree(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local ptr @otl_gpos_parse_markToLigature(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca ptr, align 8
  %4 = tail call ptr @json_obj_get_type(ptr noundef %0, ptr noundef nonnull @.str.5, i32 noundef 1)
  %5 = tail call ptr @json_obj_get_type(ptr noundef %0, ptr noundef nonnull @.str.6, i32 noundef 1)
  %6 = icmp ne ptr %4, null
  %7 = icmp ne ptr %5, null
  %or.cond = select i1 %6, i1 %7, i1 false
  br i1 %or.cond, label %8, label %104

8:                                                ; preds = %2
  %9 = load ptr, ptr getelementptr inbounds (i8, ptr @iSubtable_gpos_markToLigature, i64 48), align 8, !tbaa !5
  %10 = tail call ptr (...) %9() #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  store ptr null, ptr %3, align 8, !tbaa !10
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  call void @otl_parseMarkArray(ptr noundef nonnull %4, ptr noundef nonnull %11, ptr noundef nonnull %3, ptr noundef %1) #5
  %12 = load ptr, ptr %3, align 8, !tbaa !10
  %.not = icmp eq ptr %12, null
  br i1 %.not, label %19, label %13

13:                                               ; preds = %8
  %14 = getelementptr inbounds i8, ptr %12, i64 16
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  %17 = load i32, ptr %16, align 8, !tbaa !16
  %18 = trunc i32 %17 to i16
  br label %19

19:                                               ; preds = %8, %13
  %20 = phi i16 [ %18, %13 ], [ 0, %8 ]
  store i16 %20, ptr %10, align 8, !tbaa !19
  call void @parseBases(ptr noundef nonnull %5, ptr noundef nonnull %10, ptr noundef nonnull %3, ptr noundef %1)
  %21 = load ptr, ptr %3, align 8, !tbaa !10
  %.not55 = icmp eq ptr %21, null
  br i1 %.not55, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %19, %102
  %.sink72 = phi ptr [ %23, %102 ], [ %21, %19 ]
  %22 = getelementptr inbounds i8, ptr %.sink72, i64 32
  %23 = load ptr, ptr %22, align 8, !tbaa !22
  %24 = getelementptr inbounds i8, ptr %.sink72, i64 16
  %25 = getelementptr inbounds i8, ptr %.sink72, i64 24
  %26 = load ptr, ptr %25, align 8, !tbaa !23
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %.lr.ph._crit_edge

.lr.ph._crit_edge:                                ; preds = %.lr.ph
  %.pre = load ptr, ptr %3, align 8, !tbaa !10
  br label %39

28:                                               ; preds = %.lr.ph
  %29 = getelementptr inbounds i8, ptr %.sink72, i64 32
  %30 = load ptr, ptr %29, align 8, !tbaa !24
  %31 = icmp eq ptr %30, null
  %.pre65 = load ptr, ptr %3, align 8, !tbaa !10
  br i1 %31, label %32, label %39

32:                                               ; preds = %28
  %33 = getelementptr inbounds i8, ptr %.pre65, i64 16
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = load ptr, ptr %34, align 8, !tbaa !25
  call void @free(ptr noundef %35) #5
  %36 = load ptr, ptr %3, align 8, !tbaa !10
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %38 = load ptr, ptr %37, align 8, !tbaa !11
  call void @free(ptr noundef %38) #5
  store ptr null, ptr %3, align 8, !tbaa !10
  br label %102

39:                                               ; preds = %.lr.ph._crit_edge, %28
  %40 = phi ptr [ %.pre, %.lr.ph._crit_edge ], [ %.pre65, %28 ]
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  %43 = getelementptr inbounds i8, ptr %42, i64 24
  %44 = load ptr, ptr %43, align 8, !tbaa !26
  %45 = icmp eq ptr %24, %44
  br i1 %45, label %46, label %50

46:                                               ; preds = %39
  %47 = getelementptr inbounds i8, ptr %42, i64 32
  %48 = load i64, ptr %47, align 8, !tbaa !27
  %49 = getelementptr inbounds i8, ptr %26, i64 %48
  store ptr %49, ptr %43, align 8, !tbaa !26
  br label %50

50:                                               ; preds = %46, %39
  %51 = getelementptr inbounds i8, ptr %.sink72, i64 32
  %52 = load ptr, ptr %51, align 8, !tbaa !24
  br i1 %27, label %58, label %53

53:                                               ; preds = %50
  %54 = getelementptr inbounds i8, ptr %42, i64 32
  %55 = load i64, ptr %54, align 8, !tbaa !27
  %56 = getelementptr inbounds i8, ptr %26, i64 %55
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  store ptr %52, ptr %57, align 8, !tbaa !24
  %.pre67.pre = load ptr, ptr %3, align 8, !tbaa !10
  br label %59

58:                                               ; preds = %50
  store ptr %52, ptr %3, align 8, !tbaa !10
  br label %59

59:                                               ; preds = %58, %53
  %.pre67 = phi ptr [ %52, %58 ], [ %.pre67.pre, %53 ]
  %.not58 = icmp eq ptr %52, null
  br i1 %.not58, label %67, label %60

60:                                               ; preds = %59
  %61 = getelementptr inbounds i8, ptr %.pre67, i64 16
  %62 = load ptr, ptr %61, align 8, !tbaa !11
  %63 = getelementptr inbounds i8, ptr %62, i64 32
  %64 = load i64, ptr %63, align 8, !tbaa !27
  %65 = getelementptr inbounds i8, ptr %52, i64 %64
  %66 = getelementptr inbounds i8, ptr %65, i64 8
  store ptr %26, ptr %66, align 8, !tbaa !23
  %.pre66 = load ptr, ptr %3, align 8, !tbaa !10
  br label %67

67:                                               ; preds = %59, %60
  %68 = phi ptr [ %.pre67, %59 ], [ %.pre66, %60 ]
  %69 = getelementptr inbounds i8, ptr %.sink72, i64 68
  %70 = load i32, ptr %69, align 4, !tbaa !28
  %71 = getelementptr inbounds i8, ptr %68, i64 16
  %72 = load ptr, ptr %71, align 8, !tbaa !11
  %73 = getelementptr inbounds i8, ptr %72, i64 8
  %74 = load i32, ptr %73, align 8, !tbaa !29
  %75 = add i32 %74, -1
  %76 = and i32 %75, %70
  %77 = load ptr, ptr %72, align 8, !tbaa !25
  %78 = zext i32 %76 to i64
  %79 = getelementptr inbounds %struct.UT_hash_bucket, ptr %77, i64 %78
  %80 = getelementptr inbounds i8, ptr %79, i64 8
  %81 = load i32, ptr %80, align 8, !tbaa !30
  %82 = add i32 %81, -1
  store i32 %82, ptr %80, align 8, !tbaa !30
  %83 = load ptr, ptr %79, align 8, !tbaa !32
  %84 = icmp eq ptr %83, %24
  br i1 %84, label %85, label %88

85:                                               ; preds = %67
  %86 = getelementptr inbounds i8, ptr %.sink72, i64 48
  %87 = load ptr, ptr %86, align 8, !tbaa !33
  store ptr %87, ptr %79, align 8, !tbaa !32
  br label %88

88:                                               ; preds = %85, %67
  %89 = getelementptr inbounds i8, ptr %.sink72, i64 40
  %90 = load ptr, ptr %89, align 8, !tbaa !34
  %.not59 = icmp eq ptr %90, null
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.sink72, i64 48
  %.pre69 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !33
  br i1 %.not59, label %._crit_edge68, label %91

91:                                               ; preds = %88
  %92 = getelementptr inbounds i8, ptr %90, i64 32
  store ptr %.pre69, ptr %92, align 8, !tbaa !33
  br label %._crit_edge68

._crit_edge68:                                    ; preds = %88, %91
  %.not60 = icmp eq ptr %.pre69, null
  br i1 %.not60, label %95, label %93

93:                                               ; preds = %._crit_edge68
  %94 = getelementptr inbounds i8, ptr %.pre69, i64 24
  store ptr %90, ptr %94, align 8, !tbaa !34
  br label %95

95:                                               ; preds = %93, %._crit_edge68
  %96 = load ptr, ptr %3, align 8, !tbaa !10
  %97 = getelementptr inbounds i8, ptr %96, i64 16
  %98 = load ptr, ptr %97, align 8, !tbaa !11
  %99 = getelementptr inbounds i8, ptr %98, i64 16
  %100 = load i32, ptr %99, align 8, !tbaa !16
  %101 = add i32 %100, -1
  store i32 %101, ptr %99, align 8, !tbaa !16
  br label %102

102:                                              ; preds = %95, %32
  %103 = load ptr, ptr %.sink72, align 8, !tbaa !35
  call void @sdsfree(ptr noundef %103) #5
  call void @free(ptr noundef nonnull %.sink72) #5
  %.not61 = icmp eq ptr %23, null
  br i1 %.not61, label %._crit_edge, label %.lr.ph, !llvm.loop !36

._crit_edge:                                      ; preds = %102, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %104

104:                                              ; preds = %2, %._crit_edge
  %.0 = phi ptr [ %10, %._crit_edge ], [ null, %2 ]
  ret ptr %.0
}

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

declare void @otl_parseMarkArray(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @parseBases(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 = { 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, !7, i64 48}
!6 = !{!"__caryll_elementinterface_subtable_gpos_markToLigature", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !7, i64 16}
!12 = !{!"", !7, i64 0, !13, i64 8, !14, i64 16}
!13 = !{!"short", !8, i64 0}
!14 = !{!"UT_hash_handle", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !15, i64 48, !15, i64 52}
!15 = !{!"int", !8, i64 0}
!16 = !{!17, !15, i64 16}
!17 = !{!"UT_hash_table", !7, i64 0, !15, i64 8, !15, i64 12, !15, i64 16, !7, i64 24, !18, i64 32, !15, i64 40, !15, i64 44, !15, i64 48, !15, i64 52, !15, i64 56}
!18 = !{!"long", !8, i64 0}
!19 = !{!20, !13, i64 0}
!20 = !{!"", !13, i64 0, !21, i64 8, !21, i64 32}
!21 = !{!"", !18, i64 0, !18, i64 8, !7, i64 16}
!22 = !{!12, !7, i64 32}
!23 = !{!14, !7, i64 8}
!24 = !{!14, !7, i64 16}
!25 = !{!17, !7, i64 0}
!26 = !{!17, !7, i64 24}
!27 = !{!17, !18, i64 32}
!28 = !{!14, !15, i64 52}
!29 = !{!17, !15, i64 8}
!30 = !{!31, !15, i64 8}
!31 = !{!"UT_hash_bucket", !7, i64 0, !15, i64 8, !15, i64 12}
!32 = !{!31, !7, i64 0}
!33 = !{!14, !7, i64 32}
!34 = !{!14, !7, i64 24}
!35 = !{!12, !7, i64 0}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass