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

; 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_elementinterface_svg_Assignment = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__caryll_vectorinterface_table_SVG = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.svg_Assignment = type { i16, i16, 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._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 }

@svg_iAssignment = external dso_local constant %struct.__caryll_elementinterface_svg_Assignment, align 8
@table_iSVG = external dso_local constant %struct.__caryll_vectorinterface_table_SVG, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 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

declare ptr @bufnew(...) #1

declare void @bufwrite_bytes(ptr noundef, i64 noundef, ptr noundef) #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, ...) #1

declare ptr @sdsempty() #1

declare ptr @base64_encode(ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_parseSVG(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.svg_Assignment, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, 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) #6
  store ptr null, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = call ptr @json_obj_get_type(ptr noundef %17, ptr noundef @.str.7, i32 noundef 2)
  store ptr %18, ptr %6, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %21, label %20

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

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

34:                                               ; preds = %131, %21
  %35 = load i8, ptr %9, align 1, !tbaa !16, !range !17, !noundef !18
  %36 = trunc i8 %35 to i1
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #6
  store i16 0, ptr %10, align 2, !tbaa !19
  br label %39

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

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

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

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

64:                                               ; preds = %59, %48
  store i32 7, ptr %7, align 4
  br label %124

65:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = call ptr @json_obj_getstr_share(ptr noundef %66, ptr noundef @.str.3)
  store ptr %67, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = call ptr @json_obj_getsds(ptr noundef %68, ptr noundef @.str.5)
  store ptr %69, ptr %13, align 8, !tbaa !5
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %75

72:                                               ; preds = %65
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = icmp ne ptr %73, null
  br i1 %74, label %76, label %75

75:                                               ; preds = %72, %65
  store i32 7, ptr %7, align 4
  br label %123

76:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %77 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_svg_Assignment, ptr @svg_iAssignment, i32 0, i32 6), align 8, !tbaa !25
  %78 = call { i64, ptr } (...) %77()
  %79 = getelementptr inbounds { i64, ptr }, ptr %14, i32 0, i32 0
  %80 = extractvalue { i64, ptr } %78, 0
  store i64 %80, ptr %79, align 8
  %81 = getelementptr inbounds { i64, ptr }, ptr %14, i32 0, i32 1
  %82 = extractvalue { i64, ptr } %78, 1
  store ptr %82, ptr %81, align 8
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = call i32 @json_obj_getint(ptr noundef %83, ptr noundef @.str.1)
  %85 = trunc i32 %84 to i16
  %86 = getelementptr inbounds %struct.svg_Assignment, ptr %14, i32 0, i32 0
  store i16 %85, ptr %86, align 8, !tbaa !27
  %87 = load ptr, ptr %11, align 8, !tbaa !5
  %88 = call i32 @json_obj_getint(ptr noundef %87, ptr noundef @.str.2)
  %89 = trunc i32 %88 to i16
  %90 = getelementptr inbounds %struct.svg_Assignment, ptr %14, i32 0, i32 1
  store i16 %89, ptr %90, align 2, !tbaa !29
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = call i32 @strcmp(ptr noundef %91, ptr noundef @.str.4) #7
  %93 = icmp eq i32 %92, 0
  br i1 %93, label %94, label %103

94:                                               ; preds = %76
  %95 = call ptr (...) @bufnew()
  %96 = getelementptr inbounds %struct.svg_Assignment, ptr %14, i32 0, i32 2
  store ptr %95, ptr %96, align 8, !tbaa !30
  %97 = getelementptr inbounds %struct.svg_Assignment, ptr %14, i32 0, i32 2
  %98 = load ptr, ptr %97, align 8, !tbaa !30
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = call i64 @sdslen(ptr noundef %99)
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  call void @bufwrite_bytes(ptr noundef %98, i64 noundef %100, ptr noundef %101)
  %102 = load ptr, ptr %13, align 8, !tbaa !5
  call void @sdsfree(ptr noundef %102)
  br label %116

103:                                              ; preds = %76
  %104 = call ptr (...) @bufnew()
  %105 = getelementptr inbounds %struct.svg_Assignment, ptr %14, i32 0, i32 2
  store ptr %104, ptr %105, align 8, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = load ptr, ptr %13, align 8, !tbaa !5
  %108 = call i64 @sdslen(ptr noundef %107)
  %109 = call ptr @base64_encode(ptr noundef %106, i64 noundef %108, ptr noundef %15)
  store ptr %109, ptr %16, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.svg_Assignment, ptr %14, i32 0, i32 2
  %111 = load ptr, ptr %110, align 8, !tbaa !30
  %112 = load i64, ptr %15, align 8, !tbaa !31
  %113 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bufwrite_bytes(ptr noundef %111, i64 noundef %112, ptr noundef %113)
  %114 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %114) #6
  store ptr null, ptr %16, align 8, !tbaa !5
  %115 = load ptr, ptr %13, align 8, !tbaa !5
  call void @sdsfree(ptr noundef %115)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %116

116:                                              ; preds = %103, %94
  %117 = load ptr, ptr getelementptr inbounds (%struct.__caryll_vectorinterface_table_SVG, ptr @table_iSVG, i32 0, i32 13), align 8, !tbaa !33
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds { i64, ptr }, ptr %14, i32 0, i32 0
  %120 = load i64, ptr %119, align 8
  %121 = getelementptr inbounds { i64, ptr }, ptr %14, i32 0, i32 1
  %122 = load ptr, ptr %121, align 8
  call void %117(ptr noundef %118, i64 %120, ptr %122)
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  store i32 0, ptr %7, align 4
  br label %123

123:                                              ; preds = %116, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %124

124:                                              ; preds = %123, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  %125 = load i32, ptr %7, align 4
  switch i32 %125, label %144 [
    i32 0, label %126
    i32 7, label %127
  ]

126:                                              ; preds = %124
  br label %127

127:                                              ; preds = %126, %124
  %128 = load i16, ptr %10, align 2, !tbaa !19
  %129 = add i16 %128, 1
  store i16 %129, ptr %10, align 2, !tbaa !19
  br label %39, !llvm.loop !34

130:                                              ; preds = %47
  br label %131

131:                                              ; preds = %130
  store i8 0, ptr %9, align 1, !tbaa !16
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.otfcc_Options, ptr %132, i32 0, i32 24
  %134 = load ptr, ptr %133, align 8, !tbaa !11
  %135 = getelementptr inbounds %struct.otfcc_ILogger, ptr %134, i32 0, i32 8
  %136 = load ptr, ptr %135, align 8, !tbaa !36
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.otfcc_Options, ptr %137, i32 0, i32 24
  %139 = load ptr, ptr %138, align 8, !tbaa !11
  call void %136(ptr noundef %139)
  br label %34, !llvm.loop !37

140:                                              ; preds = %37
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %141, ptr %3, align 8
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %142

142:                                              ; preds = %140, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %143 = load ptr, ptr %3, align 8
  ret ptr %143

144:                                              ; preds = %124
  unreachable
}

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

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

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @sdslen(ptr noundef) #4

declare void @sdsfree(ptr noundef) #1

attributes #0 = { 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 "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 willreturn memory(read) "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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!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_SVG", !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 48}
!26 = !{!"__caryll_elementinterface_svg_Assignment", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!27 = !{!28, !20, i64 0}
!28 = !{!"", !20, i64 0, !20, i64 2, !6, i64 8}
!29 = !{!28, !20, i64 2}
!30 = !{!28, !6, i64 8}
!31 = !{!32, !32, i64 0}
!32 = !{!"long", !7, i64 0}
!33 = !{!10, !6, i64 104}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{!15, !6, i64 64}
!37 = distinct !{!37, !35}


; 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_elementinterface_svg_Assignment = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__caryll_vectorinterface_table_SVG = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@svg_iAssignment = external dso_local local_unnamed_addr constant %struct.__caryll_elementinterface_svg_Assignment, align 8
@table_iSVG = external dso_local local_unnamed_addr constant %struct.__caryll_vectorinterface_table_SVG, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 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

declare ptr @bufnew(...) local_unnamed_addr #1

declare void @bufwrite_bytes(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

; 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

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2

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

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

.lr.ph:                                           ; preds = %.critedge
  %15 = getelementptr inbounds i8, ptr %4, i64 24
  %16 = load ptr, ptr getelementptr inbounds (i8, ptr @svg_iAssignment, i64 48), align 8
  %17 = load ptr, ptr getelementptr inbounds (i8, ptr @table_iSVG, i64 104), align 8
  br label %21

._crit_edge:                                      ; preds = %51, %.critedge
  %18 = load ptr, ptr %7, align 8, !tbaa !10
  %19 = getelementptr inbounds i8, ptr %18, i64 64
  %20 = load ptr, ptr %19, align 8, !tbaa !16
  call void %20(ptr noundef %18) #6
  br label %56

21:                                               ; preds = %.lr.ph, %51
  %.03441 = phi i16 [ 0, %.lr.ph ], [ %52, %51 ]
  %22 = load ptr, ptr %15, align 8, !tbaa !15
  %23 = zext i16 %.03441 to i64
  %24 = getelementptr inbounds ptr, ptr %22, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !17
  %.not39 = icmp eq ptr %25, null
  br i1 %.not39, label %51, label %26

26:                                               ; preds = %21
  %27 = getelementptr inbounds i8, ptr %25, i64 8
  %28 = load i32, ptr %27, align 8, !tbaa !18
  %.not40 = icmp eq i32 %28, 1
  br i1 %.not40, label %29, label %51

29:                                               ; preds = %26
  %30 = call ptr @json_obj_getstr_share(ptr noundef nonnull %25, ptr noundef nonnull @.str.3)
  %31 = call ptr @json_obj_getsds(ptr noundef nonnull %25, ptr noundef nonnull @.str.5)
  %32 = icmp ne ptr %30, null
  %33 = icmp ne ptr %31, null
  %or.cond = select i1 %32, i1 %33, i1 false
  br i1 %or.cond, label %34, label %51

34:                                               ; preds = %29
  %35 = call { i64, ptr } (...) %16() #6
  %36 = extractvalue { i64, ptr } %35, 0
  %37 = call i32 @json_obj_getint(ptr noundef nonnull %25, ptr noundef nonnull @.str.1)
  %.sroa.0.0.insert.mask = and i64 %36, -4294967296
  %38 = call i32 @json_obj_getint(ptr noundef nonnull %25, ptr noundef nonnull @.str.2)
  %39 = shl i32 %38, 16
  %.sroa.0.2.insert.shift = zext i32 %39 to i64
  %40 = and i32 %37, 65535
  %.sroa.0.0.insert.ext.masked = zext nneg i32 %40 to i64
  %.sroa.0.2.insert.mask = or disjoint i64 %.sroa.0.0.insert.mask, %.sroa.0.0.insert.ext.masked
  %.sroa.0.2.insert.insert = or disjoint i64 %.sroa.0.2.insert.mask, %.sroa.0.2.insert.shift
  %41 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %30, ptr noundef nonnull dereferenceable(1) @.str.4) #7
  %42 = icmp eq i32 %41, 0
  %43 = call ptr (...) @bufnew() #6
  br i1 %42, label %44, label %46

44:                                               ; preds = %34
  %45 = call i64 @sdslen(ptr noundef nonnull %31)
  call void @bufwrite_bytes(ptr noundef %43, i64 noundef %45, ptr noundef nonnull %31) #6
  call void @sdsfree(ptr noundef nonnull %31) #6
  br label %50

46:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  store i64 0, ptr %3, align 8, !tbaa !21
  %47 = call i64 @sdslen(ptr noundef nonnull %31)
  %48 = call ptr @base64_encode(ptr noundef nonnull %31, i64 noundef %47, ptr noundef nonnull %3) #6
  %49 = load i64, ptr %3, align 8, !tbaa !21
  call void @bufwrite_bytes(ptr noundef %43, i64 noundef %49, ptr noundef %48) #6
  call void @free(ptr noundef %48) #6
  call void @sdsfree(ptr noundef nonnull %31) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %50

50:                                               ; preds = %46, %44
  call void %17(ptr noundef %6, i64 %.sroa.0.2.insert.insert, ptr %43) #6
  br label %51

51:                                               ; preds = %50, %29, %21, %26
  %52 = add i16 %.03441, 1
  %53 = zext i16 %52 to i32
  %54 = load i32, ptr %13, align 8, !tbaa !15
  %55 = icmp ugt i32 %54, %53
  br i1 %55, label %21, label %._crit_edge, !llvm.loop !23

56:                                               ; preds = %2, %._crit_edge
  %.0 = phi ptr [ %6, %._crit_edge ], [ 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 #4

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @sdslen(ptr noundef) local_unnamed_addr #4

declare void @sdsfree(ptr noundef) local_unnamed_addr #1

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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!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_SVG", !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, !22, i64 0}
!22 = !{!"long", !8, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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