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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @otl_read_gpos_single(ptr noundef %0, i32 noundef %1, i32 noundef %2, i16 noundef zeroext %3, ptr noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i16, align 2
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i16, align 2
  %15 = alloca %struct.otl_PositionValue, align 8
  %16 = alloca i16, align 2
  %17 = alloca %struct.otl_GposSingleEntry, align 8
  %18 = alloca i16, align 2
  %19 = alloca i16, align 2
  %20 = alloca i16, align 2
  %21 = alloca %struct.otl_GposSingleEntry, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i16 %3, ptr %10, align 2, !tbaa !11
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %23 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_subtable_gpos_single, ptr @iSubtable_gpos_single, i32 0, i32 6), align 8, !tbaa !13
  %24 = call ptr (...) %23()
  store ptr %24, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store ptr null, ptr %13, align 8, !tbaa !5
  %25 = load i32, ptr %8, align 4, !tbaa !9
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = add i32 %26, 6
  %28 = icmp ult i32 %25, %27
  br i1 %28, label %29, label %30

29:                                               ; preds = %5
  br label %199

30:                                               ; preds = %5
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds i8, ptr %31, i64 %33
  %35 = call zeroext i16 @read_16u(ptr noundef %34)
  store i16 %35, ptr %14, align 2, !tbaa !11
  %36 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 9), align 8, !tbaa !15
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load i32, ptr %8, align 4, !tbaa !9
  %39 = load i32, ptr %9, align 4, !tbaa !9
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds i8, ptr %40, i64 %42
  %44 = getelementptr inbounds i8, ptr %43, i64 2
  %45 = call zeroext i16 @read_16u(ptr noundef %44)
  %46 = zext i16 %45 to i32
  %47 = add i32 %39, %46
  %48 = call ptr %36(ptr noundef %37, i32 noundef %38, i32 noundef %47)
  store ptr %48, ptr %13, align 8, !tbaa !5
  %49 = load ptr, ptr %13, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %57

51:                                               ; preds = %30
  %52 = load ptr, ptr %13, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.otl_Coverage, ptr %52, i32 0, i32 0
  %54 = load i16, ptr %53, align 8, !tbaa !17
  %55 = zext i16 %54 to i32
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %51, %30
  br label %199

58:                                               ; preds = %51
  %59 = load i16, ptr %14, align 2, !tbaa !11
  %60 = zext i16 %59 to i32
  %61 = icmp eq i32 %60, 1
  br i1 %61, label %62, label %107

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #5
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = load i32, ptr %8, align 4, !tbaa !9
  %65 = load i32, ptr %9, align 4, !tbaa !9
  %66 = add i32 %65, 6
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = load i32, ptr %9, align 4, !tbaa !9
  %69 = zext i32 %68 to i64
  %70 = getelementptr inbounds i8, ptr %67, i64 %69
  %71 = getelementptr inbounds i8, ptr %70, i64 4
  %72 = call zeroext i16 @read_16u(ptr noundef %71)
  call void @read_gpos_value(ptr dead_on_unwind writable sret(%struct.otl_PositionValue) align 8 %15, ptr noundef %63, i32 noundef %64, i32 noundef %66, i16 noundef zeroext %72)
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #5
  store i16 0, ptr %16, align 2, !tbaa !11
  br label %73

73:                                               ; preds = %103, %62
  %74 = load i16, ptr %16, align 2, !tbaa !11
  %75 = zext i16 %74 to i32
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.otl_Coverage, ptr %76, i32 0, i32 0
  %78 = load i16, ptr %77, align 8, !tbaa !17
  %79 = zext i16 %78 to i32
  %80 = icmp slt i32 %75, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #5
  br label %106

82:                                               ; preds = %73
  %83 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_subtable_gpos_single, ptr @iSubtable_gpos_single, i32 0, i32 13), align 8, !tbaa !19
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %17, i32 0, i32 0
  %86 = load ptr, ptr getelementptr inbounds (%struct.otfcc_HandlePackage, ptr @otfcc_iHandle, i32 0, i32 7), align 8, !tbaa !20
  %87 = load ptr, ptr %13, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.otl_Coverage, ptr %87, i32 0, i32 2
  %89 = load ptr, ptr %88, align 8, !tbaa !22
  %90 = load i16, ptr %16, align 2, !tbaa !11
  %91 = zext i16 %90 to i64
  %92 = getelementptr inbounds %struct.otfcc_Handle, ptr %89, i64 %91
  %93 = getelementptr inbounds { i64, ptr }, ptr %92, i32 0, i32 0
  %94 = load i64, ptr %93, align 8
  %95 = getelementptr inbounds { i64, ptr }, ptr %92, i32 0, i32 1
  %96 = load ptr, ptr %95, align 8
  %97 = call { i64, ptr } %86(i64 %94, ptr %96)
  %98 = getelementptr inbounds { i64, ptr }, ptr %85, i32 0, i32 0
  %99 = extractvalue { i64, ptr } %97, 0
  store i64 %99, ptr %98, align 8
  %100 = getelementptr inbounds { i64, ptr }, ptr %85, i32 0, i32 1
  %101 = extractvalue { i64, ptr } %97, 1
  store ptr %101, ptr %100, align 8
  %102 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %17, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %102, ptr align 8 %15, i64 32, i1 false), !tbaa.struct !23
  call void %83(ptr noundef %84, ptr noundef byval(%struct.otl_GposSingleEntry) align 8 %17)
  br label %103

103:                                              ; preds = %82
  %104 = load i16, ptr %16, align 2, !tbaa !11
  %105 = add i16 %104, 1
  store i16 %105, ptr %16, align 2, !tbaa !11
  br label %73, !llvm.loop !26

106:                                              ; preds = %81
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  br label %191

107:                                              ; preds = %58
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #5
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = load i32, ptr %9, align 4, !tbaa !9
  %110 = zext i32 %109 to i64
  %111 = getelementptr inbounds i8, ptr %108, i64 %110
  %112 = getelementptr inbounds i8, ptr %111, i64 4
  %113 = call zeroext i16 @read_16u(ptr noundef %112)
  store i16 %113, ptr %18, align 2, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 2, ptr %19) #5
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = load i32, ptr %9, align 4, !tbaa !9
  %116 = zext i32 %115 to i64
  %117 = getelementptr inbounds i8, ptr %114, i64 %116
  %118 = getelementptr inbounds i8, ptr %117, i64 6
  %119 = call zeroext i16 @read_16u(ptr noundef %118)
  store i16 %119, ptr %19, align 2, !tbaa !11
  %120 = load i32, ptr %8, align 4, !tbaa !9
  %121 = load i32, ptr %9, align 4, !tbaa !9
  %122 = add i32 %121, 8
  %123 = load i16, ptr %18, align 2, !tbaa !11
  %124 = call zeroext i8 @position_format_length(i16 noundef zeroext %123)
  %125 = zext i8 %124 to i32
  %126 = load i16, ptr %19, align 2, !tbaa !11
  %127 = zext i16 %126 to i32
  %128 = mul nsw i32 %125, %127
  %129 = add i32 %122, %128
  %130 = icmp ult i32 %120, %129
  br i1 %130, label %131, label %132

131:                                              ; preds = %107
  store i32 2, ptr %22, align 4
  br label %188

132:                                              ; preds = %107
  %133 = load i16, ptr %19, align 2, !tbaa !11
  %134 = zext i16 %133 to i32
  %135 = load ptr, ptr %13, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.otl_Coverage, ptr %135, i32 0, i32 0
  %137 = load i16, ptr %136, align 8, !tbaa !17
  %138 = zext i16 %137 to i32
  %139 = icmp ne i32 %134, %138
  br i1 %139, label %140, label %141

140:                                              ; preds = %132
  store i32 2, ptr %22, align 4
  br label %188

141:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 2, ptr %20) #5
  store i16 0, ptr %20, align 2, !tbaa !11
  br label %142

142:                                              ; preds = %184, %141
  %143 = load i16, ptr %20, align 2, !tbaa !11
  %144 = zext i16 %143 to i32
  %145 = load ptr, ptr %13, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.otl_Coverage, ptr %145, i32 0, i32 0
  %147 = load i16, ptr %146, align 8, !tbaa !17
  %148 = zext i16 %147 to i32
  %149 = icmp slt i32 %144, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 2, ptr %20) #5
  br label %187

151:                                              ; preds = %142
  %152 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_subtable_gpos_single, ptr @iSubtable_gpos_single, i32 0, i32 13), align 8, !tbaa !19
  %153 = load ptr, ptr %12, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %21, i32 0, i32 0
  %155 = load ptr, ptr getelementptr inbounds (%struct.otfcc_HandlePackage, ptr @otfcc_iHandle, i32 0, i32 7), align 8, !tbaa !20
  %156 = load ptr, ptr %13, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.otl_Coverage, ptr %156, i32 0, i32 2
  %158 = load ptr, ptr %157, align 8, !tbaa !22
  %159 = load i16, ptr %20, align 2, !tbaa !11
  %160 = zext i16 %159 to i64
  %161 = getelementptr inbounds %struct.otfcc_Handle, ptr %158, i64 %160
  %162 = getelementptr inbounds { i64, ptr }, ptr %161, i32 0, i32 0
  %163 = load i64, ptr %162, align 8
  %164 = getelementptr inbounds { i64, ptr }, ptr %161, i32 0, i32 1
  %165 = load ptr, ptr %164, align 8
  %166 = call { i64, ptr } %155(i64 %163, ptr %165)
  %167 = getelementptr inbounds { i64, ptr }, ptr %154, i32 0, i32 0
  %168 = extractvalue { i64, ptr } %166, 0
  store i64 %168, ptr %167, align 8
  %169 = getelementptr inbounds { i64, ptr }, ptr %154, i32 0, i32 1
  %170 = extractvalue { i64, ptr } %166, 1
  store ptr %170, ptr %169, align 8
  %171 = getelementptr inbounds %struct.otl_GposSingleEntry, ptr %21, i32 0, i32 1
  %172 = load ptr, ptr %7, align 8, !tbaa !5
  %173 = load i32, ptr %8, align 4, !tbaa !9
  %174 = load i32, ptr %9, align 4, !tbaa !9
  %175 = add i32 %174, 8
  %176 = load i16, ptr %20, align 2, !tbaa !11
  %177 = zext i16 %176 to i32
  %178 = load i16, ptr %18, align 2, !tbaa !11
  %179 = call zeroext i8 @position_format_length(i16 noundef zeroext %178)
  %180 = zext i8 %179 to i32
  %181 = mul nsw i32 %177, %180
  %182 = add i32 %175, %181
  %183 = load i16, ptr %18, align 2, !tbaa !11
  call void @read_gpos_value(ptr dead_on_unwind writable sret(%struct.otl_PositionValue) align 8 %171, ptr noundef %172, i32 noundef %173, i32 noundef %182, i16 noundef zeroext %183)
  call void %152(ptr noundef %153, ptr noundef byval(%struct.otl_GposSingleEntry) align 8 %21)
  br label %184

184:                                              ; preds = %151
  %185 = load i16, ptr %20, align 2, !tbaa !11
  %186 = add i16 %185, 1
  store i16 %186, ptr %20, align 2, !tbaa !11
  br label %142, !llvm.loop !28

187:                                              ; preds = %150
  store i32 0, ptr %22, align 4
  br label %188

188:                                              ; preds = %187, %140, %131
  call void @llvm.lifetime.end.p0(i64 2, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #5
  %189 = load i32, ptr %22, align 4
  switch i32 %189, label %208 [
    i32 0, label %190
    i32 2, label %199
  ]

190:                                              ; preds = %188
  br label %191

191:                                              ; preds = %190, %106
  %192 = load ptr, ptr %13, align 8, !tbaa !5
  %193 = icmp ne ptr %192, null
  br i1 %193, label %194, label %197

194:                                              ; preds = %191
  %195 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 7), align 8, !tbaa !29
  %196 = load ptr, ptr %13, align 8, !tbaa !5
  call void %195(ptr noundef %196)
  br label %197

197:                                              ; preds = %194, %191
  %198 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %198, ptr %6, align 8
  store i32 1, ptr %22, align 4
  br label %208

199:                                              ; preds = %188, %57, %29
  %200 = load ptr, ptr %13, align 8, !tbaa !5
  %201 = icmp ne ptr %200, null
  br i1 %201, label %202, label %205

202:                                              ; preds = %199
  %203 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 7), align 8, !tbaa !29
  %204 = load ptr, ptr %13, align 8, !tbaa !5
  call void %203(ptr noundef %204)
  br label %205

205:                                              ; preds = %202, %199
  %206 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_subtable_gpos_single, ptr @iSubtable_gpos_single, i32 0, i32 7), align 8, !tbaa !30
  %207 = load ptr, ptr %12, align 8, !tbaa !5
  call void %206(ptr noundef %207)
  store ptr null, ptr %6, align 8
  store i32 1, ptr %22, align 4
  br label %208

208:                                              ; preds = %205, %197, %188
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  %209 = load ptr, ptr %6, align 8
  ret ptr %209
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @read_16u(ptr noundef) #2

declare void @read_gpos_value(ptr dead_on_unwind writable sret(%struct.otl_PositionValue) align 8, ptr noundef, i32 noundef, i32 noundef, i16 noundef zeroext) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

declare zeroext i8 @position_format_length(i16 noundef zeroext) #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !6, i64 48}
!14 = !{!"__caryll_vectorinterface_subtable_gpos_single", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144}
!15 = !{!16, !6, i64 72}
!16 = !{!"__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}
!17 = !{!18, !12, i64 0}
!18 = !{!"", !12, i64 0, !10, i64 4, !6, i64 8}
!19 = !{!14, !6, i64 104}
!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 = !{!18, !6, i64 8}
!23 = !{i64 0, i64 8, !24, i64 8, i64 8, !24, i64 16, i64 8, !24, i64 24, i64 8, !24}
!24 = !{!25, !25, i64 0}
!25 = !{!"double", !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}
!29 = !{!16, !6, i64 56}
!30 = !{!14, !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.__caryll_vectorinterface_subtable_gpos_single = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%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_PositionValue = type { double, double, double, double }
%struct.otl_GposSingleEntry = type { %struct.otfcc_Handle, %struct.otl_PositionValue }
%struct.otfcc_Handle = type { i32, i16, ptr }

@iSubtable_gpos_single = external dso_local local_unnamed_addr constant %struct.__caryll_vectorinterface_subtable_gpos_single, align 8
@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 @otl_read_gpos_single(ptr noundef %0, i32 noundef %1, i32 noundef %2, i16 noundef zeroext %3, ptr nocapture noundef readnone %4) local_unnamed_addr #0 {
  %6 = alloca %struct.otl_PositionValue, align 8
  %7 = alloca %struct.otl_GposSingleEntry, align 8
  %8 = alloca %struct.otl_GposSingleEntry, align 8
  %9 = load ptr, ptr getelementptr inbounds (i8, ptr @iSubtable_gpos_single, i64 48), align 8, !tbaa !5
  %10 = tail call ptr (...) %9() #5
  %11 = add i32 %2, 6
  %12 = icmp ugt i32 %11, %1
  br i1 %12, label %.thread66, label %13

13:                                               ; preds = %5
  %14 = zext i32 %2 to i64
  %15 = getelementptr inbounds i8, ptr %0, i64 %14
  %16 = tail call zeroext i16 @read_16u(ptr noundef %15)
  %17 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 72), align 8, !tbaa !10
  %18 = getelementptr inbounds i8, ptr %15, i64 2
  %19 = tail call zeroext i16 @read_16u(ptr noundef nonnull %18)
  %20 = zext i16 %19 to i32
  %21 = add i32 %20, %2
  %22 = tail call ptr %17(ptr noundef %0, i32 noundef %1, i32 noundef %21) #5
  %.not = icmp eq ptr %22, null
  br i1 %.not, label %.thread66, label %23

23:                                               ; preds = %13
  %24 = load i16, ptr %22, align 8, !tbaa !12
  %25 = icmp eq i16 %24, 0
  br i1 %25, label %.thread, label %26

26:                                               ; preds = %23
  %27 = icmp eq i16 %16, 1
  br i1 %27, label %28, label %49

28:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  %29 = getelementptr inbounds i8, ptr %15, i64 4
  %30 = tail call zeroext i16 @read_16u(ptr noundef nonnull %29)
  call void @read_gpos_value(ptr dead_on_unwind nonnull writable sret(%struct.otl_PositionValue) align 8 %6, ptr noundef %0, i32 noundef %1, i32 noundef %11, i16 noundef zeroext %30) #5
  %31 = load i16, ptr %22, align 8, !tbaa !12
  %.not73 = icmp eq i16 %31, 0
  br i1 %.not73, label %._crit_edge, label %.lr.ph71

.lr.ph71:                                         ; preds = %28
  %32 = load ptr, ptr getelementptr inbounds (i8, ptr @iSubtable_gpos_single, i64 104), align 8, !tbaa !16
  %33 = load ptr, ptr getelementptr inbounds (i8, ptr @otfcc_iHandle, i64 56), align 8, !tbaa !17
  %34 = getelementptr inbounds i8, ptr %22, i64 8
  %35 = getelementptr inbounds i8, ptr %7, i64 8
  %36 = getelementptr inbounds i8, ptr %7, i64 16
  br label %37

._crit_edge:                                      ; preds = %37, %28
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  br label %.loopexit

37:                                               ; preds = %.lr.ph71, %37
  %indvars.iv75 = phi i64 [ 0, %.lr.ph71 ], [ %indvars.iv.next76, %37 ]
  %38 = load ptr, ptr %34, align 8, !tbaa !19
  %39 = getelementptr inbounds %struct.otfcc_Handle, ptr %38, i64 %indvars.iv75
  %40 = load i64, ptr %39, align 8
  %41 = getelementptr inbounds i8, ptr %39, i64 8
  %42 = load ptr, ptr %41, align 8
  %43 = call { i64, ptr } %33(i64 %40, ptr %42) #5
  %44 = extractvalue { i64, ptr } %43, 0
  store i64 %44, ptr %7, align 8
  %45 = extractvalue { i64, ptr } %43, 1
  store ptr %45, ptr %35, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %36, ptr noundef nonnull align 8 dereferenceable(32) %6, i64 32, i1 false), !tbaa.struct !20
  call void %32(ptr noundef %10, ptr noundef nonnull byval(%struct.otl_GposSingleEntry) align 8 %7) #5
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %46 = load i16, ptr %22, align 8, !tbaa !12
  %47 = zext i16 %46 to i64
  %48 = icmp ult i64 %indvars.iv.next76, %47
  br i1 %48, label %37, label %._crit_edge, !llvm.loop !23

49:                                               ; preds = %26
  %50 = getelementptr inbounds i8, ptr %15, i64 4
  %51 = tail call zeroext i16 @read_16u(ptr noundef nonnull %50)
  %52 = getelementptr inbounds i8, ptr %15, i64 6
  %53 = tail call zeroext i16 @read_16u(ptr noundef nonnull %52)
  %54 = add i32 %2, 8
  %55 = tail call zeroext i8 @position_format_length(i16 noundef zeroext %51) #5
  %56 = zext i8 %55 to i32
  %57 = zext i16 %53 to i32
  %58 = mul nuw nsw i32 %56, %57
  %59 = add i32 %58, %54
  %60 = icmp ugt i32 %59, %1
  br i1 %60, label %.thread, label %61

61:                                               ; preds = %49
  %62 = load i16, ptr %22, align 8, !tbaa !12
  %.not60 = icmp eq i16 %53, %62
  br i1 %.not60, label %.preheader, label %.thread

.preheader:                                       ; preds = %61
  %.not72 = icmp eq i16 %53, 0
  br i1 %.not72, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %63 = load ptr, ptr getelementptr inbounds (i8, ptr @iSubtable_gpos_single, i64 104), align 8, !tbaa !16
  %64 = load ptr, ptr getelementptr inbounds (i8, ptr @otfcc_iHandle, i64 56), align 8, !tbaa !17
  %65 = getelementptr inbounds i8, ptr %22, i64 8
  %66 = getelementptr inbounds i8, ptr %8, i64 8
  %67 = getelementptr inbounds i8, ptr %8, i64 16
  br label %68

68:                                               ; preds = %.lr.ph, %68
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %68 ]
  %69 = trunc nuw i64 %indvars.iv to i32
  %70 = load ptr, ptr %65, align 8, !tbaa !19
  %71 = getelementptr inbounds %struct.otfcc_Handle, ptr %70, i64 %indvars.iv
  %72 = load i64, ptr %71, align 8
  %73 = getelementptr inbounds i8, ptr %71, i64 8
  %74 = load ptr, ptr %73, align 8
  %75 = call { i64, ptr } %64(i64 %72, ptr %74) #5
  %76 = extractvalue { i64, ptr } %75, 0
  store i64 %76, ptr %8, align 8
  %77 = extractvalue { i64, ptr } %75, 1
  store ptr %77, ptr %66, align 8
  %78 = call zeroext i8 @position_format_length(i16 noundef zeroext %51) #5
  %79 = zext i8 %78 to i32
  %80 = mul nuw nsw i32 %79, %69
  %81 = add i32 %80, %54
  call void @read_gpos_value(ptr dead_on_unwind nonnull writable sret(%struct.otl_PositionValue) align 8 %67, ptr noundef %0, i32 noundef %1, i32 noundef %81, i16 noundef zeroext %51) #5
  call void %63(ptr noundef %10, ptr noundef nonnull byval(%struct.otl_GposSingleEntry) align 8 %8) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %82 = load i16, ptr %22, align 8, !tbaa !12
  %83 = zext i16 %82 to i64
  %84 = icmp ult i64 %indvars.iv.next, %83
  br i1 %84, label %68, label %.loopexit, !llvm.loop !25

.loopexit:                                        ; preds = %68, %.preheader, %._crit_edge
  %85 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 56), align 8, !tbaa !26
  call void %85(ptr noundef nonnull %22) #5
  br label %88

.thread:                                          ; preds = %61, %49, %23
  %86 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 56), align 8, !tbaa !26
  tail call void %86(ptr noundef nonnull %22) #5
  br label %.thread66

.thread66:                                        ; preds = %13, %5, %.thread
  %87 = load ptr, ptr getelementptr inbounds (i8, ptr @iSubtable_gpos_single, i64 56), align 8, !tbaa !27
  tail call void %87(ptr noundef %10) #5
  br label %88

88:                                               ; preds = %.thread66, %.loopexit
  %.053 = phi ptr [ null, %.thread66 ], [ %10, %.loopexit ]
  ret ptr %.053
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @read_16u(ptr noundef) local_unnamed_addr #2

declare void @read_gpos_value(ptr dead_on_unwind writable sret(%struct.otl_PositionValue) align 8, ptr noundef, i32 noundef, i32 noundef, i16 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

declare zeroext i8 @position_format_length(i16 noundef zeroext) local_unnamed_addr #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 48}
!6 = !{!"__caryll_vectorinterface_subtable_gpos_single", !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, i64 128, !7, i64 136, !7, i64 144}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !7, i64 72}
!11 = !{!"__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}
!12 = !{!13, !14, i64 0}
!13 = !{!"", !14, i64 0, !15, i64 4, !7, i64 8}
!14 = !{!"short", !8, i64 0}
!15 = !{!"int", !8, i64 0}
!16 = !{!6, !7, i64 104}
!17 = !{!18, !7, i64 56}
!18 = !{!"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}
!19 = !{!13, !7, i64 8}
!20 = !{i64 0, i64 8, !21, i64 8, i64 8, !21, i64 16, i64 8, !21, i64 24, i64 8, !21}
!21 = !{!22, !22, i64 0}
!22 = !{!"double", !8, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = !{!11, !7, i64 56}
!27 = !{!6, !7, i64 56}


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