; LLVM IR from caryll/otfcc :: lib/consolidate/otl (gsub-ligature)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.__caryll_vectorinterface_subtable_gsub_ligature = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otfcc_GlyphOrderPackage = type { 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.subtable_gsub_ligature = type { i64, i64, ptr }
%struct.otl_GsubLigatureEntry = type { ptr, %struct.otfcc_Handle }
%struct.otfcc_Handle = type { i32, i16, ptr }
%struct._caryll_font = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otfcc_Options = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, ptr, ptr }
%struct.otfcc_ILogger = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otl_Coverage = type { i16, i32, ptr }

@iSubtable_gsub_ligature = external constant %struct.__caryll_vectorinterface_subtable_gsub_ligature, align 8
@otfcc_pkgGlyphOrder = external constant %struct.otfcc_GlyphOrderPackage, align 8
@.str = external hidden unnamed_addr constant [42 x i8], align 1
@otl_iCoverage = external constant %struct.__otfcc_ICoverage, align 8
@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@otfcc_iHandle = external constant %struct.otfcc_HandlePackage, align 8

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @consolidate_gsub_ligature(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.subtable_gsub_ligature, align 8
  %11 = alloca i16, align 2
  %12 = alloca %struct.otl_GsubLigatureEntry, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %13 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %13, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #3
  %14 = load ptr, ptr @iSubtable_gsub_ligature, align 8, !tbaa !9
  call void %14(ptr noundef %10)
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #3
  store i16 0, ptr %11, align 2, !tbaa !11
  br label %15

15:                                               ; preds = %143, %4
  %16 = load i16, ptr %11, align 2, !tbaa !11
  %17 = zext i16 %16 to i64
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.subtable_gsub_ligature, ptr %18, i32 0, i32 0
  %20 = load i64, ptr %19, align 8, !tbaa !13
  %21 = icmp ult i64 %17, %20
  br i1 %21, label %23, label %22

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

23:                                               ; preds = %15
  %24 = load ptr, ptr getelementptr inbounds (%struct.otfcc_GlyphOrderPackage, ptr @otfcc_pkgGlyphOrder, i32 0, i32 11), align 8, !tbaa !16
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._caryll_font, ptr %25, i32 0, i32 33
  %27 = load ptr, ptr %26, align 8, !tbaa !18
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.subtable_gsub_ligature, ptr %28, i32 0, i32 2
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  %31 = load i16, ptr %11, align 2, !tbaa !11
  %32 = zext i16 %31 to i64
  %33 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %30, i64 %32
  %34 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %33, i32 0, i32 1
  %35 = call zeroext i1 %24(ptr noundef %27, ptr noundef %34)
  br i1 %35, label %56, label %36

36:                                               ; preds = %23
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.otfcc_Options, ptr %37, i32 0, i32 24
  %39 = load ptr, ptr %38, align 8, !tbaa !22
  %40 = getelementptr inbounds %struct.otfcc_ILogger, ptr %39, i32 0, i32 6
  %41 = load ptr, ptr %40, align 8, !tbaa !25
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.otfcc_Options, ptr %42, i32 0, i32 24
  %44 = load ptr, ptr %43, align 8, !tbaa !22
  %45 = call ptr @sdsempty()
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.subtable_gsub_ligature, ptr %46, i32 0, i32 2
  %48 = load ptr, ptr %47, align 8, !tbaa !21
  %49 = load i16, ptr %11, align 2, !tbaa !11
  %50 = zext i16 %49 to i64
  %51 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %48, i64 %50
  %52 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %51, i32 0, i32 1
  %53 = getelementptr inbounds %struct.otfcc_Handle, ptr %52, i32 0, i32 2
  %54 = load ptr, ptr %53, align 8, !tbaa !27
  %55 = call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %45, ptr noundef @.str, ptr noundef %54)
  call void %41(ptr noundef %44, i8 noundef zeroext 1, i32 noundef 1, ptr noundef %55)
  br label %143

56:                                               ; preds = %23
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.subtable_gsub_ligature, ptr %58, i32 0, i32 2
  %60 = load ptr, ptr %59, align 8, !tbaa !21
  %61 = load i16, ptr %11, align 2, !tbaa !11
  %62 = zext i16 %61 to i64
  %63 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %60, i64 %62
  %64 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !30
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  call void @fontop_consolidateCoverage(ptr noundef %57, ptr noundef %65, ptr noundef %66)
  %67 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 14), align 8, !tbaa !31
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.subtable_gsub_ligature, ptr %68, i32 0, i32 2
  %70 = load ptr, ptr %69, align 8, !tbaa !21
  %71 = load i16, ptr %11, align 2, !tbaa !11
  %72 = zext i16 %71 to i64
  %73 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %70, i64 %72
  %74 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %73, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !30
  call void %67(ptr noundef %75, i1 noundef zeroext false)
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.subtable_gsub_ligature, ptr %76, i32 0, i32 2
  %78 = load ptr, ptr %77, align 8, !tbaa !21
  %79 = load i16, ptr %11, align 2, !tbaa !11
  %80 = zext i16 %79 to i64
  %81 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %78, i64 %80
  %82 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !30
  %84 = getelementptr inbounds %struct.otl_Coverage, ptr %83, i32 0, i32 0
  %85 = load i16, ptr %84, align 8, !tbaa !33
  %86 = icmp ne i16 %85, 0
  br i1 %86, label %107, label %87

87:                                               ; preds = %56
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.otfcc_Options, ptr %88, i32 0, i32 24
  %90 = load ptr, ptr %89, align 8, !tbaa !22
  %91 = getelementptr inbounds %struct.otfcc_ILogger, ptr %90, i32 0, i32 6
  %92 = load ptr, ptr %91, align 8, !tbaa !25
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.otfcc_Options, ptr %93, i32 0, i32 24
  %95 = load ptr, ptr %94, align 8, !tbaa !22
  %96 = call ptr @sdsempty()
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.subtable_gsub_ligature, ptr %97, i32 0, i32 2
  %99 = load ptr, ptr %98, align 8, !tbaa !21
  %100 = load i16, ptr %11, align 2, !tbaa !11
  %101 = zext i16 %100 to i64
  %102 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %99, i64 %101
  %103 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %102, i32 0, i32 1
  %104 = getelementptr inbounds %struct.otfcc_Handle, ptr %103, i32 0, i32 2
  %105 = load ptr, ptr %104, align 8, !tbaa !27
  %106 = call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %96, ptr noundef @.str.1, ptr noundef %105)
  call void %92(ptr noundef %95, i8 noundef zeroext 1, i32 noundef 1, ptr noundef %106)
  br label %143

107:                                              ; preds = %56
  %108 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_subtable_gsub_ligature, ptr @iSubtable_gsub_ligature, i32 0, i32 13), align 8, !tbaa !35
  %109 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %12, i32 0, i32 0
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.subtable_gsub_ligature, ptr %110, i32 0, i32 2
  %112 = load ptr, ptr %111, align 8, !tbaa !21
  %113 = load i16, ptr %11, align 2, !tbaa !11
  %114 = zext i16 %113 to i64
  %115 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %112, i64 %114
  %116 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %115, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !30
  store ptr %117, ptr %109, align 8, !tbaa !30
  %118 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %12, i32 0, i32 1
  %119 = load ptr, ptr getelementptr inbounds (%struct.otfcc_HandlePackage, ptr @otfcc_iHandle, i32 0, i32 7), align 8, !tbaa !36
  %120 = load ptr, ptr %9, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.subtable_gsub_ligature, ptr %120, i32 0, i32 2
  %122 = load ptr, ptr %121, align 8, !tbaa !21
  %123 = load i16, ptr %11, align 2, !tbaa !11
  %124 = zext i16 %123 to i64
  %125 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %122, i64 %124
  %126 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %125, i32 0, i32 1
  %127 = getelementptr inbounds { i64, ptr }, ptr %126, i32 0, i32 0
  %128 = load i64, ptr %127, align 8
  %129 = getelementptr inbounds { i64, ptr }, ptr %126, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8
  %131 = call { i64, ptr } %119(i64 %128, ptr %130)
  %132 = getelementptr inbounds { i64, ptr }, ptr %118, i32 0, i32 0
  %133 = extractvalue { i64, ptr } %131, 0
  store i64 %133, ptr %132, align 8
  %134 = getelementptr inbounds { i64, ptr }, ptr %118, i32 0, i32 1
  %135 = extractvalue { i64, ptr } %131, 1
  store ptr %135, ptr %134, align 8
  call void %108(ptr noundef %10, ptr noundef byval(%struct.otl_GsubLigatureEntry) align 8 %12)
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.subtable_gsub_ligature, ptr %136, i32 0, i32 2
  %138 = load ptr, ptr %137, align 8, !tbaa !21
  %139 = load i16, ptr %11, align 2, !tbaa !11
  %140 = zext i16 %139 to i64
  %141 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %138, i64 %140
  %142 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %141, i32 0, i32 0
  store ptr null, ptr %142, align 8, !tbaa !30
  br label %143

143:                                              ; preds = %107, %87, %36
  %144 = load i16, ptr %11, align 2, !tbaa !11
  %145 = add i16 %144, 1
  store i16 %145, ptr %11, align 2, !tbaa !11
  br label %15, !llvm.loop !38

146:                                              ; preds = %22
  %147 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_subtable_gsub_ligature, ptr @iSubtable_gsub_ligature, i32 0, i32 4), align 8, !tbaa !40
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  call void %147(ptr noundef %148, ptr noundef byval(%struct.subtable_gsub_ligature) align 8 %10)
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.subtable_gsub_ligature, ptr %149, i32 0, i32 0
  %151 = load i64, ptr %150, align 8, !tbaa !13
  %152 = icmp eq i64 %151, 0
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  ret i1 %152
}

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

declare ptr @sdscatprintf(ptr noundef, ptr noundef, ...) #2

declare ptr @sdsempty() #2

declare void @fontop_consolidateCoverage(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!10 = !{!"__caryll_vectorinterface_subtable_gsub_ligature", !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}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"", !15, i64 0, !15, i64 8, !6, i64 16}
!15 = !{!"long", !7, i64 0}
!16 = !{!17, !6, i64 88}
!17 = !{!"otfcc_GlyphOrderPackage", !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}
!18 = !{!19, !6, i64 264}
!19 = !{!"_caryll_font", !20, 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, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264}
!20 = !{!"int", !7, i64 0}
!21 = !{!14, !6, i64 16}
!22 = !{!23, !6, i64 32}
!23 = !{!"", !24, i64 0, !24, i64 1, !24, i64 2, !24, i64 3, !24, i64 4, !24, i64 5, !24, i64 6, !24, i64 7, !24, i64 8, !24, i64 9, !24, i64 10, !24, i64 11, !24, i64 12, !24, i64 13, !24, i64 14, !24, i64 15, !24, i64 16, !24, i64 17, !24, i64 18, !24, i64 19, !24, i64 20, !24, i64 21, !24, i64 22, !6, i64 24, !6, i64 32}
!24 = !{!"_Bool", !7, i64 0}
!25 = !{!26, !6, i64 48}
!26 = !{!"otfcc_ILogger", !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}
!27 = !{!28, !6, i64 16}
!28 = !{!"", !6, i64 0, !29, i64 8}
!29 = !{!"otfcc_Handle", !20, i64 0, !12, i64 4, !6, i64 8}
!30 = !{!28, !6, i64 0}
!31 = !{!32, !6, i64 112}
!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 = !{!34, !12, i64 0}
!34 = !{!"", !12, i64 0, !20, i64 4, !6, i64 8}
!35 = !{!10, !6, i64 104}
!36 = !{!37, !6, i64 56}
!37 = !{!"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}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = !{!10, !6, i64 32}


; 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_gsub_ligature = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otfcc_GlyphOrderPackage = type { 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.subtable_gsub_ligature = type { i64, i64, ptr }
%struct.otl_GsubLigatureEntry = type { ptr, %struct.otfcc_Handle }
%struct.otfcc_Handle = type { i32, i16, ptr }

@iSubtable_gsub_ligature = external local_unnamed_addr constant %struct.__caryll_vectorinterface_subtable_gsub_ligature, align 8
@otfcc_pkgGlyphOrder = external local_unnamed_addr constant %struct.otfcc_GlyphOrderPackage, align 8
@.str = external hidden unnamed_addr constant [42 x i8], align 1
@otl_iCoverage = external local_unnamed_addr constant %struct.__otfcc_ICoverage, align 8
@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@otfcc_iHandle = external local_unnamed_addr constant %struct.otfcc_HandlePackage, align 8

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @consolidate_gsub_ligature(ptr noundef %0, ptr nocapture noundef readnone %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = alloca %struct.subtable_gsub_ligature, align 8
  %6 = alloca %struct.otl_GsubLigatureEntry, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #3
  %7 = load ptr, ptr @iSubtable_gsub_ligature, align 8, !tbaa !5
  call void %7(ptr noundef nonnull %5) #3
  %8 = load i64, ptr %2, align 8, !tbaa !10
  %.not32 = icmp eq i64 %8, 0
  br i1 %.not32, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %4
  %9 = load ptr, ptr getelementptr inbounds (i8, ptr @otfcc_pkgGlyphOrder, i64 88), align 8, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %0, i64 264
  %11 = getelementptr inbounds i8, ptr %2, i64 16
  %12 = getelementptr inbounds i8, ptr %3, i64 32
  %13 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 112), align 8
  %14 = load ptr, ptr getelementptr inbounds (i8, ptr @iSubtable_gsub_ligature, i64 104), align 8
  %15 = getelementptr inbounds i8, ptr %6, i64 8
  %16 = load ptr, ptr getelementptr inbounds (i8, ptr @otfcc_iHandle, i64 56), align 8
  %17 = getelementptr inbounds i8, ptr %6, i64 16
  br label %21

._crit_edge:                                      ; preds = %66, %4
  %18 = load ptr, ptr getelementptr inbounds (i8, ptr @iSubtable_gsub_ligature, i64 32), align 8, !tbaa !15
  call void %18(ptr noundef nonnull %2, ptr noundef nonnull byval(%struct.subtable_gsub_ligature) align 8 %5) #3
  %19 = load i64, ptr %2, align 8, !tbaa !10
  %20 = icmp eq i64 %19, 0
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  ret i1 %20

21:                                               ; preds = %.lr.ph, %66
  %22 = phi i64 [ 0, %.lr.ph ], [ %68, %66 ]
  %.031 = phi i16 [ 0, %.lr.ph ], [ %67, %66 ]
  %23 = load ptr, ptr %10, align 8, !tbaa !16
  %24 = load ptr, ptr %11, align 8, !tbaa !19
  %25 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %24, i64 %22, i32 1
  %26 = call zeroext i1 %9(ptr noundef %23, ptr noundef nonnull %25) #3
  br i1 %26, label %36, label %27

27:                                               ; preds = %21
  %28 = load ptr, ptr %12, align 8, !tbaa !20
  %29 = getelementptr inbounds i8, ptr %28, i64 48
  %30 = load ptr, ptr %29, align 8, !tbaa !23
  %31 = call ptr @sdsempty() #3
  %32 = load ptr, ptr %11, align 8, !tbaa !19
  %33 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %32, i64 %22, i32 1, i32 2
  %34 = load ptr, ptr %33, align 8, !tbaa !25
  %35 = call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %31, ptr noundef nonnull @.str, ptr noundef %34) #3
  call void %30(ptr noundef %28, i8 noundef zeroext 1, i32 noundef 1, ptr noundef %35) #3
  br label %66

36:                                               ; preds = %21
  %37 = load ptr, ptr %11, align 8, !tbaa !19
  %38 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %37, i64 %22
  %39 = load ptr, ptr %38, align 8, !tbaa !29
  call void @fontop_consolidateCoverage(ptr noundef nonnull %0, ptr noundef %39, ptr noundef %3) #3
  %40 = load ptr, ptr %11, align 8, !tbaa !19
  %41 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %40, i64 %22
  %42 = load ptr, ptr %41, align 8, !tbaa !29
  call void %13(ptr noundef %42, i1 noundef zeroext false) #3
  %43 = load ptr, ptr %11, align 8, !tbaa !19
  %44 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %43, i64 %22
  %45 = load ptr, ptr %44, align 8, !tbaa !29
  %46 = load i16, ptr %45, align 8, !tbaa !30
  %.not = icmp eq i16 %46, 0
  br i1 %.not, label %47, label %56

47:                                               ; preds = %36
  %48 = load ptr, ptr %12, align 8, !tbaa !20
  %49 = getelementptr inbounds i8, ptr %48, i64 48
  %50 = load ptr, ptr %49, align 8, !tbaa !23
  %51 = call ptr @sdsempty() #3
  %52 = load ptr, ptr %11, align 8, !tbaa !19
  %53 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %52, i64 %22, i32 1, i32 2
  %54 = load ptr, ptr %53, align 8, !tbaa !25
  %55 = call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %51, ptr noundef nonnull @.str.1, ptr noundef %54) #3
  call void %50(ptr noundef %48, i8 noundef zeroext 1, i32 noundef 1, ptr noundef %55) #3
  br label %66

56:                                               ; preds = %36
  store ptr %45, ptr %6, align 8, !tbaa !29
  %57 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %43, i64 %22, i32 1
  %58 = load i64, ptr %57, align 8
  %59 = getelementptr inbounds i8, ptr %57, i64 8
  %60 = load ptr, ptr %59, align 8
  %61 = call { i64, ptr } %16(i64 %58, ptr %60) #3
  %62 = extractvalue { i64, ptr } %61, 0
  store i64 %62, ptr %15, align 8
  %63 = extractvalue { i64, ptr } %61, 1
  store ptr %63, ptr %17, align 8
  call void %14(ptr noundef nonnull %5, ptr noundef nonnull byval(%struct.otl_GsubLigatureEntry) align 8 %6) #3
  %64 = load ptr, ptr %11, align 8, !tbaa !19
  %65 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %64, i64 %22
  store ptr null, ptr %65, align 8, !tbaa !29
  br label %66

66:                                               ; preds = %56, %47, %27
  %67 = add i16 %.031, 1
  %68 = zext i16 %67 to i64
  %69 = load i64, ptr %2, align 8, !tbaa !10
  %70 = icmp ugt i64 %69, %68
  br i1 %70, label %21, label %._crit_edge, !llvm.loop !32
}

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

declare ptr @sdscatprintf(ptr noundef, ptr noundef, ...) local_unnamed_addr #2

declare ptr @sdsempty() local_unnamed_addr #2

declare void @fontop_consolidateCoverage(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !7, i64 0}
!6 = !{!"__caryll_vectorinterface_subtable_gsub_ligature", !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, !12, i64 0}
!11 = !{!"", !12, i64 0, !12, i64 8, !7, i64 16}
!12 = !{!"long", !8, i64 0}
!13 = !{!14, !7, i64 88}
!14 = !{!"otfcc_GlyphOrderPackage", !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}
!15 = !{!6, !7, i64 32}
!16 = !{!17, !7, i64 264}
!17 = !{!"_caryll_font", !18, 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, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264}
!18 = !{!"int", !8, i64 0}
!19 = !{!11, !7, i64 16}
!20 = !{!21, !7, i64 32}
!21 = !{!"", !22, i64 0, !22, i64 1, !22, i64 2, !22, i64 3, !22, i64 4, !22, i64 5, !22, i64 6, !22, i64 7, !22, i64 8, !22, i64 9, !22, i64 10, !22, i64 11, !22, i64 12, !22, i64 13, !22, i64 14, !22, i64 15, !22, i64 16, !22, i64 17, !22, i64 18, !22, i64 19, !22, i64 20, !22, i64 21, !22, i64 22, !7, i64 24, !7, i64 32}
!22 = !{!"_Bool", !8, i64 0}
!23 = !{!24, !7, i64 48}
!24 = !{!"otfcc_ILogger", !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}
!25 = !{!26, !7, i64 16}
!26 = !{!"", !7, i64 0, !27, i64 8}
!27 = !{!"otfcc_Handle", !18, i64 0, !28, i64 4, !7, i64 8}
!28 = !{!"short", !8, i64 0}
!29 = !{!26, !7, i64 0}
!30 = !{!31, !28, i64 0}
!31 = !{!"", !28, i64 0, !18, i64 4, !7, i64 8}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


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