; LLVM IR from caryll/otfcc :: lib/table (COLR)

; 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_colr_LayerList = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__caryll_elementinterface_colr_Mapping = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__caryll_vectorinterface_table_COLR = type { ptr, ptr, ptr, 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.colr_Mapping = type { %struct.otfcc_Handle, %struct.colr_LayerList }
%struct.otfcc_Handle = type { i32, i16, ptr }
%struct.colr_LayerList = type { i64, i64, ptr }
%struct.colr_Layer = type { %struct.otfcc_Handle, i16 }
%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._json_value = type { ptr, i32, %union.anon, %union.anon.2 }
%union.anon = type { %struct.anon }
%struct.anon = type { i32, ptr }
%union.anon.2 = type { ptr }
%struct.anon.1 = type { i32, ptr }

@colr_iLayerList = external dso_local constant %struct.__caryll_vectorinterface_colr_LayerList, align 8
@colr_iMapping = external dso_local constant %struct.__caryll_elementinterface_colr_Mapping, align 8
@table_iCOLR = external dso_local constant %struct.__caryll_vectorinterface_table_COLR, align 8
@otfcc_iHandle = external constant %struct.otfcc_HandlePackage, align 8
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

declare ptr @sdsempty() #2

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_parseCOLR(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i16, align 2
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %struct.colr_Mapping, align 8
  %15 = alloca %struct.otfcc_Handle, align 8
  %16 = alloca i16, align 2
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca %struct.colr_Layer, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store ptr null, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = call ptr @json_obj_get_type(ptr noundef %20, ptr noundef @.str.1, i32 noundef 2)
  store ptr %21, ptr %6, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %24, label %23

23:                                               ; preds = %2
  store ptr null, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %183

24:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %25 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_table_COLR, ptr @table_iCOLR, i32 0, i32 6), align 8, !tbaa !9
  %26 = call ptr (...) %25()
  store ptr %26, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.otfcc_Options, ptr %27, i32 0, i32 24
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  %30 = getelementptr inbounds %struct.otfcc_ILogger, ptr %29, i32 0, i32 4
  %31 = load ptr, ptr %30, align 8, !tbaa !14
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.otfcc_Options, ptr %32, i32 0, i32 24
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = call ptr @sdsempty()
  %36 = call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %35, ptr noundef @.str.1)
  call void %31(ptr noundef %34, ptr noundef %36)
  store i8 1, ptr %9, align 1, !tbaa !16
  br label %37

37:                                               ; preds = %172, %24
  %38 = load i8, ptr %9, align 1, !tbaa !16, !range !17, !noundef !18
  %39 = trunc i8 %38 to i1
  br i1 %39, label %41, label %40

40:                                               ; preds = %37
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %181

41:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #5
  store i16 0, ptr %10, align 2, !tbaa !19
  br label %42

42:                                               ; preds = %168, %41
  %43 = load i16, ptr %10, align 2, !tbaa !19
  %44 = zext i16 %43 to i32
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._json_value, ptr %45, i32 0, i32 2
  %47 = getelementptr inbounds %struct.anon.1, ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !21
  %49 = icmp ult i32 %44, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %42
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #5
  br label %171

51:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._json_value, ptr %52, i32 0, i32 2
  %54 = getelementptr inbounds %struct.anon.1, ptr %53, i32 0, i32 1
  %55 = load ptr, ptr %54, align 8, !tbaa !21
  %56 = load i16, ptr %10, align 2, !tbaa !19
  %57 = zext i16 %56 to i64
  %58 = getelementptr inbounds ptr, ptr %55, i64 %57
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  store ptr %59, ptr %11, align 8, !tbaa !5
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = icmp ne ptr %60, null
  br i1 %61, label %62, label %67

62:                                               ; preds = %51
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._json_value, ptr %63, i32 0, i32 1
  %65 = load i32, ptr %64, align 8, !tbaa !22
  %66 = icmp ne i32 %65, 1
  br i1 %66, label %67, label %68

67:                                               ; preds = %62, %51
  store i32 7, ptr %7, align 4
  br label %165

68:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = call ptr @json_obj_get_type(ptr noundef %69, ptr noundef @.str.2, i32 noundef 5)
  store ptr %70, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  %72 = call ptr @json_obj_get_type(ptr noundef %71, ptr noundef @.str.5, i32 noundef 2)
  store ptr %72, ptr %13, align 8, !tbaa !5
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %78

75:                                               ; preds = %68
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = icmp ne ptr %76, null
  br i1 %77, label %79, label %78

78:                                               ; preds = %75, %68
  store i32 7, ptr %7, align 4
  br label %164

79:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #5
  %80 = load ptr, ptr @colr_iMapping, align 8, !tbaa !25
  call void %80(ptr noundef %14)
  %81 = getelementptr inbounds %struct.colr_Mapping, ptr %14, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  %82 = load ptr, ptr getelementptr inbounds (%struct.otfcc_HandlePackage, ptr @otfcc_iHandle, i32 0, i32 9), align 8, !tbaa !27
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct._json_value, ptr %83, i32 0, i32 2
  %85 = getelementptr inbounds %struct.anon, ptr %84, i32 0, i32 1
  %86 = load ptr, ptr %85, align 8, !tbaa !21
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._json_value, ptr %87, i32 0, i32 2
  %89 = getelementptr inbounds %struct.anon, ptr %88, i32 0, i32 0
  %90 = load i32, ptr %89, align 8, !tbaa !21
  %91 = zext i32 %90 to i64
  %92 = call ptr @sdsnewlen(ptr noundef %86, i64 noundef %91)
  %93 = call { i64, ptr } %82(ptr noundef %92)
  %94 = getelementptr inbounds { i64, ptr }, ptr %15, i32 0, i32 0
  %95 = extractvalue { i64, ptr } %93, 0
  store i64 %95, ptr %94, align 8
  %96 = getelementptr inbounds { i64, ptr }, ptr %15, i32 0, i32 1
  %97 = extractvalue { i64, ptr } %93, 1
  store ptr %97, ptr %96, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %81, ptr align 8 %15, i64 16, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #5
  store i16 0, ptr %16, align 2, !tbaa !19
  br label %98

98:                                               ; preds = %158, %79
  %99 = load i16, ptr %16, align 2, !tbaa !19
  %100 = zext i16 %99 to i32
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._json_value, ptr %101, i32 0, i32 2
  %103 = getelementptr inbounds %struct.anon.1, ptr %102, i32 0, i32 0
  %104 = load i32, ptr %103, align 8, !tbaa !21
  %105 = icmp ult i32 %100, %104
  br i1 %105, label %107, label %106

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

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

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

123:                                              ; preds = %118, %107
  store i32 10, ptr %7, align 4
  br label %155

124:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %125 = load ptr, ptr %17, align 8, !tbaa !5
  %126 = call ptr @json_obj_get_type(ptr noundef %125, ptr noundef @.str.3, i32 noundef 5)
  store ptr %126, ptr %18, align 8, !tbaa !5
  %127 = load ptr, ptr %18, align 8, !tbaa !5
  %128 = icmp ne ptr %127, null
  br i1 %128, label %130, label %129

129:                                              ; preds = %124
  store i32 10, ptr %7, align 4
  br label %154

130:                                              ; preds = %124
  %131 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_colr_LayerList, ptr @colr_iLayerList, i32 0, i32 13), align 8, !tbaa !31
  %132 = getelementptr inbounds %struct.colr_Mapping, ptr %14, i32 0, i32 1
  %133 = getelementptr inbounds %struct.colr_Layer, ptr %19, i32 0, i32 0
  %134 = load ptr, ptr getelementptr inbounds (%struct.otfcc_HandlePackage, ptr @otfcc_iHandle, i32 0, i32 9), align 8, !tbaa !27
  %135 = load ptr, ptr %18, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._json_value, ptr %135, i32 0, i32 2
  %137 = getelementptr inbounds %struct.anon, ptr %136, i32 0, i32 1
  %138 = load ptr, ptr %137, align 8, !tbaa !21
  %139 = load ptr, ptr %18, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._json_value, ptr %139, i32 0, i32 2
  %141 = getelementptr inbounds %struct.anon, ptr %140, i32 0, i32 0
  %142 = load i32, ptr %141, align 8, !tbaa !21
  %143 = zext i32 %142 to i64
  %144 = call ptr @sdsnewlen(ptr noundef %138, i64 noundef %143)
  %145 = call { i64, ptr } %134(ptr noundef %144)
  %146 = getelementptr inbounds { i64, ptr }, ptr %133, i32 0, i32 0
  %147 = extractvalue { i64, ptr } %145, 0
  store i64 %147, ptr %146, align 8
  %148 = getelementptr inbounds { i64, ptr }, ptr %133, i32 0, i32 1
  %149 = extractvalue { i64, ptr } %145, 1
  store ptr %149, ptr %148, align 8
  %150 = getelementptr inbounds %struct.colr_Layer, ptr %19, i32 0, i32 1
  %151 = load ptr, ptr %17, align 8, !tbaa !5
  %152 = call i32 @json_obj_getint_fallback(ptr noundef %151, ptr noundef @.str.4, i32 noundef 65535)
  %153 = trunc i32 %152 to i16
  store i16 %153, ptr %150, align 8, !tbaa !33
  call void %131(ptr noundef %132, ptr noundef byval(%struct.colr_Layer) align 8 %19)
  store i32 0, ptr %7, align 4
  br label %154

154:                                              ; preds = %130, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %155

155:                                              ; preds = %154, %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  %156 = load i32, ptr %7, align 4
  switch i32 %156, label %185 [
    i32 0, label %157
    i32 10, label %158
  ]

157:                                              ; preds = %155
  br label %158

158:                                              ; preds = %157, %155
  %159 = load i16, ptr %16, align 2, !tbaa !19
  %160 = add i16 %159, 1
  store i16 %160, ptr %16, align 2, !tbaa !19
  br label %98, !llvm.loop !36

161:                                              ; preds = %106
  %162 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_table_COLR, ptr @table_iCOLR, i32 0, i32 13), align 8, !tbaa !38
  %163 = load ptr, ptr %8, align 8, !tbaa !5
  call void %162(ptr noundef %163, ptr noundef byval(%struct.colr_Mapping) align 8 %14)
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #5
  store i32 0, ptr %7, align 4
  br label %164

164:                                              ; preds = %161, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %165

165:                                              ; preds = %164, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %166 = load i32, ptr %7, align 4
  switch i32 %166, label %185 [
    i32 0, label %167
    i32 7, label %168
  ]

167:                                              ; preds = %165
  br label %168

168:                                              ; preds = %167, %165
  %169 = load i16, ptr %10, align 2, !tbaa !19
  %170 = add i16 %169, 1
  store i16 %170, ptr %10, align 2, !tbaa !19
  br label %42, !llvm.loop !39

171:                                              ; preds = %50
  br label %172

172:                                              ; preds = %171
  store i8 0, ptr %9, align 1, !tbaa !16
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.otfcc_Options, ptr %173, i32 0, i32 24
  %175 = load ptr, ptr %174, align 8, !tbaa !11
  %176 = getelementptr inbounds %struct.otfcc_ILogger, ptr %175, i32 0, i32 8
  %177 = load ptr, ptr %176, align 8, !tbaa !40
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.otfcc_Options, ptr %178, i32 0, i32 24
  %180 = load ptr, ptr %179, align 8, !tbaa !11
  call void %177(ptr noundef %180)
  br label %37, !llvm.loop !41

181:                                              ; preds = %40
  %182 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %182, ptr %3, align 8
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %183

183:                                              ; preds = %181, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %184 = load ptr, ptr %3, align 8
  ret ptr %184

185:                                              ; preds = %165, %155
  unreachable
}

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree 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 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 #4 = { 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 #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, !6, i64 48}
!10 = !{!"__caryll_vectorinterface_table_COLR", !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, !6, i64 32}
!12 = !{!"", !13, i64 0, !13, i64 1, !13, i64 2, !13, i64 3, !13, i64 4, !13, i64 5, !13, i64 6, !13, i64 7, !13, i64 8, !13, i64 9, !13, i64 10, !13, i64 11, !13, i64 12, !13, i64 13, !13, i64 14, !13, i64 15, !13, i64 16, !13, i64 17, !13, i64 18, !13, i64 19, !13, i64 20, !13, i64 21, !13, i64 22, !6, i64 24, !6, i64 32}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!15, !6, i64 32}
!15 = !{!"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}
!16 = !{!13, !13, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!20, !20, i64 0}
!20 = !{!"short", !7, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !24, i64 8}
!23 = !{!"_json_value", !6, i64 0, !24, i64 8, !7, i64 16, !7, i64 32}
!24 = !{!"int", !7, i64 0}
!25 = !{!26, !6, i64 0}
!26 = !{!"__caryll_elementinterface_colr_Mapping", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!27 = !{!28, !6, i64 72}
!28 = !{!"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}
!29 = !{i64 0, i64 4, !30, i64 4, i64 2, !19, i64 8, i64 8, !5}
!30 = !{!24, !24, i64 0}
!31 = !{!32, !6, i64 104}
!32 = !{!"__caryll_vectorinterface_colr_LayerList", !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}
!33 = !{!34, !20, i64 16}
!34 = !{!"", !35, i64 0, !20, i64 16}
!35 = !{!"otfcc_Handle", !24, i64 0, !20, i64 4, !6, i64 8}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!10, !6, i64 104}
!39 = distinct !{!39, !37}
!40 = !{!15, !6, i64 64}
!41 = distinct !{!41, !37}


; 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_colr_LayerList = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__caryll_elementinterface_colr_Mapping = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__caryll_vectorinterface_table_COLR = type { ptr, ptr, ptr, 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.colr_Mapping = type { %struct.otfcc_Handle, %struct.colr_LayerList }
%struct.otfcc_Handle = type { i32, i16, ptr }
%struct.colr_LayerList = type { i64, i64, ptr }
%struct.colr_Layer = type { %struct.otfcc_Handle, i16 }

@colr_iLayerList = external dso_local local_unnamed_addr constant %struct.__caryll_vectorinterface_colr_LayerList, align 8
@colr_iMapping = external dso_local local_unnamed_addr constant %struct.__caryll_elementinterface_colr_Mapping, align 8
@table_iCOLR = external dso_local local_unnamed_addr constant %struct.__caryll_vectorinterface_table_COLR, align 8
@otfcc_iHandle = external local_unnamed_addr constant %struct.otfcc_HandlePackage, align 8
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

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

declare ptr @sdsempty() local_unnamed_addr #1

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

.critedge:                                        ; preds = %2
  %6 = load ptr, ptr getelementptr inbounds (i8, ptr @table_iCOLR, i64 48), align 8, !tbaa !5
  %7 = tail call ptr (...) %6() #4
  %8 = getelementptr inbounds i8, ptr %1, i64 32
  %9 = load ptr, ptr %8, align 8, !tbaa !10
  %10 = getelementptr inbounds i8, ptr %9, i64 32
  %11 = load ptr, ptr %10, align 8, !tbaa !13
  %12 = tail call ptr @sdsempty() #4
  %13 = tail call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %12, ptr noundef nonnull @.str.1) #4
  tail call void %11(ptr noundef %9, ptr noundef %13) #4
  %14 = getelementptr inbounds i8, ptr %5, i64 16
  %15 = load i32, ptr %14, align 8, !tbaa !15
  %.not52 = icmp eq i32 %15, 0
  br i1 %.not52, label %._crit_edge51, label %.lr.ph50

.lr.ph50:                                         ; preds = %.critedge
  %16 = getelementptr inbounds i8, ptr %5, i64 24
  %17 = load ptr, ptr @colr_iMapping, align 8
  %18 = load ptr, ptr getelementptr inbounds (i8, ptr @otfcc_iHandle, i64 72), align 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  %19 = load ptr, ptr getelementptr inbounds (i8, ptr @colr_iLayerList, i64 104), align 8
  %20 = getelementptr inbounds i8, ptr %3, i64 16
  %21 = getelementptr inbounds i8, ptr %4, i64 8
  %22 = getelementptr inbounds i8, ptr %4, i64 16
  %23 = load ptr, ptr getelementptr inbounds (i8, ptr @table_iCOLR, i64 104), align 8
  br label %27

._crit_edge51:                                    ; preds = %80, %.critedge
  %24 = load ptr, ptr %8, align 8, !tbaa !10
  %25 = getelementptr inbounds i8, ptr %24, i64 64
  %26 = load ptr, ptr %25, align 8, !tbaa !16
  call void %26(ptr noundef %24) #4
  br label %85

27:                                               ; preds = %.lr.ph50, %80
  %.03649 = phi i16 [ 0, %.lr.ph50 ], [ %81, %80 ]
  %28 = load ptr, ptr %16, align 8, !tbaa !15
  %29 = zext i16 %.03649 to i64
  %30 = getelementptr inbounds ptr, ptr %28, i64 %29
  %31 = load ptr, ptr %30, align 8, !tbaa !17
  %.not43 = icmp eq ptr %31, null
  br i1 %.not43, label %80, label %32

32:                                               ; preds = %27
  %33 = getelementptr inbounds i8, ptr %31, i64 8
  %34 = load i32, ptr %33, align 8, !tbaa !18
  %.not44 = icmp eq i32 %34, 1
  br i1 %.not44, label %35, label %80

35:                                               ; preds = %32
  %36 = call ptr @json_obj_get_type(ptr noundef nonnull %31, ptr noundef nonnull @.str.2, i32 noundef 5)
  %37 = call ptr @json_obj_get_type(ptr noundef nonnull %31, ptr noundef nonnull @.str.5, i32 noundef 2)
  %38 = icmp ne ptr %36, null
  %39 = icmp ne ptr %37, null
  %or.cond = select i1 %38, i1 %39, i1 false
  br i1 %or.cond, label %40, label %80

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #4
  call void %17(ptr noundef nonnull %3) #4
  %41 = getelementptr inbounds i8, ptr %36, i64 16
  %42 = getelementptr inbounds i8, ptr %36, i64 24
  %43 = load ptr, ptr %42, align 8, !tbaa !15
  %44 = load i32, ptr %41, align 8, !tbaa !15
  %45 = zext i32 %44 to i64
  %46 = call ptr @sdsnewlen(ptr noundef %43, i64 noundef %45) #4
  %47 = call { i64, ptr } %18(ptr noundef %46) #4
  %48 = extractvalue { i64, ptr } %47, 0
  %49 = extractvalue { i64, ptr } %47, 1
  store i64 %48, ptr %3, align 8
  store ptr %49, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !17
  %50 = getelementptr inbounds i8, ptr %37, i64 16
  %51 = load i32, ptr %50, align 8, !tbaa !15
  %.not53 = icmp eq i32 %51, 0
  br i1 %.not53, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %40
  %52 = getelementptr inbounds i8, ptr %37, i64 24
  br label %53

._crit_edge:                                      ; preds = %75, %40
  call void %23(ptr noundef %7, ptr noundef nonnull byval(%struct.colr_Mapping) align 8 %3) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #4
  br label %80

53:                                               ; preds = %.lr.ph, %75
  %.03448 = phi i16 [ 0, %.lr.ph ], [ %76, %75 ]
  %54 = load ptr, ptr %52, align 8, !tbaa !15
  %55 = zext i16 %.03448 to i64
  %56 = getelementptr inbounds ptr, ptr %54, i64 %55
  %57 = load ptr, ptr %56, align 8, !tbaa !17
  %.not45 = icmp eq ptr %57, null
  br i1 %.not45, label %75, label %58

58:                                               ; preds = %53
  %59 = getelementptr inbounds i8, ptr %57, i64 8
  %60 = load i32, ptr %59, align 8, !tbaa !18
  %.not46 = icmp eq i32 %60, 1
  br i1 %.not46, label %61, label %75

61:                                               ; preds = %58
  %62 = call ptr @json_obj_get_type(ptr noundef nonnull %57, ptr noundef nonnull @.str.3, i32 noundef 5)
  %.not47 = icmp eq ptr %62, null
  br i1 %.not47, label %75, label %63

63:                                               ; preds = %61
  %64 = getelementptr inbounds i8, ptr %62, i64 16
  %65 = getelementptr inbounds i8, ptr %62, i64 24
  %66 = load ptr, ptr %65, align 8, !tbaa !15
  %67 = load i32, ptr %64, align 8, !tbaa !15
  %68 = zext i32 %67 to i64
  %69 = call ptr @sdsnewlen(ptr noundef %66, i64 noundef %68) #4
  %70 = call { i64, ptr } %18(ptr noundef %69) #4
  %71 = extractvalue { i64, ptr } %70, 0
  store i64 %71, ptr %4, align 8
  %72 = extractvalue { i64, ptr } %70, 1
  store ptr %72, ptr %21, align 8
  %73 = call i32 @json_obj_getint_fallback(ptr noundef nonnull %57, ptr noundef nonnull @.str.4, i32 noundef 65535)
  %74 = trunc i32 %73 to i16
  store i16 %74, ptr %22, align 8, !tbaa !21
  call void %19(ptr noundef nonnull %20, ptr noundef nonnull byval(%struct.colr_Layer) align 8 %4) #4
  br label %75

75:                                               ; preds = %63, %61, %53, %58
  %76 = add i16 %.03448, 1
  %77 = zext i16 %76 to i32
  %78 = load i32, ptr %50, align 8, !tbaa !15
  %79 = icmp ugt i32 %78, %77
  br i1 %79, label %53, label %._crit_edge, !llvm.loop !25

80:                                               ; preds = %._crit_edge, %35, %27, %32
  %81 = add i16 %.03649, 1
  %82 = zext i16 %81 to i32
  %83 = load i32, ptr %14, align 8, !tbaa !15
  %84 = icmp ugt i32 %83, %82
  br i1 %84, label %27, label %._crit_edge51, !llvm.loop !27

85:                                               ; preds = %2, %._crit_edge51
  %.0 = phi ptr [ %7, %._crit_edge51 ], [ null, %2 ]
  ret ptr %.0
}

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 #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, !7, i64 48}
!6 = !{!"__caryll_vectorinterface_table_COLR", !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 32}
!11 = !{!"", !12, i64 0, !12, i64 1, !12, i64 2, !12, i64 3, !12, i64 4, !12, i64 5, !12, i64 6, !12, i64 7, !12, i64 8, !12, i64 9, !12, i64 10, !12, i64 11, !12, i64 12, !12, i64 13, !12, i64 14, !12, i64 15, !12, i64 16, !12, i64 17, !12, i64 18, !12, i64 19, !12, i64 20, !12, i64 21, !12, i64 22, !7, i64 24, !7, i64 32}
!12 = !{!"_Bool", !8, i64 0}
!13 = !{!14, !7, i64 32}
!14 = !{!"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}
!15 = !{!8, !8, i64 0}
!16 = !{!14, !7, i64 64}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !20, i64 8}
!19 = !{!"_json_value", !7, i64 0, !20, i64 8, !8, i64 16, !8, i64 32}
!20 = !{!"int", !8, i64 0}
!21 = !{!22, !24, i64 16}
!22 = !{!"", !23, i64 0, !24, i64 16}
!23 = !{!"otfcc_Handle", !20, i64 0, !24, i64 4, !7, i64 8}
!24 = !{!"short", !8, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}


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