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

; 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_markToSingle = type { i16, %struct.otl_MarkArray, %struct.otl_BaseArray }
%struct.otl_MarkArray = type { i64, i64, ptr }
%struct.otl_BaseArray = type { i64, i64, ptr }
%struct.otl_MarkRecord = type { %struct.otfcc_Handle, i16, %struct.otl_Anchor }
%struct.otl_Anchor = type { i8, double, double }
%struct.otl_BaseRecord = type { %struct.otfcc_Handle, 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_markToSingle(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 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
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %19, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %20 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 6), align 8, !tbaa !11
  %21 = call ptr (...) %20()
  store ptr %21, 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 %22

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

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

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

56:                                               ; preds = %31
  %57 = load i16, ptr %7, align 2, !tbaa !13
  %58 = add i16 %57, 1
  store i16 %58, ptr %7, align 2, !tbaa !13
  br label %22, !llvm.loop !23

59:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %60 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 6), align 8, !tbaa !11
  %61 = call ptr (...) %60()
  store ptr %61, 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 %62

62:                                               ; preds = %96, %59
  %63 = load i16, ptr %10, align 2, !tbaa !13
  %64 = zext i16 %63 to i64
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %65, i32 0, i32 2
  %67 = getelementptr inbounds %struct.otl_BaseArray, ptr %66, i32 0, i32 0
  %68 = load i64, ptr %67, align 8, !tbaa !25
  %69 = icmp ult i64 %64, %68
  br i1 %69, label %71, label %70

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

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

96:                                               ; preds = %71
  %97 = load i16, ptr %10, align 2, !tbaa !13
  %98 = add i16 %97, 1
  store i16 %98, ptr %10, align 2, !tbaa !13
  br label %62, !llvm.loop !27

99:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %100 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 12), align 8, !tbaa !28
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = call ptr %100(ptr noundef %101)
  %103 = call ptr @bk_newBlockFromBuffer(ptr noundef %102)
  %104 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 12), align 8, !tbaa !28
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = call ptr %104(ptr noundef %105)
  %107 = call ptr @bk_newBlockFromBuffer(ptr noundef %106)
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %108, i32 0, i32 0
  %110 = load i16, ptr %109, align 8, !tbaa !29
  %111 = zext i16 %110 to i32
  %112 = call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i32 noundef 1, i32 noundef 16, ptr noundef %103, i32 noundef 16, ptr noundef %107, i32 noundef 2, i32 noundef %111, i32 noundef 0)
  store ptr %112, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %113, i32 0, i32 1
  %115 = getelementptr inbounds %struct.otl_MarkArray, ptr %114, i32 0, i32 0
  %116 = load i64, ptr %115, align 8, !tbaa !15
  %117 = call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i64 noundef %116, i32 noundef 0)
  store ptr %117, 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 %118

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

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

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

149:                                              ; preds = %127
  %150 = load i16, ptr %14, align 2, !tbaa !13
  %151 = add i16 %150, 1
  store i16 %151, ptr %14, align 2, !tbaa !13
  br label %118, !llvm.loop !36

152:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %153, i32 0, i32 2
  %155 = getelementptr inbounds %struct.otl_BaseArray, ptr %154, i32 0, i32 0
  %156 = load i64, ptr %155, align 8, !tbaa !25
  %157 = call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i64 noundef %156, i32 noundef 0)
  store ptr %157, 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 %158

158:                                              ; preds = %197, %152
  %159 = load i16, ptr %16, align 2, !tbaa !13
  %160 = zext i16 %159 to i64
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %161, i32 0, i32 2
  %163 = getelementptr inbounds %struct.otl_BaseArray, ptr %162, i32 0, i32 0
  %164 = load i64, ptr %163, align 8, !tbaa !25
  %165 = icmp ult i64 %160, %164
  br i1 %165, label %167, label %166

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

167:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #3
  store i16 0, ptr %18, align 2, !tbaa !13
  br label %168

168:                                              ; preds = %193, %167
  %169 = load i16, ptr %18, align 2, !tbaa !13
  %170 = zext i16 %169 to i32
  %171 = load ptr, ptr %5, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %171, i32 0, i32 0
  %173 = load i16, ptr %172, align 8, !tbaa !29
  %174 = zext i16 %173 to i32
  %175 = icmp slt i32 %170, %174
  br i1 %175, label %177, label %176

176:                                              ; preds = %168
  store i32 14, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #3
  br label %196

177:                                              ; preds = %168
  %178 = load ptr, ptr %15, align 8, !tbaa !5
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %179, i32 0, i32 2
  %181 = getelementptr inbounds %struct.otl_BaseArray, ptr %180, i32 0, i32 2
  %182 = load ptr, ptr %181, align 8, !tbaa !26
  %183 = load i16, ptr %16, align 2, !tbaa !13
  %184 = zext i16 %183 to i64
  %185 = getelementptr inbounds %struct.otl_BaseRecord, ptr %182, i64 %184
  %186 = getelementptr inbounds %struct.otl_BaseRecord, ptr %185, i32 0, i32 1
  %187 = load ptr, ptr %186, align 8, !tbaa !37
  %188 = load i16, ptr %18, align 2, !tbaa !13
  %189 = zext i16 %188 to i64
  %190 = getelementptr inbounds %struct.otl_Anchor, ptr %187, i64 %189
  %191 = call ptr @bkFromAnchor(ptr noundef byval(%struct.otl_Anchor) align 8 %190)
  %192 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %178, i32 noundef 16, ptr noundef %191, i32 noundef 0)
  br label %193

193:                                              ; preds = %177
  %194 = load i16, ptr %18, align 2, !tbaa !13
  %195 = add i16 %194, 1
  store i16 %195, ptr %18, align 2, !tbaa !13
  br label %168, !llvm.loop !39

196:                                              ; preds = %176
  br label %197

197:                                              ; preds = %196
  %198 = load i16, ptr %16, align 2, !tbaa !13
  %199 = add i16 %198, 1
  store i16 %199, ptr %16, align 2, !tbaa !13
  br label %158, !llvm.loop !40

200:                                              ; preds = %166
  %201 = load ptr, ptr %12, align 8, !tbaa !5
  %202 = load ptr, ptr %13, align 8, !tbaa !5
  %203 = load ptr, ptr %15, align 8, !tbaa !5
  %204 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %201, i32 noundef 16, ptr noundef %202, i32 noundef 16, ptr noundef %203, i32 noundef 0)
  %205 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 7), align 8, !tbaa !41
  %206 = load ptr, ptr %6, align 8, !tbaa !5
  call void %205(ptr noundef %206)
  %207 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 7), align 8, !tbaa !41
  %208 = load ptr, ptr %9, align 8, !tbaa !5
  call void %207(ptr noundef %208)
  %209 = load ptr, ptr %12, align 8, !tbaa !5
  %210 = call ptr @bk_build_Block(ptr noundef %209)
  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 %210
}

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, !6, i64 16}
!38 = !{!"", !32, i64 0, !6, i64 16}
!39 = distinct !{!39, !24}
!40 = distinct !{!40, !24}
!41 = !{!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_BaseRecord = type { %struct.otfcc_Handle, 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_markToSingle(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
  %.not66 = icmp eq i64 %12, 0
  br i1 %.not66, label %._crit_edge56, label %.lr.ph55

.lr.ph55:                                         ; 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 ]
  %.04452 = 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 %.04452, 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_edge56:                                    ; 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
  %.not67 = icmp eq i64 %40, 0
  br i1 %.not67, label %._crit_edge60, label %.lr.ph59

.lr.ph59:                                         ; preds = %._crit_edge56
  %41 = getelementptr inbounds i8, ptr %0, i64 24
  br label %61

42:                                               ; preds = %.lr.ph55, %42
  %43 = phi i64 [ 0, %.lr.ph55 ], [ %53, %42 ]
  %.04653 = phi i16 [ 0, %.lr.ph55 ], [ %52, %42 ]
  %44 = load ptr, ptr %15, align 8, !tbaa !24
  %45 = getelementptr inbounds %struct.otl_BaseRecord, 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 %.04653, 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_edge56, !llvm.loop !25

._crit_edge60:                                    ; preds = %61, %._crit_edge56
  %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
  %.not68 = icmp eq i64 %58, 0
  br i1 %.not68, label %._crit_edge65, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %._crit_edge60
  %59 = getelementptr inbounds i8, ptr %0, i64 48
  %60 = load i16, ptr %0, align 8, !tbaa !23
  %.not69 = icmp eq i16 %60, 0
  br i1 %.not69, label %._crit_edge65, label %.preheader

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

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge63
  %75 = phi i64 [ %81, %._crit_edge63 ], [ %58, %.preheader.lr.ph ]
  %76 = phi i16 [ %82, %._crit_edge63 ], [ 1, %.preheader.lr.ph ]
  %77 = phi i64 [ %84, %._crit_edge63 ], [ 0, %.preheader.lr.ph ]
  %.04364 = phi i16 [ %83, %._crit_edge63 ], [ 0, %.preheader.lr.ph ]
  %.not70 = icmp eq i16 %76, 0
  br i1 %.not70, label %._crit_edge63, label %.lr.ph62

._crit_edge65:                                    ; preds = %._crit_edge63, %.preheader.lr.ph, %._crit_edge60
  %78 = 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
  %79 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 56), align 8, !tbaa !34
  tail call void %79(ptr noundef %4) #2
  tail call void %79(ptr noundef %10) #2
  %80 = tail call ptr @bk_build_Block(ptr noundef %37) #2
  ret ptr %80

._crit_edge63.loopexit:                           ; preds = %.lr.ph62
  %.pre = load i64, ptr %11, align 8, !tbaa !18
  br label %._crit_edge63

._crit_edge63:                                    ; preds = %._crit_edge63.loopexit, %.preheader
  %81 = phi i64 [ %.pre, %._crit_edge63.loopexit ], [ %75, %.preheader ]
  %82 = phi i16 [ %92, %._crit_edge63.loopexit ], [ 0, %.preheader ]
  %83 = add i16 %.04364, 1
  %84 = zext i16 %83 to i64
  %85 = icmp ugt i64 %81, %84
  br i1 %85, label %.preheader, label %._crit_edge65, !llvm.loop !35

.lr.ph62:                                         ; preds = %.preheader, %.lr.ph62
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph62 ], [ 0, %.preheader ]
  %86 = load ptr, ptr %59, align 8, !tbaa !24
  %87 = getelementptr inbounds %struct.otl_BaseRecord, ptr %86, i64 %77, i32 1
  %88 = load ptr, ptr %87, align 8, !tbaa !37
  %89 = getelementptr inbounds %struct.otl_Anchor, ptr %88, i64 %indvars.iv
  %90 = tail call ptr @bkFromAnchor(ptr noundef byval(%struct.otl_Anchor) align 8 %89) #2
  %91 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %57, i32 noundef 16, ptr noundef %90, i32 noundef 0) #2
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %92 = load i16, ptr %0, align 8, !tbaa !23
  %93 = zext i16 %92 to i64
  %94 = icmp ult i64 %indvars.iv.next, %93
  br i1 %94, label %.lr.ph62, label %._crit_edge63.loopexit, !llvm.loop !39
}

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 = distinct !{!35, !21, !36}
!36 = !{!"llvm.loop.unswitch.partial.disable"}
!37 = !{!38, !7, i64 16}
!38 = !{!"", !28, i64 0, !7, i64 16}
!39 = distinct !{!39, !21}


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