; LLVM IR from caryll/otfcc :: lib/table/otl/subtables (gpos-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_single = type { i64, i64, ptr }
%struct.otl_GposSingleEntry = type { %struct.otfcc_Handle, %struct.otl_PositionValue }
%struct.otl_PositionValue = type { double, double, double, double }

@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_single(ptr noundef %0, i32 noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i16, align 2
  %9 = alloca i16, align 2
  %10 = alloca ptr, align 8
  %11 = alloca i16, align 2
  %12 = alloca %struct.otfcc_Handle, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i16, align 2
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %18, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #3
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.subtable_gpos_single, ptr %19, i32 0, i32 0
  %21 = load i64, ptr %20, align 8, !tbaa !11
  %22 = icmp ugt i64 %21, 0
  %23 = zext i1 %22 to i8
  store i8 %23, ptr %7, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #3
  store i16 0, ptr %8, align 2, !tbaa !16
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.subtable_gpos_single, ptr %24, i32 0, i32 0
  %26 = load i64, ptr %25, align 8, !tbaa !11
  %27 = icmp ugt i64 %26, 0
  br i1 %27, label %28, label %132

28:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #3
  store i16 0, ptr %9, align 2, !tbaa !16
  br label %29

29:                                               ; preds = %128, %28
  %30 = load i16, ptr %9, align 2, !tbaa !16
  %31 = zext i16 %30 to i64
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.subtable_gpos_single, ptr %32, i32 0, i32 0
  %34 = load i64, ptr %33, align 8, !tbaa !11
  %35 = icmp ult i64 %31, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #3
  br label %131

37:                                               ; preds = %29
  %38 = load i8, ptr %7, align 1, !tbaa !14, !range !18, !noundef !19
  %39 = trunc i8 %38 to i1
  br i1 %39, label %40, label %112

40:                                               ; preds = %37
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.subtable_gpos_single, ptr %41, i32 0, i32 2
  %43 = load ptr, ptr %42, align 8, !tbaa !20
  %44 = load i16, ptr %9, align 2, !tbaa !16
  %45 = zext i16 %44 to i64
  %46 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %43, i64 %45
  %47 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %46, i32 0, i32 1
  %48 = getelementptr inbounds %struct.otl_PositionValue, ptr %47, i32 0, i32 0
  %49 = load double, ptr %48, align 8, !tbaa !21
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.subtable_gpos_single, ptr %50, i32 0, i32 2
  %52 = load ptr, ptr %51, align 8, !tbaa !20
  %53 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %52, i64 0
  %54 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %53, i32 0, i32 1
  %55 = getelementptr inbounds %struct.otl_PositionValue, ptr %54, i32 0, i32 0
  %56 = load double, ptr %55, align 8, !tbaa !21
  %57 = fcmp oeq double %49, %56
  br i1 %57, label %58, label %112

58:                                               ; preds = %40
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.subtable_gpos_single, ptr %59, i32 0, i32 2
  %61 = load ptr, ptr %60, align 8, !tbaa !20
  %62 = load i16, ptr %9, align 2, !tbaa !16
  %63 = zext i16 %62 to i64
  %64 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %61, i64 %63
  %65 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %64, i32 0, i32 1
  %66 = getelementptr inbounds %struct.otl_PositionValue, ptr %65, i32 0, i32 1
  %67 = load double, ptr %66, align 8, !tbaa !26
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.subtable_gpos_single, ptr %68, i32 0, i32 2
  %70 = load ptr, ptr %69, align 8, !tbaa !20
  %71 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %70, i64 0
  %72 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %71, i32 0, i32 1
  %73 = getelementptr inbounds %struct.otl_PositionValue, ptr %72, i32 0, i32 1
  %74 = load double, ptr %73, align 8, !tbaa !26
  %75 = fcmp oeq double %67, %74
  br i1 %75, label %76, label %112

76:                                               ; preds = %58
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.subtable_gpos_single, ptr %77, i32 0, i32 2
  %79 = load ptr, ptr %78, align 8, !tbaa !20
  %80 = load i16, ptr %9, align 2, !tbaa !16
  %81 = zext i16 %80 to i64
  %82 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %79, i64 %81
  %83 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %82, i32 0, i32 1
  %84 = getelementptr inbounds %struct.otl_PositionValue, ptr %83, i32 0, i32 2
  %85 = load double, ptr %84, align 8, !tbaa !27
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.subtable_gpos_single, ptr %86, i32 0, i32 2
  %88 = load ptr, ptr %87, align 8, !tbaa !20
  %89 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %88, i64 0
  %90 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %89, i32 0, i32 1
  %91 = getelementptr inbounds %struct.otl_PositionValue, ptr %90, i32 0, i32 2
  %92 = load double, ptr %91, align 8, !tbaa !27
  %93 = fcmp oeq double %85, %92
  br i1 %93, label %94, label %112

94:                                               ; preds = %76
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.subtable_gpos_single, ptr %95, i32 0, i32 2
  %97 = load ptr, ptr %96, align 8, !tbaa !20
  %98 = load i16, ptr %9, align 2, !tbaa !16
  %99 = zext i16 %98 to i64
  %100 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %97, i64 %99
  %101 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %100, i32 0, i32 1
  %102 = getelementptr inbounds %struct.otl_PositionValue, ptr %101, i32 0, i32 3
  %103 = load double, ptr %102, align 8, !tbaa !28
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.subtable_gpos_single, ptr %104, i32 0, i32 2
  %106 = load ptr, ptr %105, align 8, !tbaa !20
  %107 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %106, i64 0
  %108 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %107, i32 0, i32 1
  %109 = getelementptr inbounds %struct.otl_PositionValue, ptr %108, i32 0, i32 3
  %110 = load double, ptr %109, align 8, !tbaa !28
  %111 = fcmp oeq double %103, %110
  br label %112

112:                                              ; preds = %94, %76, %58, %40, %37
  %113 = phi i1 [ false, %76 ], [ false, %58 ], [ false, %40 ], [ false, %37 ], [ %111, %94 ]
  %114 = zext i1 %113 to i8
  store i8 %114, ptr %7, align 1, !tbaa !14
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.subtable_gpos_single, ptr %115, i32 0, i32 2
  %117 = load ptr, ptr %116, align 8, !tbaa !20
  %118 = load i16, ptr %9, align 2, !tbaa !16
  %119 = zext i16 %118 to i64
  %120 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %117, i64 %119
  %121 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %120, i32 0, i32 1
  %122 = call zeroext i8 @required_position_format(ptr noundef byval(%struct.otl_PositionValue) align 8 %121)
  %123 = zext i8 %122 to i32
  %124 = load i16, ptr %8, align 2, !tbaa !16
  %125 = zext i16 %124 to i32
  %126 = or i32 %125, %123
  %127 = trunc i32 %126 to i16
  store i16 %127, ptr %8, align 2, !tbaa !16
  br label %128

128:                                              ; preds = %112
  %129 = load i16, ptr %9, align 2, !tbaa !16
  %130 = add i16 %129, 1
  store i16 %130, ptr %9, align 2, !tbaa !16
  br label %29, !llvm.loop !29

131:                                              ; preds = %36
  br label %132

132:                                              ; preds = %131, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %133 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 6), align 8, !tbaa !31
  %134 = call ptr (...) %133()
  store ptr %134, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #3
  store i16 0, ptr %11, align 2, !tbaa !16
  br label %135

135:                                              ; preds = %167, %132
  %136 = load i16, ptr %11, align 2, !tbaa !16
  %137 = zext i16 %136 to i64
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.subtable_gpos_single, ptr %138, i32 0, i32 0
  %140 = load i64, ptr %139, align 8, !tbaa !11
  %141 = icmp ult i64 %137, %140
  br i1 %141, label %143, label %142

142:                                              ; preds = %135
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #3
  br label %170

143:                                              ; preds = %135
  %144 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 15), align 8, !tbaa !33
  %145 = load ptr, ptr %10, align 8, !tbaa !5
  %146 = load ptr, ptr getelementptr inbounds (%struct.otfcc_HandlePackage, ptr @otfcc_iHandle, i32 0, i32 7), align 8, !tbaa !34
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.subtable_gpos_single, ptr %147, i32 0, i32 2
  %149 = load ptr, ptr %148, align 8, !tbaa !20
  %150 = load i16, ptr %11, align 2, !tbaa !16
  %151 = zext i16 %150 to i64
  %152 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %149, i64 %151
  %153 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %152, i32 0, i32 0
  %154 = getelementptr inbounds { i64, ptr }, ptr %153, i32 0, i32 0
  %155 = load i64, ptr %154, align 8
  %156 = getelementptr inbounds { i64, ptr }, ptr %153, i32 0, i32 1
  %157 = load ptr, ptr %156, align 8
  %158 = call { i64, ptr } %146(i64 %155, ptr %157)
  %159 = getelementptr inbounds { i64, ptr }, ptr %12, i32 0, i32 0
  %160 = extractvalue { i64, ptr } %158, 0
  store i64 %160, ptr %159, align 8
  %161 = getelementptr inbounds { i64, ptr }, ptr %12, i32 0, i32 1
  %162 = extractvalue { i64, ptr } %158, 1
  store ptr %162, ptr %161, align 8
  %163 = getelementptr inbounds { i64, ptr }, ptr %12, i32 0, i32 0
  %164 = load i64, ptr %163, align 8
  %165 = getelementptr inbounds { i64, ptr }, ptr %12, i32 0, i32 1
  %166 = load ptr, ptr %165, align 8
  call void %144(ptr noundef %145, i64 %164, ptr %166)
  br label %167

167:                                              ; preds = %143
  %168 = load i16, ptr %11, align 2, !tbaa !16
  %169 = add i16 %168, 1
  store i16 %169, ptr %11, align 2, !tbaa !16
  br label %135, !llvm.loop !36

170:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %171 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 12), align 8, !tbaa !37
  %172 = load ptr, ptr %10, align 8, !tbaa !5
  %173 = call ptr %171(ptr noundef %172)
  store ptr %173, ptr %13, align 8, !tbaa !5
  %174 = load i8, ptr %7, align 1, !tbaa !14, !range !18, !noundef !19
  %175 = trunc i8 %174 to i1
  br i1 %175, label %176, label %193

176:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %177 = load ptr, ptr %13, align 8, !tbaa !5
  %178 = call ptr @bk_newBlockFromBuffer(ptr noundef %177)
  %179 = load i16, ptr %8, align 2, !tbaa !16
  %180 = zext i16 %179 to i32
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.subtable_gpos_single, ptr %181, i32 0, i32 2
  %183 = load ptr, ptr %182, align 8, !tbaa !20
  %184 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %183, i64 0
  %185 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %184, i32 0, i32 1
  %186 = load i16, ptr %8, align 2, !tbaa !16
  %187 = call ptr @bk_gpos_value(ptr noundef byval(%struct.otl_PositionValue) align 8 %185, i16 noundef zeroext %186)
  %188 = call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i32 noundef 1, i32 noundef 16, ptr noundef %178, i32 noundef 2, i32 noundef %180, i32 noundef 255, ptr noundef %187, i32 noundef 0)
  store ptr %188, ptr %14, align 8, !tbaa !5
  %189 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 7), align 8, !tbaa !38
  %190 = load ptr, ptr %10, align 8, !tbaa !5
  call void %189(ptr noundef %190)
  %191 = load ptr, ptr %14, align 8, !tbaa !5
  %192 = call ptr @bk_build_Block(ptr noundef %191)
  store ptr %192, ptr %3, align 8
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  br label %230

193:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %194 = load ptr, ptr %13, align 8, !tbaa !5
  %195 = call ptr @bk_newBlockFromBuffer(ptr noundef %194)
  %196 = load i16, ptr %8, align 2, !tbaa !16
  %197 = zext i16 %196 to i32
  %198 = load ptr, ptr %6, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.subtable_gpos_single, ptr %198, i32 0, i32 0
  %200 = load i64, ptr %199, align 8, !tbaa !11
  %201 = call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i32 noundef 2, i32 noundef 16, ptr noundef %195, i32 noundef 2, i32 noundef %197, i32 noundef 2, i64 noundef %200, i32 noundef 0)
  store ptr %201, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %17) #3
  store i16 0, ptr %17, align 2, !tbaa !16
  br label %202

202:                                              ; preds = %222, %193
  %203 = load i16, ptr %17, align 2, !tbaa !16
  %204 = zext i16 %203 to i64
  %205 = load ptr, ptr %6, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.subtable_gpos_single, ptr %205, i32 0, i32 0
  %207 = load i64, ptr %206, align 8, !tbaa !11
  %208 = icmp ult i64 %204, %207
  br i1 %208, label %210, label %209

209:                                              ; preds = %202
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #3
  br label %225

210:                                              ; preds = %202
  %211 = load ptr, ptr %16, align 8, !tbaa !5
  %212 = load ptr, ptr %6, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.subtable_gpos_single, ptr %212, i32 0, i32 2
  %214 = load ptr, ptr %213, align 8, !tbaa !20
  %215 = load i16, ptr %17, align 2, !tbaa !16
  %216 = zext i16 %215 to i64
  %217 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %214, i64 %216
  %218 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %217, i32 0, i32 1
  %219 = load i16, ptr %8, align 2, !tbaa !16
  %220 = call ptr @bk_gpos_value(ptr noundef byval(%struct.otl_PositionValue) align 8 %218, i16 noundef zeroext %219)
  %221 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %211, i32 noundef 255, ptr noundef %220, i32 noundef 0)
  br label %222

222:                                              ; preds = %210
  %223 = load i16, ptr %17, align 2, !tbaa !16
  %224 = add i16 %223, 1
  store i16 %224, ptr %17, align 2, !tbaa !16
  br label %202, !llvm.loop !39

225:                                              ; preds = %209
  %226 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 7), align 8, !tbaa !38
  %227 = load ptr, ptr %10, align 8, !tbaa !5
  call void %226(ptr noundef %227)
  %228 = load ptr, ptr %16, align 8, !tbaa !5
  %229 = call ptr @bk_build_Block(ptr noundef %228)
  store ptr %229, ptr %3, align 8
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  br label %230

230:                                              ; preds = %225, %176
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %231 = load ptr, ptr %3, align 8
  ret ptr %231
}

declare zeroext i8 @required_position_format(ptr noundef byval(%struct.otl_PositionValue) align 8) #2

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

declare ptr @bk_newBlockFromBuffer(ptr noundef) #2

declare ptr @bk_gpos_value(ptr noundef byval(%struct.otl_PositionValue) align 8, i16 noundef zeroext) #2

declare ptr @bk_build_Block(ptr noundef) #2

declare ptr @bk_push(ptr noundef, i32 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, !13, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 8, !6, i64 16}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!12, !6, i64 16}
!21 = !{!22, !25, i64 16}
!22 = !{!"", !23, i64 0, !24, i64 16}
!23 = !{!"otfcc_Handle", !10, i64 0, !17, i64 4, !6, i64 8}
!24 = !{!"", !25, i64 0, !25, i64 8, !25, i64 16, !25, i64 24}
!25 = !{!"double", !7, i64 0}
!26 = !{!22, !25, i64 24}
!27 = !{!22, !25, i64 32}
!28 = !{!22, !25, i64 40}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!32, !6, i64 48}
!32 = !{!"__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}
!33 = !{!32, !6, i64 120}
!34 = !{!35, !6, i64 56}
!35 = !{!"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}
!36 = distinct !{!36, !30}
!37 = !{!32, !6, i64 96}
!38 = !{!32, !6, i64 56}
!39 = distinct !{!39, !30}


; 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_GposSingleEntry = type { %struct.otfcc_Handle, %struct.otl_PositionValue }
%struct.otfcc_Handle = type { i32, i16, ptr }
%struct.otl_PositionValue = type { double, double, double, double }

@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_single(ptr nocapture noundef readonly %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = load i64, ptr %0, align 8, !tbaa !5
  %.not = icmp eq i64 %3, 0
  br i1 %.not, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  br label %5

5:                                                ; preds = %.lr.ph, %31
  %6 = phi i64 [ 0, %.lr.ph ], [ %38, %31 ]
  %.04959 = phi i1 [ true, %.lr.ph ], [ %32, %31 ]
  %.05058 = phi i16 [ 0, %.lr.ph ], [ %36, %31 ]
  %.05257 = phi i16 [ 0, %.lr.ph ], [ %37, %31 ]
  %.pre = load ptr, ptr %4, align 8, !tbaa !11
  br i1 %.04959, label %7, label %31

7:                                                ; preds = %5
  %8 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %.pre, i64 %6, i32 1
  %9 = load double, ptr %8, align 8, !tbaa !12
  %10 = getelementptr inbounds i8, ptr %.pre, i64 16
  %11 = load double, ptr %10, align 8, !tbaa !12
  %12 = fcmp oeq double %9, %11
  br i1 %12, label %13, label %31

13:                                               ; preds = %7
  %14 = getelementptr inbounds i8, ptr %8, i64 8
  %15 = load double, ptr %14, align 8, !tbaa !19
  %16 = getelementptr inbounds i8, ptr %.pre, i64 24
  %17 = load double, ptr %16, align 8, !tbaa !19
  %18 = fcmp oeq double %15, %17
  br i1 %18, label %19, label %31

19:                                               ; preds = %13
  %20 = getelementptr inbounds i8, ptr %8, i64 16
  %21 = load double, ptr %20, align 8, !tbaa !20
  %22 = getelementptr inbounds i8, ptr %.pre, i64 32
  %23 = load double, ptr %22, align 8, !tbaa !20
  %24 = fcmp oeq double %21, %23
  br i1 %24, label %25, label %31

25:                                               ; preds = %19
  %26 = getelementptr inbounds i8, ptr %8, i64 24
  %27 = load double, ptr %26, align 8, !tbaa !21
  %28 = getelementptr inbounds i8, ptr %.pre, i64 40
  %29 = load double, ptr %28, align 8, !tbaa !21
  %30 = fcmp oeq double %27, %29
  br label %31

31:                                               ; preds = %25, %19, %13, %7, %5
  %32 = phi i1 [ false, %19 ], [ false, %13 ], [ false, %7 ], [ false, %5 ], [ %30, %25 ]
  %33 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %.pre, i64 %6, i32 1
  %34 = tail call zeroext i8 @required_position_format(ptr noundef nonnull byval(%struct.otl_PositionValue) align 8 %33) #2
  %35 = zext i8 %34 to i16
  %36 = or i16 %.05058, %35
  %37 = add i16 %.05257, 1
  %38 = zext i16 %37 to i64
  %39 = load i64, ptr %0, align 8, !tbaa !5
  %40 = icmp ugt i64 %39, %38
  br i1 %40, label %5, label %.loopexit, !llvm.loop !22

.loopexit:                                        ; preds = %31, %2
  %.151 = phi i16 [ 0, %2 ], [ %36, %31 ]
  %.1 = phi i1 [ false, %2 ], [ %32, %31 ]
  %41 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 48), align 8, !tbaa !24
  %42 = tail call ptr (...) %41() #2
  %43 = load i64, ptr %0, align 8, !tbaa !5
  %.not68 = icmp eq i64 %43, 0
  br i1 %.not68, label %._crit_edge, label %.lr.ph62

.lr.ph62:                                         ; preds = %.loopexit
  %44 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 120), align 8, !tbaa !26
  %45 = load ptr, ptr getelementptr inbounds (i8, ptr @otfcc_iHandle, i64 56), align 8, !tbaa !27
  %46 = getelementptr inbounds i8, ptr %0, i64 16
  br label %51

._crit_edge:                                      ; preds = %51, %.loopexit
  %47 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 96), align 8, !tbaa !29
  %48 = tail call ptr %47(ptr noundef %42) #2
  %49 = tail call ptr @bk_newBlockFromBuffer(ptr noundef %48) #2
  %50 = zext nneg i16 %.151 to i32
  br i1 %.1, label %65, label %71

51:                                               ; preds = %.lr.ph62, %51
  %52 = phi i64 [ 0, %.lr.ph62 ], [ %62, %51 ]
  %.05361 = phi i16 [ 0, %.lr.ph62 ], [ %61, %51 ]
  %53 = load ptr, ptr %46, align 8, !tbaa !11
  %54 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %53, i64 %52
  %55 = load i64, ptr %54, align 8
  %56 = getelementptr inbounds i8, ptr %54, i64 8
  %57 = load ptr, ptr %56, align 8
  %58 = tail call { i64, ptr } %45(i64 %55, ptr %57) #2
  %59 = extractvalue { i64, ptr } %58, 0
  %60 = extractvalue { i64, ptr } %58, 1
  tail call void %44(ptr noundef %42, i64 %59, ptr %60) #2
  %61 = add i16 %.05361, 1
  %62 = zext i16 %61 to i64
  %63 = load i64, ptr %0, align 8, !tbaa !5
  %64 = icmp ugt i64 %63, %62
  br i1 %64, label %51, label %._crit_edge, !llvm.loop !30

65:                                               ; preds = %._crit_edge
  %66 = getelementptr inbounds i8, ptr %0, i64 16
  %67 = load ptr, ptr %66, align 8, !tbaa !11
  %68 = getelementptr inbounds i8, ptr %67, i64 16
  %69 = tail call ptr @bk_gpos_value(ptr noundef nonnull byval(%struct.otl_PositionValue) align 8 %68, i16 noundef zeroext %.151) #2
  %70 = tail call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i32 noundef 1, i32 noundef 16, ptr noundef %49, i32 noundef 2, i32 noundef %50, i32 noundef 255, ptr noundef %69, i32 noundef 0) #2
  br label %._crit_edge66

71:                                               ; preds = %._crit_edge
  %72 = load i64, ptr %0, align 8, !tbaa !5
  %73 = tail call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i32 noundef 2, i32 noundef 16, ptr noundef %49, i32 noundef 2, i32 noundef %50, i32 noundef 2, i64 noundef %72, i32 noundef 0) #2
  %74 = load i64, ptr %0, align 8, !tbaa !5
  %.not69 = icmp eq i64 %74, 0
  br i1 %.not69, label %._crit_edge66, label %.lr.ph65

.lr.ph65:                                         ; preds = %71
  %75 = getelementptr inbounds i8, ptr %0, i64 16
  br label %76

76:                                               ; preds = %.lr.ph65, %76
  %77 = phi i64 [ 0, %.lr.ph65 ], [ %83, %76 ]
  %.063 = phi i16 [ 0, %.lr.ph65 ], [ %82, %76 ]
  %78 = load ptr, ptr %75, align 8, !tbaa !11
  %79 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %78, i64 %77, i32 1
  %80 = tail call ptr @bk_gpos_value(ptr noundef nonnull byval(%struct.otl_PositionValue) align 8 %79, i16 noundef zeroext %.151) #2
  %81 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %73, i32 noundef 255, ptr noundef %80, i32 noundef 0) #2
  %82 = add i16 %.063, 1
  %83 = zext i16 %82 to i64
  %84 = load i64, ptr %0, align 8, !tbaa !5
  %85 = icmp ugt i64 %84, %83
  br i1 %85, label %76, label %._crit_edge66, !llvm.loop !31

._crit_edge66:                                    ; preds = %76, %71, %65
  %.sink = phi ptr [ %70, %65 ], [ %73, %71 ], [ %73, %76 ]
  %86 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 56), align 8, !tbaa !32
  tail call void %86(ptr noundef %42) #2
  %87 = tail call ptr @bk_build_Block(ptr noundef %.sink) #2
  ret ptr %87
}

declare zeroext i8 @required_position_format(ptr noundef byval(%struct.otl_PositionValue) align 8) local_unnamed_addr #1

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

declare ptr @bk_newBlockFromBuffer(ptr noundef) local_unnamed_addr #1

declare ptr @bk_gpos_value(ptr noundef byval(%struct.otl_PositionValue) align 8, i16 noundef zeroext) local_unnamed_addr #1

declare ptr @bk_build_Block(ptr noundef) local_unnamed_addr #1

declare ptr @bk_push(ptr noundef, i32 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 0}
!6 = !{!"", !7, i64 0, !7, i64 8, !10, i64 16}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 16}
!12 = !{!13, !18, i64 16}
!13 = !{!"", !14, i64 0, !17, i64 16}
!14 = !{!"otfcc_Handle", !15, i64 0, !16, i64 4, !10, i64 8}
!15 = !{!"int", !8, i64 0}
!16 = !{!"short", !8, i64 0}
!17 = !{!"", !18, i64 0, !18, i64 8, !18, i64 16, !18, i64 24}
!18 = !{!"double", !8, i64 0}
!19 = !{!13, !18, i64 24}
!20 = !{!13, !18, i64 32}
!21 = !{!13, !18, i64 40}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!25, !10, i64 48}
!25 = !{!"__otfcc_ICoverage", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120}
!26 = !{!25, !10, i64 120}
!27 = !{!28, !10, i64 56}
!28 = !{!"otfcc_HandlePackage", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88}
!29 = !{!25, !10, i64 96}
!30 = distinct !{!30, !23}
!31 = distinct !{!31, !23}
!32 = !{!25, !10, i64 56}


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