; LLVM IR from caryll/otfcc :: lib/table/otl/subtables (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_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_GsubLigatureEntry = type { ptr, %struct.otfcc_Handle }
%struct.otfcc_Handle = type { i32, i16, ptr }
%struct._json_value = type { ptr, i32, %union.anon.0, %union.anon.4 }
%union.anon.0 = type { %struct.anon.1 }
%struct.anon.1 = type { i32, ptr }
%union.anon.4 = type { ptr }
%struct.anon.3 = type { i32, ptr }
%struct.anon.2 = type { i32, ptr }
%struct._json_object_entry = type { ptr, i32, ptr }

@iSubtable_gsub_ligature = external dso_local constant %struct.__caryll_vectorinterface_subtable_gsub_ligature, align 8
@otl_iCoverage = external constant %struct.__otfcc_ICoverage, align 8
@otfcc_iHandle = external constant %struct.otfcc_HandlePackage, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1

; 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 @otl_gsub_parse_ligature(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i16, align 2
  %8 = alloca i16, align 2
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %struct.otl_GsubLigatureEntry, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i16, align 2
  %16 = alloca i16, align 2
  %17 = alloca ptr, align 8
  %18 = alloca %struct.otl_GsubLigatureEntry, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = call ptr @json_obj_get_type(ptr noundef %19, ptr noundef @.str.2, i32 noundef 2)
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %90

22:                                               ; preds = %2
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = call ptr @json_obj_get_type(ptr noundef %23, ptr noundef @.str.2, i32 noundef 2)
  store ptr %24, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %25 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_subtable_gsub_ligature, ptr @iSubtable_gsub_ligature, i32 0, i32 6), align 8, !tbaa !9
  %26 = call ptr (...) %25()
  store ptr %26, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #4
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._json_value, ptr %27, i32 0, i32 2
  %29 = getelementptr inbounds %struct.anon.3, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %29, align 8, !tbaa !11
  %31 = trunc i32 %30 to i16
  store i16 %31, ptr %7, align 2, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #4
  store i16 0, ptr %8, align 2, !tbaa !12
  br label %32

32:                                               ; preds = %85, %22
  %33 = load i16, ptr %8, align 2, !tbaa !12
  %34 = zext i16 %33 to i32
  %35 = load i16, ptr %7, align 2, !tbaa !12
  %36 = zext i16 %35 to i32
  %37 = icmp slt i32 %34, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %32
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #4
  br label %88

39:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct._json_value, ptr %40, i32 0, i32 2
  %42 = getelementptr inbounds %struct.anon.3, ptr %41, i32 0, i32 1
  %43 = load ptr, ptr %42, align 8, !tbaa !11
  %44 = load i16, ptr %8, align 2, !tbaa !12
  %45 = zext i16 %44 to i64
  %46 = getelementptr inbounds ptr, ptr %43, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  store ptr %47, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = call ptr @json_obj_get_type(ptr noundef %48, ptr noundef @.str, i32 noundef 2)
  store ptr %49, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = call ptr @json_obj_get_type(ptr noundef %50, ptr noundef @.str.1, i32 noundef 5)
  store ptr %51, ptr %12, align 8, !tbaa !5
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %57

54:                                               ; preds = %39
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = icmp ne ptr %55, null
  br i1 %56, label %58, label %57

57:                                               ; preds = %54, %39
  store i32 4, ptr %9, align 4
  br label %82

58:                                               ; preds = %54
  %59 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_subtable_gsub_ligature, ptr @iSubtable_gsub_ligature, i32 0, i32 13), align 8, !tbaa !14
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %13, i32 0, i32 0
  %62 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 11), align 8, !tbaa !15
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = call ptr %62(ptr noundef %63)
  store ptr %64, ptr %61, align 8, !tbaa !17
  %65 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %13, i32 0, i32 1
  %66 = load ptr, ptr getelementptr inbounds (%struct.otfcc_HandlePackage, ptr @otfcc_iHandle, i32 0, i32 9), align 8, !tbaa !21
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._json_value, ptr %67, i32 0, i32 2
  %69 = getelementptr inbounds %struct.anon.1, ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !11
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._json_value, ptr %71, i32 0, i32 2
  %73 = getelementptr inbounds %struct.anon.1, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %73, align 8, !tbaa !11
  %75 = zext i32 %74 to i64
  %76 = call ptr @sdsnewlen(ptr noundef %70, i64 noundef %75)
  %77 = call { i64, ptr } %66(ptr noundef %76)
  %78 = getelementptr inbounds { i64, ptr }, ptr %65, i32 0, i32 0
  %79 = extractvalue { i64, ptr } %77, 0
  store i64 %79, ptr %78, align 8
  %80 = getelementptr inbounds { i64, ptr }, ptr %65, i32 0, i32 1
  %81 = extractvalue { i64, ptr } %77, 1
  store ptr %81, ptr %80, align 8
  call void %59(ptr noundef %60, ptr noundef byval(%struct.otl_GsubLigatureEntry) align 8 %13)
  store i32 0, ptr %9, align 4
  br label %82

82:                                               ; preds = %58, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %83 = load i32, ptr %9, align 4
  switch i32 %83, label %167 [
    i32 0, label %84
    i32 4, label %85
  ]

84:                                               ; preds = %82
  br label %85

85:                                               ; preds = %84, %82
  %86 = load i16, ptr %8, align 2, !tbaa !12
  %87 = add i16 %86, 1
  store i16 %87, ptr %8, align 2, !tbaa !12
  br label %32, !llvm.loop !23

88:                                               ; preds = %38
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %89, ptr %3, align 8
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %165

90:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %91 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_subtable_gsub_ligature, ptr @iSubtable_gsub_ligature, i32 0, i32 6), align 8, !tbaa !9
  %92 = call ptr (...) %91()
  store ptr %92, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %15) #4
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._json_value, ptr %93, i32 0, i32 2
  %95 = getelementptr inbounds %struct.anon.3, ptr %94, i32 0, i32 0
  %96 = load i32, ptr %95, align 8, !tbaa !11
  %97 = trunc i32 %96 to i16
  store i16 %97, ptr %15, align 2, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #4
  store i16 0, ptr %16, align 2, !tbaa !12
  br label %98

98:                                               ; preds = %160, %90
  %99 = load i16, ptr %16, align 2, !tbaa !12
  %100 = zext i16 %99 to i32
  %101 = load i16, ptr %15, align 2, !tbaa !12
  %102 = zext i16 %101 to i32
  %103 = icmp slt i32 %100, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %98
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #4
  br label %163

105:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._json_value, ptr %106, i32 0, i32 2
  %108 = getelementptr inbounds %struct.anon.2, ptr %107, i32 0, i32 1
  %109 = load ptr, ptr %108, align 8, !tbaa !11
  %110 = load i16, ptr %16, align 2, !tbaa !12
  %111 = zext i16 %110 to i64
  %112 = getelementptr inbounds %struct._json_object_entry, ptr %109, i64 %111
  %113 = getelementptr inbounds %struct._json_object_entry, ptr %112, i32 0, i32 2
  %114 = load ptr, ptr %113, align 8, !tbaa !25
  store ptr %114, ptr %17, align 8, !tbaa !5
  %115 = load ptr, ptr %17, align 8, !tbaa !5
  %116 = icmp ne ptr %115, null
  br i1 %116, label %117, label %122

117:                                              ; preds = %105
  %118 = load ptr, ptr %17, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._json_value, ptr %118, i32 0, i32 1
  %120 = load i32, ptr %119, align 8, !tbaa !27
  %121 = icmp ne i32 %120, 2
  br i1 %121, label %122, label %123

122:                                              ; preds = %117, %105
  store i32 7, ptr %9, align 4
  br label %157

123:                                              ; preds = %117
  %124 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_subtable_gsub_ligature, ptr @iSubtable_gsub_ligature, i32 0, i32 13), align 8, !tbaa !14
  %125 = load ptr, ptr %14, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %18, i32 0, i32 0
  %127 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 11), align 8, !tbaa !15
  %128 = load ptr, ptr %17, align 8, !tbaa !5
  %129 = call ptr %127(ptr noundef %128)
  store ptr %129, ptr %126, align 8, !tbaa !17
  %130 = getelementptr inbounds %struct.otl_GsubLigatureEntry, ptr %18, i32 0, i32 1
  %131 = load ptr, ptr getelementptr inbounds (%struct.otfcc_HandlePackage, ptr @otfcc_iHandle, i32 0, i32 9), align 8, !tbaa !21
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._json_value, ptr %132, i32 0, i32 2
  %134 = getelementptr inbounds %struct.anon.2, ptr %133, i32 0, i32 1
  %135 = load ptr, ptr %134, align 8, !tbaa !11
  %136 = load i16, ptr %16, align 2, !tbaa !12
  %137 = zext i16 %136 to i64
  %138 = getelementptr inbounds %struct._json_object_entry, ptr %135, i64 %137
  %139 = getelementptr inbounds %struct._json_object_entry, ptr %138, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !29
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct._json_value, ptr %141, i32 0, i32 2
  %143 = getelementptr inbounds %struct.anon.2, ptr %142, i32 0, i32 1
  %144 = load ptr, ptr %143, align 8, !tbaa !11
  %145 = load i16, ptr %16, align 2, !tbaa !12
  %146 = zext i16 %145 to i64
  %147 = getelementptr inbounds %struct._json_object_entry, ptr %144, i64 %146
  %148 = getelementptr inbounds %struct._json_object_entry, ptr %147, i32 0, i32 1
  %149 = load i32, ptr %148, align 8, !tbaa !30
  %150 = zext i32 %149 to i64
  %151 = call ptr @sdsnewlen(ptr noundef %140, i64 noundef %150)
  %152 = call { i64, ptr } %131(ptr noundef %151)
  %153 = getelementptr inbounds { i64, ptr }, ptr %130, i32 0, i32 0
  %154 = extractvalue { i64, ptr } %152, 0
  store i64 %154, ptr %153, align 8
  %155 = getelementptr inbounds { i64, ptr }, ptr %130, i32 0, i32 1
  %156 = extractvalue { i64, ptr } %152, 1
  store ptr %156, ptr %155, align 8
  call void %124(ptr noundef %125, ptr noundef byval(%struct.otl_GsubLigatureEntry) align 8 %18)
  store i32 0, ptr %9, align 4
  br label %157

157:                                              ; preds = %123, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  %158 = load i32, ptr %9, align 4
  switch i32 %158, label %167 [
    i32 0, label %159
    i32 7, label %160
  ]

159:                                              ; preds = %157
  br label %160

160:                                              ; preds = %159, %157
  %161 = load i16, ptr %16, align 2, !tbaa !12
  %162 = add i16 %161, 1
  store i16 %162, ptr %16, align 2, !tbaa !12
  br label %98, !llvm.loop !31

163:                                              ; preds = %104
  %164 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %164, ptr %3, align 8
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %165

165:                                              ; preds = %163, %88
  %166 = load ptr, ptr %3, align 8
  ret ptr %166

167:                                              ; preds = %157, %82
  unreachable
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @json_obj_get_type(ptr noundef, ptr noundef, i32 noundef) #2

declare ptr @sdsnewlen(ptr noundef, i64 noundef) #3

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 = { 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 = { 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 48}
!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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 104}
!15 = !{!16, !6, i64 88}
!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, !6, i64 0}
!18 = !{!"", !6, i64 0, !19, i64 8}
!19 = !{!"otfcc_Handle", !20, i64 0, !13, i64 4, !6, i64 8}
!20 = !{!"int", !7, i64 0}
!21 = !{!22, !6, i64 72}
!22 = !{!"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}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !6, i64 16}
!26 = !{!"_json_object_entry", !6, i64 0, !20, i64 8, !6, i64 16}
!27 = !{!28, !20, i64 8}
!28 = !{!"_json_value", !6, i64 0, !20, i64 8, !7, i64 16, !7, i64 32}
!29 = !{!26, !6, i64 0}
!30 = !{!26, !20, i64 8}
!31 = distinct !{!31, !24}


; 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_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_GsubLigatureEntry = type { ptr, %struct.otfcc_Handle }
%struct.otfcc_Handle = type { i32, i16, ptr }
%struct._json_object_entry = type { ptr, i32, ptr }

@iSubtable_gsub_ligature = external dso_local local_unnamed_addr constant %struct.__caryll_vectorinterface_subtable_gsub_ligature, 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
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @otl_gsub_parse_ligature(ptr noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca %struct.otl_GsubLigatureEntry, align 8
  %4 = alloca %struct.otl_GsubLigatureEntry, align 8
  %5 = tail call ptr @json_obj_get_type(ptr noundef %0, ptr noundef nonnull @.str.2, i32 noundef 2)
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %39, label %6

6:                                                ; preds = %2
  %7 = tail call ptr @json_obj_get_type(ptr noundef %0, ptr noundef nonnull @.str.2, i32 noundef 2)
  %8 = load ptr, ptr getelementptr inbounds (i8, ptr @iSubtable_gsub_ligature, i64 48), align 8, !tbaa !5
  %9 = tail call ptr (...) %8() #3
  %10 = getelementptr inbounds i8, ptr %7, i64 16
  %11 = load i32, ptr %10, align 8, !tbaa !10
  %12 = and i32 %11, 65535
  %.not44 = icmp eq i32 %12, 0
  br i1 %.not44, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %6
  %13 = getelementptr inbounds i8, ptr %7, i64 24
  %14 = load ptr, ptr getelementptr inbounds (i8, ptr @iSubtable_gsub_ligature, i64 104), align 8
  %15 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 88), align 8
  %16 = getelementptr inbounds i8, ptr %3, i64 8
  %17 = load ptr, ptr getelementptr inbounds (i8, ptr @otfcc_iHandle, i64 72), align 8
  %18 = getelementptr inbounds i8, ptr %3, i64 16
  %wide.trip.count = zext nneg i32 %12 to i64
  br label %19

19:                                               ; preds = %.lr.ph, %38
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %38 ]
  %20 = load ptr, ptr %13, align 8, !tbaa !10
  %21 = getelementptr inbounds ptr, ptr %20, i64 %indvars.iv
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = tail call ptr @json_obj_get_type(ptr noundef %22, ptr noundef nonnull @.str, i32 noundef 2)
  %24 = tail call ptr @json_obj_get_type(ptr noundef %22, ptr noundef nonnull @.str.1, i32 noundef 5)
  %25 = icmp ne ptr %23, null
  %26 = icmp ne ptr %24, null
  %or.cond = select i1 %25, i1 %26, i1 false
  br i1 %or.cond, label %27, label %38

27:                                               ; preds = %19
  %28 = tail call ptr %15(ptr noundef nonnull %23) #3
  store ptr %28, ptr %3, align 8, !tbaa !12
  %29 = getelementptr inbounds i8, ptr %24, i64 16
  %30 = getelementptr inbounds i8, ptr %24, i64 24
  %31 = load ptr, ptr %30, align 8, !tbaa !10
  %32 = load i32, ptr %29, align 8, !tbaa !10
  %33 = zext i32 %32 to i64
  %34 = tail call ptr @sdsnewlen(ptr noundef %31, i64 noundef %33) #3
  %35 = tail call { i64, ptr } %17(ptr noundef %34) #3
  %36 = extractvalue { i64, ptr } %35, 0
  store i64 %36, ptr %16, align 8
  %37 = extractvalue { i64, ptr } %35, 1
  store ptr %37, ptr %18, align 8
  tail call void %14(ptr noundef %9, ptr noundef nonnull byval(%struct.otl_GsubLigatureEntry) align 8 %3) #3
  br label %38

38:                                               ; preds = %19, %27
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %19, !llvm.loop !17

39:                                               ; preds = %2
  %40 = load ptr, ptr getelementptr inbounds (i8, ptr @iSubtable_gsub_ligature, i64 48), align 8, !tbaa !5
  %41 = tail call ptr (...) %40() #3
  %42 = getelementptr inbounds i8, ptr %0, i64 16
  %43 = load i32, ptr %42, align 8, !tbaa !10
  %44 = and i32 %43, 65535
  %.not45 = icmp eq i32 %44, 0
  br i1 %.not45, label %.loopexit, label %.lr.ph43

.lr.ph43:                                         ; preds = %39
  %45 = getelementptr inbounds i8, ptr %0, i64 24
  %46 = load ptr, ptr getelementptr inbounds (i8, ptr @iSubtable_gsub_ligature, i64 104), align 8
  %47 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 88), align 8
  %48 = getelementptr inbounds i8, ptr %4, i64 8
  %49 = load ptr, ptr getelementptr inbounds (i8, ptr @otfcc_iHandle, i64 72), align 8
  %50 = getelementptr inbounds i8, ptr %4, i64 16
  %wide.trip.count51 = zext nneg i32 %44 to i64
  br label %51

51:                                               ; preds = %.lr.ph43, %70
  %indvars.iv48 = phi i64 [ 0, %.lr.ph43 ], [ %indvars.iv.next49, %70 ]
  %52 = load ptr, ptr %45, align 8, !tbaa !10
  %53 = getelementptr inbounds %struct._json_object_entry, ptr %52, i64 %indvars.iv48, i32 2
  %54 = load ptr, ptr %53, align 8, !tbaa !19
  %.not38 = icmp eq ptr %54, null
  br i1 %.not38, label %70, label %55

55:                                               ; preds = %51
  %56 = getelementptr inbounds i8, ptr %54, i64 8
  %57 = load i32, ptr %56, align 8, !tbaa !21
  %.not39 = icmp eq i32 %57, 2
  br i1 %.not39, label %58, label %70

58:                                               ; preds = %55
  %59 = tail call ptr %47(ptr noundef nonnull %54) #3
  store ptr %59, ptr %4, align 8, !tbaa !12
  %60 = load ptr, ptr %45, align 8, !tbaa !10
  %61 = getelementptr inbounds %struct._json_object_entry, ptr %60, i64 %indvars.iv48
  %62 = load ptr, ptr %61, align 8, !tbaa !23
  %63 = getelementptr inbounds i8, ptr %61, i64 8
  %64 = load i32, ptr %63, align 8, !tbaa !24
  %65 = zext i32 %64 to i64
  %66 = tail call ptr @sdsnewlen(ptr noundef %62, i64 noundef %65) #3
  %67 = tail call { i64, ptr } %49(ptr noundef %66) #3
  %68 = extractvalue { i64, ptr } %67, 0
  store i64 %68, ptr %48, align 8
  %69 = extractvalue { i64, ptr } %67, 1
  store ptr %69, ptr %50, align 8
  tail call void %46(ptr noundef %41, ptr noundef nonnull byval(%struct.otl_GsubLigatureEntry) align 8 %4) #3
  br label %70

70:                                               ; preds = %51, %55, %58
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %exitcond52.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count51
  br i1 %exitcond52.not, label %.loopexit, label %51, !llvm.loop !25

.loopexit:                                        ; preds = %38, %70, %6, %39
  %.0 = phi ptr [ %41, %39 ], [ %9, %6 ], [ %41, %70 ], [ %9, %38 ]
  ret ptr %.0
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @json_obj_get_type(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @sdsnewlen(ptr noundef, i64 noundef) local_unnamed_addr #2

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 = { 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 #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 48}
!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 = !{!8, !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !7, i64 0}
!13 = !{!"", !7, i64 0, !14, i64 8}
!14 = !{!"otfcc_Handle", !15, i64 0, !16, i64 4, !7, i64 8}
!15 = !{!"int", !8, i64 0}
!16 = !{!"short", !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !7, i64 16}
!20 = !{!"_json_object_entry", !7, i64 0, !15, i64 8, !7, i64 16}
!21 = !{!22, !15, i64 8}
!22 = !{!"_json_value", !7, i64 0, !15, i64 8, !8, i64 16, !8, i64 32}
!23 = !{!20, !7, i64 0}
!24 = !{!20, !15, i64 8}
!25 = distinct !{!25, !18}


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