; 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.__otfcc_ICoverage = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otfcc_HandlePackage = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otfcc_Handle = type { i32, i16, 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_MarkRecord = type { %struct.otfcc_Handle, i16, %struct.otl_Anchor }
%struct.otl_Anchor = type { i8, double, double }
%struct.otl_LigatureBaseRecord = type { %struct.otfcc_Handle, i16, ptr }

@otl_iCoverage = external constant %struct.__otfcc_ICoverage, align 8
@otfcc_iHandle = external constant %struct.otfcc_HandlePackage, align 8

; 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

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_build_gpos_markToLigature(ptr noundef %0, i32 noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i16, align 2
  %8 = alloca %struct.otfcc_Handle, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i16, align 2
  %11 = alloca %struct.otfcc_Handle, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i16, align 2
  %15 = alloca ptr, align 8
  %16 = alloca i16, align 2
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i16, align 2
  %20 = alloca i16, align 2
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %21, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %22 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 6), align 8, !tbaa !11
  %23 = call ptr (...) %22()
  store ptr %23, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #3
  store i16 0, ptr %7, align 2, !tbaa !13
  br label %24

24:                                               ; preds = %58, %2
  %25 = load i16, ptr %7, align 2, !tbaa !13
  %26 = zext i16 %25 to i64
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %27, i32 0, i32 1
  %29 = getelementptr inbounds %struct.otl_MarkArray, ptr %28, i32 0, i32 0
  %30 = load i64, ptr %29, align 8, !tbaa !15
  %31 = icmp ult i64 %26, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #3
  br label %61

33:                                               ; preds = %24
  %34 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 15), align 8, !tbaa !19
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = load ptr, ptr getelementptr inbounds (%struct.otfcc_HandlePackage, ptr @otfcc_iHandle, i32 0, i32 7), align 8, !tbaa !20
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %37, i32 0, i32 1
  %39 = getelementptr inbounds %struct.otl_MarkArray, ptr %38, i32 0, i32 2
  %40 = load ptr, ptr %39, align 8, !tbaa !22
  %41 = load i16, ptr %7, align 2, !tbaa !13
  %42 = zext i16 %41 to i64
  %43 = getelementptr inbounds %struct.otl_MarkRecord, ptr %40, i64 %42
  %44 = getelementptr inbounds %struct.otl_MarkRecord, ptr %43, i32 0, i32 0
  %45 = getelementptr inbounds { i64, ptr }, ptr %44, i32 0, i32 0
  %46 = load i64, ptr %45, align 8
  %47 = getelementptr inbounds { i64, ptr }, ptr %44, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8
  %49 = call { i64, ptr } %36(i64 %46, ptr %48)
  %50 = getelementptr inbounds { i64, ptr }, ptr %8, i32 0, i32 0
  %51 = extractvalue { i64, ptr } %49, 0
  store i64 %51, ptr %50, align 8
  %52 = getelementptr inbounds { i64, ptr }, ptr %8, i32 0, i32 1
  %53 = extractvalue { i64, ptr } %49, 1
  store ptr %53, ptr %52, align 8
  %54 = getelementptr inbounds { i64, ptr }, ptr %8, i32 0, i32 0
  %55 = load i64, ptr %54, align 8
  %56 = getelementptr inbounds { i64, ptr }, ptr %8, i32 0, i32 1
  %57 = load ptr, ptr %56, align 8
  call void %34(ptr noundef %35, i64 %55, ptr %57)
  br label %58

58:                                               ; preds = %33
  %59 = load i16, ptr %7, align 2, !tbaa !13
  %60 = add i16 %59, 1
  store i16 %60, ptr %7, align 2, !tbaa !13
  br label %24, !llvm.loop !23

61:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %62 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 6), align 8, !tbaa !11
  %63 = call ptr (...) %62()
  store ptr %63, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #3
  store i16 0, ptr %10, align 2, !tbaa !13
  br label %64

64:                                               ; preds = %98, %61
  %65 = load i16, ptr %10, align 2, !tbaa !13
  %66 = zext i16 %65 to i64
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %67, i32 0, i32 2
  %69 = getelementptr inbounds %struct.otl_LigatureArray, ptr %68, i32 0, i32 0
  %70 = load i64, ptr %69, align 8, !tbaa !25
  %71 = icmp ult i64 %66, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #3
  br label %101

73:                                               ; preds = %64
  %74 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 15), align 8, !tbaa !19
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = load ptr, ptr getelementptr inbounds (%struct.otfcc_HandlePackage, ptr @otfcc_iHandle, i32 0, i32 7), align 8, !tbaa !20
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %77, i32 0, i32 2
  %79 = getelementptr inbounds %struct.otl_LigatureArray, ptr %78, i32 0, i32 2
  %80 = load ptr, ptr %79, align 8, !tbaa !26
  %81 = load i16, ptr %10, align 2, !tbaa !13
  %82 = zext i16 %81 to i64
  %83 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %80, i64 %82
  %84 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %83, i32 0, i32 0
  %85 = getelementptr inbounds { i64, ptr }, ptr %84, i32 0, i32 0
  %86 = load i64, ptr %85, align 8
  %87 = getelementptr inbounds { i64, ptr }, ptr %84, i32 0, i32 1
  %88 = load ptr, ptr %87, align 8
  %89 = call { i64, ptr } %76(i64 %86, ptr %88)
  %90 = getelementptr inbounds { i64, ptr }, ptr %11, i32 0, i32 0
  %91 = extractvalue { i64, ptr } %89, 0
  store i64 %91, ptr %90, align 8
  %92 = getelementptr inbounds { i64, ptr }, ptr %11, i32 0, i32 1
  %93 = extractvalue { i64, ptr } %89, 1
  store ptr %93, ptr %92, align 8
  %94 = getelementptr inbounds { i64, ptr }, ptr %11, i32 0, i32 0
  %95 = load i64, ptr %94, align 8
  %96 = getelementptr inbounds { i64, ptr }, ptr %11, i32 0, i32 1
  %97 = load ptr, ptr %96, align 8
  call void %74(ptr noundef %75, i64 %95, ptr %97)
  br label %98

98:                                               ; preds = %73
  %99 = load i16, ptr %10, align 2, !tbaa !13
  %100 = add i16 %99, 1
  store i16 %100, ptr %10, align 2, !tbaa !13
  br label %64, !llvm.loop !27

101:                                              ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %102 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 12), align 8, !tbaa !28
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = call ptr %102(ptr noundef %103)
  %105 = call ptr @bk_newBlockFromBuffer(ptr noundef %104)
  %106 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 12), align 8, !tbaa !28
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = call ptr %106(ptr noundef %107)
  %109 = call ptr @bk_newBlockFromBuffer(ptr noundef %108)
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %110, i32 0, i32 0
  %112 = load i16, ptr %111, align 8, !tbaa !29
  %113 = zext i16 %112 to i32
  %114 = call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i32 noundef 1, i32 noundef 16, ptr noundef %105, i32 noundef 16, ptr noundef %109, i32 noundef 2, i32 noundef %113, i32 noundef 0)
  store ptr %114, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %115, i32 0, i32 1
  %117 = getelementptr inbounds %struct.otl_MarkArray, ptr %116, i32 0, i32 0
  %118 = load i64, ptr %117, align 8, !tbaa !15
  %119 = call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i64 noundef %118, i32 noundef 0)
  store ptr %119, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #3
  store i16 0, ptr %14, align 2, !tbaa !13
  br label %120

120:                                              ; preds = %151, %101
  %121 = load i16, ptr %14, align 2, !tbaa !13
  %122 = zext i16 %121 to i64
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %123, i32 0, i32 1
  %125 = getelementptr inbounds %struct.otl_MarkArray, ptr %124, i32 0, i32 0
  %126 = load i64, ptr %125, align 8, !tbaa !15
  %127 = icmp ult i64 %122, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #3
  br label %154

129:                                              ; preds = %120
  %130 = load ptr, ptr %13, align 8, !tbaa !5
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %131, i32 0, i32 1
  %133 = getelementptr inbounds %struct.otl_MarkArray, ptr %132, i32 0, i32 2
  %134 = load ptr, ptr %133, align 8, !tbaa !22
  %135 = load i16, ptr %14, align 2, !tbaa !13
  %136 = zext i16 %135 to i64
  %137 = getelementptr inbounds %struct.otl_MarkRecord, ptr %134, i64 %136
  %138 = getelementptr inbounds %struct.otl_MarkRecord, ptr %137, i32 0, i32 1
  %139 = load i16, ptr %138, align 8, !tbaa !30
  %140 = zext i16 %139 to i32
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %141, i32 0, i32 1
  %143 = getelementptr inbounds %struct.otl_MarkArray, ptr %142, i32 0, i32 2
  %144 = load ptr, ptr %143, align 8, !tbaa !22
  %145 = load i16, ptr %14, align 2, !tbaa !13
  %146 = zext i16 %145 to i64
  %147 = getelementptr inbounds %struct.otl_MarkRecord, ptr %144, i64 %146
  %148 = getelementptr inbounds %struct.otl_MarkRecord, ptr %147, i32 0, i32 2
  %149 = call ptr @bkFromAnchor(ptr noundef byval(%struct.otl_Anchor) align 8 %148)
  %150 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %130, i32 noundef 2, i32 noundef %140, i32 noundef 16, ptr noundef %149, i32 noundef 0)
  br label %151

151:                                              ; preds = %129
  %152 = load i16, ptr %14, align 2, !tbaa !13
  %153 = add i16 %152, 1
  store i16 %153, ptr %14, align 2, !tbaa !13
  br label %120, !llvm.loop !36

154:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %155, i32 0, i32 2
  %157 = getelementptr inbounds %struct.otl_LigatureArray, ptr %156, i32 0, i32 0
  %158 = load i64, ptr %157, align 8, !tbaa !25
  %159 = call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i64 noundef %158, i32 noundef 0)
  store ptr %159, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #3
  store i16 0, ptr %16, align 2, !tbaa !13
  br label %160

160:                                              ; preds = %237, %154
  %161 = load i16, ptr %16, align 2, !tbaa !13
  %162 = zext i16 %161 to i64
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %163, i32 0, i32 2
  %165 = getelementptr inbounds %struct.otl_LigatureArray, ptr %164, i32 0, i32 0
  %166 = load i64, ptr %165, align 8, !tbaa !25
  %167 = icmp ult i64 %162, %166
  br i1 %167, label %169, label %168

168:                                              ; preds = %160
  store i32 11, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #3
  br label %240

169:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %170 = load ptr, ptr %5, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %170, i32 0, i32 2
  %172 = getelementptr inbounds %struct.otl_LigatureArray, ptr %171, i32 0, i32 2
  %173 = load ptr, ptr %172, align 8, !tbaa !26
  %174 = load i16, ptr %16, align 2, !tbaa !13
  %175 = zext i16 %174 to i64
  %176 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %173, i64 %175
  %177 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %176, i32 0, i32 1
  %178 = load i16, ptr %177, align 8, !tbaa !37
  %179 = zext i16 %178 to i32
  %180 = call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i32 noundef %179, i32 noundef 0)
  store ptr %180, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %19) #3
  store i16 0, ptr %19, align 2, !tbaa !13
  br label %181

181:                                              ; preds = %230, %169
  %182 = load i16, ptr %19, align 2, !tbaa !13
  %183 = zext i16 %182 to i32
  %184 = load ptr, ptr %5, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %184, i32 0, i32 2
  %186 = getelementptr inbounds %struct.otl_LigatureArray, ptr %185, i32 0, i32 2
  %187 = load ptr, ptr %186, align 8, !tbaa !26
  %188 = load i16, ptr %16, align 2, !tbaa !13
  %189 = zext i16 %188 to i64
  %190 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %187, i64 %189
  %191 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %190, i32 0, i32 1
  %192 = load i16, ptr %191, align 8, !tbaa !37
  %193 = zext i16 %192 to i32
  %194 = icmp slt i32 %183, %193
  br i1 %194, label %196, label %195

195:                                              ; preds = %181
  store i32 14, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %19) #3
  br label %233

196:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 2, ptr %20) #3
  store i16 0, ptr %20, align 2, !tbaa !13
  br label %197

197:                                              ; preds = %226, %196
  %198 = load i16, ptr %20, align 2, !tbaa !13
  %199 = zext i16 %198 to i32
  %200 = load ptr, ptr %5, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %200, i32 0, i32 0
  %202 = load i16, ptr %201, align 8, !tbaa !29
  %203 = zext i16 %202 to i32
  %204 = icmp slt i32 %199, %203
  br i1 %204, label %206, label %205

205:                                              ; preds = %197
  store i32 17, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %20) #3
  br label %229

206:                                              ; preds = %197
  %207 = load ptr, ptr %18, align 8, !tbaa !5
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %208, i32 0, i32 2
  %210 = getelementptr inbounds %struct.otl_LigatureArray, ptr %209, i32 0, i32 2
  %211 = load ptr, ptr %210, align 8, !tbaa !26
  %212 = load i16, ptr %16, align 2, !tbaa !13
  %213 = zext i16 %212 to i64
  %214 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %211, i64 %213
  %215 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %214, i32 0, i32 2
  %216 = load ptr, ptr %215, align 8, !tbaa !39
  %217 = load i16, ptr %19, align 2, !tbaa !13
  %218 = zext i16 %217 to i64
  %219 = getelementptr inbounds ptr, ptr %216, i64 %218
  %220 = load ptr, ptr %219, align 8, !tbaa !5
  %221 = load i16, ptr %20, align 2, !tbaa !13
  %222 = zext i16 %221 to i64
  %223 = getelementptr inbounds %struct.otl_Anchor, ptr %220, i64 %222
  %224 = call ptr @bkFromAnchor(ptr noundef byval(%struct.otl_Anchor) align 8 %223)
  %225 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %207, i32 noundef 16, ptr noundef %224, i32 noundef 0)
  br label %226

226:                                              ; preds = %206
  %227 = load i16, ptr %20, align 2, !tbaa !13
  %228 = add i16 %227, 1
  store i16 %228, ptr %20, align 2, !tbaa !13
  br label %197, !llvm.loop !40

229:                                              ; preds = %205
  br label %230

230:                                              ; preds = %229
  %231 = load i16, ptr %19, align 2, !tbaa !13
  %232 = add i16 %231, 1
  store i16 %232, ptr %19, align 2, !tbaa !13
  br label %181, !llvm.loop !41

233:                                              ; preds = %195
  %234 = load ptr, ptr %15, align 8, !tbaa !5
  %235 = load ptr, ptr %18, align 8, !tbaa !5
  %236 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %234, i32 noundef 16, ptr noundef %235, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  br label %237

237:                                              ; preds = %233
  %238 = load i16, ptr %16, align 2, !tbaa !13
  %239 = add i16 %238, 1
  store i16 %239, ptr %16, align 2, !tbaa !13
  br label %160, !llvm.loop !42

240:                                              ; preds = %168
  %241 = load ptr, ptr %12, align 8, !tbaa !5
  %242 = load ptr, ptr %13, align 8, !tbaa !5
  %243 = load ptr, ptr %15, align 8, !tbaa !5
  %244 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %241, i32 noundef 16, ptr noundef %242, i32 noundef 16, ptr noundef %243, i32 noundef 0)
  %245 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 7), align 8, !tbaa !43
  %246 = load ptr, ptr %6, align 8, !tbaa !5
  call void %245(ptr noundef %246)
  %247 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 7), align 8, !tbaa !43
  %248 = load ptr, ptr %9, align 8, !tbaa !5
  call void %247(ptr noundef %248)
  %249 = load ptr, ptr %12, align 8, !tbaa !5
  %250 = call ptr @bk_build_Block(ptr noundef %249)
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret ptr %250
}

declare ptr @bk_new_Block(i32 noundef, ...) #2

declare ptr @bk_newBlockFromBuffer(ptr noundef) #2

declare ptr @bk_push(ptr noundef, i32 noundef, ...) #2

declare ptr @bkFromAnchor(ptr noundef byval(%struct.otl_Anchor) align 8) #2

declare ptr @bk_build_Block(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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, !6, i64 48}
!12 = !{!"__otfcc_ICoverage", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!13 = !{!14, !14, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!16, !18, i64 8}
!16 = !{!"", !14, i64 0, !17, i64 8, !17, i64 32}
!17 = !{!"", !18, i64 0, !18, i64 8, !6, i64 16}
!18 = !{!"long", !7, i64 0}
!19 = !{!12, !6, i64 120}
!20 = !{!21, !6, i64 56}
!21 = !{!"otfcc_HandlePackage", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88}
!22 = !{!16, !6, i64 24}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!16, !18, i64 32}
!26 = !{!16, !6, i64 48}
!27 = distinct !{!27, !24}
!28 = !{!12, !6, i64 96}
!29 = !{!16, !14, i64 0}
!30 = !{!31, !14, i64 16}
!31 = !{!"", !32, i64 0, !14, i64 16, !33, i64 24}
!32 = !{!"otfcc_Handle", !10, i64 0, !14, i64 4, !6, i64 8}
!33 = !{!"", !34, i64 0, !35, i64 8, !35, i64 16}
!34 = !{!"_Bool", !7, i64 0}
!35 = !{!"double", !7, i64 0}
!36 = distinct !{!36, !24}
!37 = !{!38, !14, i64 16}
!38 = !{!"", !32, i64 0, !14, i64 16, !6, i64 24}
!39 = !{!38, !6, i64 24}
!40 = distinct !{!40, !24}
!41 = distinct !{!41, !24}
!42 = distinct !{!42, !24}
!43 = !{!12, !6, i64 56}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.__otfcc_ICoverage = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otfcc_HandlePackage = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otl_MarkRecord = type { %struct.otfcc_Handle, i16, %struct.otl_Anchor }
%struct.otfcc_Handle = type { i32, i16, ptr }
%struct.otl_Anchor = type { i8, double, double }
%struct.otl_LigatureBaseRecord = type { %struct.otfcc_Handle, i16, ptr }

@otl_iCoverage = external local_unnamed_addr constant %struct.__otfcc_ICoverage, align 8
@otfcc_iHandle = external local_unnamed_addr constant %struct.otfcc_HandlePackage, align 8

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_build_gpos_markToLigature(ptr nocapture noundef readonly %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 48), align 8, !tbaa !5
  %4 = tail call ptr (...) %3() #2
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load i64, ptr %5, align 8, !tbaa !10
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %7 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 120), align 8, !tbaa !15
  %8 = load ptr, ptr getelementptr inbounds (i8, ptr @otfcc_iHandle, i64 56), align 8, !tbaa !16
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  br label %16

._crit_edge:                                      ; preds = %16, %2
  %10 = tail call ptr (...) %3() #2
  %11 = getelementptr inbounds i8, ptr %0, i64 32
  %12 = load i64, ptr %11, align 8, !tbaa !18
  %.not80 = icmp eq i64 %12, 0
  br i1 %.not80, label %._crit_edge66, label %.lr.ph65

.lr.ph65:                                         ; preds = %._crit_edge
  %13 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 120), align 8, !tbaa !15
  %14 = load ptr, ptr getelementptr inbounds (i8, ptr @otfcc_iHandle, i64 56), align 8, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  br label %42

16:                                               ; preds = %.lr.ph, %16
  %17 = phi i64 [ 0, %.lr.ph ], [ %27, %16 ]
  %.05362 = phi i16 [ 0, %.lr.ph ], [ %26, %16 ]
  %18 = load ptr, ptr %9, align 8, !tbaa !19
  %19 = getelementptr inbounds %struct.otl_MarkRecord, ptr %18, i64 %17
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr %19, i64 8
  %22 = load ptr, ptr %21, align 8
  %23 = tail call { i64, ptr } %8(i64 %20, ptr %22) #2
  %24 = extractvalue { i64, ptr } %23, 0
  %25 = extractvalue { i64, ptr } %23, 1
  tail call void %7(ptr noundef %4, i64 %24, ptr %25) #2
  %26 = add i16 %.05362, 1
  %27 = zext i16 %26 to i64
  %28 = load i64, ptr %5, align 8, !tbaa !10
  %29 = icmp ugt i64 %28, %27
  br i1 %29, label %16, label %._crit_edge, !llvm.loop !20

._crit_edge66:                                    ; preds = %42, %._crit_edge
  %30 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 96), align 8, !tbaa !22
  %31 = tail call ptr %30(ptr noundef %4) #2
  %32 = tail call ptr @bk_newBlockFromBuffer(ptr noundef %31) #2
  %33 = tail call ptr %30(ptr noundef %10) #2
  %34 = tail call ptr @bk_newBlockFromBuffer(ptr noundef %33) #2
  %35 = load i16, ptr %0, align 8, !tbaa !23
  %36 = zext i16 %35 to i32
  %37 = tail call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i32 noundef 1, i32 noundef 16, ptr noundef %32, i32 noundef 16, ptr noundef %34, i32 noundef 2, i32 noundef %36, i32 noundef 0) #2
  %38 = load i64, ptr %5, align 8, !tbaa !10
  %39 = tail call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i64 noundef %38, i32 noundef 0) #2
  %40 = load i64, ptr %5, align 8, !tbaa !10
  %.not81 = icmp eq i64 %40, 0
  br i1 %.not81, label %._crit_edge70, label %.lr.ph69

.lr.ph69:                                         ; preds = %._crit_edge66
  %41 = getelementptr inbounds i8, ptr %0, i64 24
  br label %60

42:                                               ; preds = %.lr.ph65, %42
  %43 = phi i64 [ 0, %.lr.ph65 ], [ %53, %42 ]
  %.05563 = phi i16 [ 0, %.lr.ph65 ], [ %52, %42 ]
  %44 = load ptr, ptr %15, align 8, !tbaa !24
  %45 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %44, i64 %43
  %46 = load i64, ptr %45, align 8
  %47 = getelementptr inbounds i8, ptr %45, i64 8
  %48 = load ptr, ptr %47, align 8
  %49 = tail call { i64, ptr } %14(i64 %46, ptr %48) #2
  %50 = extractvalue { i64, ptr } %49, 0
  %51 = extractvalue { i64, ptr } %49, 1
  tail call void %13(ptr noundef %10, i64 %50, ptr %51) #2
  %52 = add i16 %.05563, 1
  %53 = zext i16 %52 to i64
  %54 = load i64, ptr %11, align 8, !tbaa !18
  %55 = icmp ugt i64 %54, %53
  br i1 %55, label %42, label %._crit_edge66, !llvm.loop !25

._crit_edge70:                                    ; preds = %60, %._crit_edge66
  %56 = load i64, ptr %11, align 8, !tbaa !18
  %57 = tail call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i64 noundef %56, i32 noundef 0) #2
  %58 = load i64, ptr %11, align 8, !tbaa !18
  %.not82 = icmp eq i64 %58, 0
  br i1 %.not82, label %._crit_edge79, label %.lr.ph78

.lr.ph78:                                         ; preds = %._crit_edge70
  %59 = getelementptr inbounds i8, ptr %0, i64 48
  br label %77

60:                                               ; preds = %.lr.ph69, %60
  %61 = phi i64 [ 0, %.lr.ph69 ], [ %71, %60 ]
  %.05667 = phi i16 [ 0, %.lr.ph69 ], [ %70, %60 ]
  %62 = load ptr, ptr %41, align 8, !tbaa !19
  %63 = getelementptr inbounds %struct.otl_MarkRecord, ptr %62, i64 %61
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  %65 = load i16, ptr %64, align 8, !tbaa !26
  %66 = zext i16 %65 to i32
  %67 = getelementptr inbounds i8, ptr %63, i64 24
  %68 = tail call ptr @bkFromAnchor(ptr noundef nonnull byval(%struct.otl_Anchor) align 8 %67) #2
  %69 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %39, i32 noundef 2, i32 noundef %66, i32 noundef 16, ptr noundef %68, i32 noundef 0) #2
  %70 = add i16 %.05667, 1
  %71 = zext i16 %70 to i64
  %72 = load i64, ptr %5, align 8, !tbaa !10
  %73 = icmp ugt i64 %72, %71
  br i1 %73, label %60, label %._crit_edge70, !llvm.loop !33

._crit_edge79:                                    ; preds = %._crit_edge75, %._crit_edge70
  %74 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %37, i32 noundef 16, ptr noundef %39, i32 noundef 16, ptr noundef %57, i32 noundef 0) #2
  %75 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 56), align 8, !tbaa !34
  tail call void %75(ptr noundef %4) #2
  tail call void %75(ptr noundef %10) #2
  %76 = tail call ptr @bk_build_Block(ptr noundef %37) #2
  ret ptr %76

77:                                               ; preds = %.lr.ph78, %._crit_edge75
  %78 = phi i64 [ 0, %.lr.ph78 ], [ %92, %._crit_edge75 ]
  %.05476 = phi i16 [ 0, %.lr.ph78 ], [ %91, %._crit_edge75 ]
  %79 = load ptr, ptr %59, align 8, !tbaa !24
  %80 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %79, i64 %78, i32 1
  %81 = load i16, ptr %80, align 8, !tbaa !35
  %82 = zext i16 %81 to i32
  %83 = tail call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i32 noundef %82, i32 noundef 0) #2
  %84 = load ptr, ptr %59, align 8, !tbaa !24
  %85 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %84, i64 %78, i32 1
  %86 = load i16, ptr %85, align 8, !tbaa !35
  %.not83 = icmp eq i16 %86, 0
  br i1 %.not83, label %._crit_edge75, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %77
  %87 = load i16, ptr %0, align 8, !tbaa !23
  %.not84 = icmp eq i16 %87, 0
  br i1 %.not84, label %._crit_edge75, label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge73
  %88 = phi ptr [ %95, %._crit_edge73 ], [ %84, %.preheader.lr.ph ]
  %89 = phi i16 [ %96, %._crit_edge73 ], [ 1, %.preheader.lr.ph ]
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %._crit_edge73 ], [ 0, %.preheader.lr.ph ]
  %.not85 = icmp eq i16 %89, 0
  br i1 %.not85, label %._crit_edge73, label %.lr.ph72

._crit_edge75:                                    ; preds = %._crit_edge73, %.preheader.lr.ph, %77
  %90 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %57, i32 noundef 16, ptr noundef %83, i32 noundef 0) #2
  %91 = add i16 %.05476, 1
  %92 = zext i16 %91 to i64
  %93 = load i64, ptr %11, align 8, !tbaa !18
  %94 = icmp ugt i64 %93, %92
  br i1 %94, label %77, label %._crit_edge79, !llvm.loop !37

._crit_edge73.loopexit:                           ; preds = %.lr.ph72
  %.pre = load ptr, ptr %59, align 8, !tbaa !24
  br label %._crit_edge73

._crit_edge73:                                    ; preds = %._crit_edge73.loopexit, %.preheader
  %95 = phi ptr [ %.pre, %._crit_edge73.loopexit ], [ %88, %.preheader ]
  %96 = phi i16 [ %109, %._crit_edge73.loopexit ], [ 0, %.preheader ]
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %97 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %95, i64 %78, i32 1
  %98 = load i16, ptr %97, align 8, !tbaa !35
  %99 = zext i16 %98 to i64
  %100 = icmp ult i64 %indvars.iv.next89, %99
  br i1 %100, label %.preheader, label %._crit_edge75, !llvm.loop !38

.lr.ph72:                                         ; preds = %.preheader, %.lr.ph72
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph72 ], [ 0, %.preheader ]
  %101 = load ptr, ptr %59, align 8, !tbaa !24
  %102 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %101, i64 %78, i32 2
  %103 = load ptr, ptr %102, align 8, !tbaa !40
  %104 = getelementptr inbounds ptr, ptr %103, i64 %indvars.iv88
  %105 = load ptr, ptr %104, align 8, !tbaa !41
  %106 = getelementptr inbounds %struct.otl_Anchor, ptr %105, i64 %indvars.iv
  %107 = tail call ptr @bkFromAnchor(ptr noundef byval(%struct.otl_Anchor) align 8 %106) #2
  %108 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %83, i32 noundef 16, ptr noundef %107, i32 noundef 0) #2
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %109 = load i16, ptr %0, align 8, !tbaa !23
  %110 = zext i16 %109 to i64
  %111 = icmp ult i64 %indvars.iv.next, %110
  br i1 %111, label %.lr.ph72, label %._crit_edge73.loopexit, !llvm.loop !42
}

declare ptr @bk_new_Block(i32 noundef, ...) local_unnamed_addr #1

declare ptr @bk_newBlockFromBuffer(ptr noundef) local_unnamed_addr #1

declare ptr @bk_push(ptr noundef, i32 noundef, ...) local_unnamed_addr #1

declare ptr @bkFromAnchor(ptr noundef byval(%struct.otl_Anchor) align 8) local_unnamed_addr #1

declare ptr @bk_build_Block(ptr noundef) local_unnamed_addr #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 }

!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 = !{!"__otfcc_ICoverage", !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, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !14, i64 8}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 32}
!12 = !{!"short", !8, i64 0}
!13 = !{!"", !14, i64 0, !14, i64 8, !7, i64 16}
!14 = !{!"long", !8, i64 0}
!15 = !{!6, !7, i64 120}
!16 = !{!17, !7, i64 56}
!17 = !{!"otfcc_HandlePackage", !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, i64 64, !7, i64 72, !7, i64 80, !7, i64 88}
!18 = !{!11, !14, i64 32}
!19 = !{!11, !7, i64 24}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!6, !7, i64 96}
!23 = !{!11, !12, i64 0}
!24 = !{!11, !7, i64 48}
!25 = distinct !{!25, !21}
!26 = !{!27, !12, i64 16}
!27 = !{!"", !28, i64 0, !12, i64 16, !30, i64 24}
!28 = !{!"otfcc_Handle", !29, i64 0, !12, i64 4, !7, i64 8}
!29 = !{!"int", !8, i64 0}
!30 = !{!"", !31, i64 0, !32, i64 8, !32, i64 16}
!31 = !{!"_Bool", !8, i64 0}
!32 = !{!"double", !8, i64 0}
!33 = distinct !{!33, !21}
!34 = !{!6, !7, i64 56}
!35 = !{!36, !12, i64 16}
!36 = !{!"", !28, i64 0, !12, i64 16, !7, i64 24}
!37 = distinct !{!37, !21}
!38 = distinct !{!38, !21, !39}
!39 = !{!"llvm.loop.unswitch.partial.disable"}
!40 = !{!36, !7, i64 24}
!41 = !{!7, !7, i64 0}
!42 = distinct !{!42, !21}


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