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

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

@.str = external hidden unnamed_addr constant [4 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: inlinehint nounwind uwtable
declare hidden ptr @__caryll_allocate_clean(i64 noundef, i64 noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @read_16u(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, ...) #2

declare ptr @sdsempty() #2

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

21:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.otfcc_Options, ptr %22, i32 0, i32 24
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct.otfcc_ILogger, ptr %24, i32 0, i32 4
  %26 = load ptr, ptr %25, align 8, !tbaa !12
  %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 !9
  %30 = call ptr @sdsempty()
  %31 = call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %30, ptr noundef @.str)
  call void %26(ptr noundef %29, ptr noundef %31)
  store i8 1, ptr %9, align 1, !tbaa !14
  br label %32

32:                                               ; preds = %114, %21
  %33 = load i8, ptr %9, align 1, !tbaa !14, !range !15, !noundef !16
  %34 = trunc i8 %33 to i1
  br i1 %34, label %36, label %35

35:                                               ; preds = %32
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %123

36:                                               ; preds = %32
  %37 = call ptr @__caryll_allocate_clean(i64 noundef 16, i64 noundef 44)
  store ptr %37, ptr %7, align 8, !tbaa !5
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._json_value, ptr %38, i32 0, i32 2
  %40 = getelementptr inbounds %struct.anon.1, ptr %39, i32 0, i32 0
  %41 = load i32, ptr %40, align 8, !tbaa !17
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.table_cvt, ptr %42, i32 0, i32 0
  store i32 %41, ptr %43, align 8, !tbaa !18
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.table_cvt, ptr %44, i32 0, i32 0
  %46 = load i32, ptr %45, align 8, !tbaa !18
  %47 = add i32 %46, 1
  %48 = zext i32 %47 to i64
  %49 = mul i64 2, %48
  %50 = call ptr @__caryll_allocate_clean(i64 noundef %49, i64 noundef 46)
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.table_cvt, ptr %51, i32 0, i32 1
  store ptr %50, ptr %52, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #5
  store i16 0, ptr %11, align 2, !tbaa !22
  br label %53

53:                                               ; preds = %110, %36
  %54 = load i16, ptr %11, align 2, !tbaa !22
  %55 = zext i16 %54 to i32
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.table_cvt, ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 8, !tbaa !18
  %59 = icmp ult i32 %55, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %53
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #5
  br label %113

61:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._json_value, ptr %62, i32 0, i32 2
  %64 = getelementptr inbounds %struct.anon.1, ptr %63, i32 0, i32 1
  %65 = load ptr, ptr %64, align 8, !tbaa !17
  %66 = load i16, ptr %11, align 2, !tbaa !22
  %67 = zext i16 %66 to i64
  %68 = getelementptr inbounds ptr, ptr %65, i64 %67
  %69 = load ptr, ptr %68, align 8, !tbaa !5
  store ptr %69, ptr %12, align 8, !tbaa !5
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._json_value, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 8, !tbaa !24
  %73 = icmp eq i32 %72, 3
  br i1 %73, label %74, label %85

74:                                               ; preds = %61
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._json_value, ptr %75, i32 0, i32 2
  %77 = load i64, ptr %76, align 8, !tbaa !17
  %78 = trunc i64 %77 to i16
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.table_cvt, ptr %79, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !21
  %82 = load i16, ptr %11, align 2, !tbaa !22
  %83 = zext i16 %82 to i64
  %84 = getelementptr inbounds i16, ptr %81, i64 %83
  store i16 %78, ptr %84, align 2, !tbaa !22
  br label %109

85:                                               ; preds = %61
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._json_value, ptr %86, i32 0, i32 1
  %88 = load i32, ptr %87, align 8, !tbaa !24
  %89 = icmp eq i32 %88, 4
  br i1 %89, label %90, label %101

90:                                               ; preds = %85
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._json_value, ptr %91, i32 0, i32 2
  %93 = load double, ptr %92, align 8, !tbaa !17
  %94 = fptoui double %93 to i16
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.table_cvt, ptr %95, i32 0, i32 1
  %97 = load ptr, ptr %96, align 8, !tbaa !21
  %98 = load i16, ptr %11, align 2, !tbaa !22
  %99 = zext i16 %98 to i64
  %100 = getelementptr inbounds i16, ptr %97, i64 %99
  store i16 %94, ptr %100, align 2, !tbaa !22
  br label %108

101:                                              ; preds = %85
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.table_cvt, ptr %102, i32 0, i32 1
  %104 = load ptr, ptr %103, align 8, !tbaa !21
  %105 = load i16, ptr %11, align 2, !tbaa !22
  %106 = zext i16 %105 to i64
  %107 = getelementptr inbounds i16, ptr %104, i64 %106
  store i16 0, ptr %107, align 2, !tbaa !22
  br label %108

108:                                              ; preds = %101, %90
  br label %109

109:                                              ; preds = %108, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %110

110:                                              ; preds = %109
  %111 = load i16, ptr %11, align 2, !tbaa !22
  %112 = add i16 %111, 1
  store i16 %112, ptr %11, align 2, !tbaa !22
  br label %53, !llvm.loop !26

113:                                              ; preds = %60
  br label %114

114:                                              ; preds = %113
  store i8 0, ptr %9, align 1, !tbaa !14
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.otfcc_Options, ptr %115, i32 0, i32 24
  %117 = load ptr, ptr %116, align 8, !tbaa !9
  %118 = getelementptr inbounds %struct.otfcc_ILogger, ptr %117, i32 0, i32 8
  %119 = load ptr, ptr %118, align 8, !tbaa !28
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.otfcc_Options, ptr %120, i32 0, i32 24
  %122 = load ptr, ptr %121, align 8, !tbaa !9
  call void %119(ptr noundef %122)
  br label %32, !llvm.loop !29

123:                                              ; preds = %35
  br label %208

124:                                              ; preds = %3
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = call ptr @json_obj_get_type(ptr noundef %125, ptr noundef %126, i32 noundef 5)
  store ptr %127, ptr %8, align 8, !tbaa !5
  %128 = icmp ne ptr %127, null
  br i1 %128, label %129, label %207

129:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.otfcc_Options, ptr %130, i32 0, i32 24
  %132 = load ptr, ptr %131, align 8, !tbaa !9
  %133 = getelementptr inbounds %struct.otfcc_ILogger, ptr %132, i32 0, i32 4
  %134 = load ptr, ptr %133, align 8, !tbaa !12
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.otfcc_Options, ptr %135, i32 0, i32 24
  %137 = load ptr, ptr %136, align 8, !tbaa !9
  %138 = call ptr @sdsempty()
  %139 = call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %138, ptr noundef @.str)
  call void %134(ptr noundef %137, ptr noundef %139)
  store i8 1, ptr %13, align 1, !tbaa !14
  br label %140

140:                                              ; preds = %197, %129
  %141 = load i8, ptr %13, align 1, !tbaa !14, !range !15, !noundef !16
  %142 = trunc i8 %141 to i1
  br i1 %142, label %144, label %143

143:                                              ; preds = %140
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  br label %206

144:                                              ; preds = %140
  %145 = call ptr @__caryll_allocate_clean(i64 noundef 16, i64 noundef 61)
  store ptr %145, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._json_value, ptr %146, i32 0, i32 2
  %148 = getelementptr inbounds %struct.anon, ptr %147, i32 0, i32 1
  %149 = load ptr, ptr %148, align 8, !tbaa !17
  %150 = load ptr, ptr %8, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct._json_value, ptr %150, i32 0, i32 2
  %152 = getelementptr inbounds %struct.anon, ptr %151, i32 0, i32 0
  %153 = load i32, ptr %152, align 8, !tbaa !17
  %154 = zext i32 %153 to i64
  %155 = call ptr @base64_decode(ptr noundef %149, i64 noundef %154, ptr noundef %14)
  store ptr %155, ptr %15, align 8, !tbaa !5
  %156 = load i64, ptr %14, align 8, !tbaa !30
  %157 = lshr i64 %156, 1
  %158 = trunc i64 %157 to i32
  %159 = load ptr, ptr %7, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.table_cvt, ptr %159, i32 0, i32 0
  store i32 %158, ptr %160, align 8, !tbaa !18
  %161 = load ptr, ptr %7, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.table_cvt, ptr %161, i32 0, i32 0
  %163 = load i32, ptr %162, align 8, !tbaa !18
  %164 = add i32 %163, 1
  %165 = zext i32 %164 to i64
  %166 = mul i64 2, %165
  %167 = call ptr @__caryll_allocate_clean(i64 noundef %166, i64 noundef 66)
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.table_cvt, ptr %168, i32 0, i32 1
  store ptr %167, ptr %169, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #5
  store i16 0, ptr %16, align 2, !tbaa !22
  br label %170

170:                                              ; preds = %192, %144
  %171 = load i16, ptr %16, align 2, !tbaa !22
  %172 = zext i16 %171 to i32
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.table_cvt, ptr %173, i32 0, i32 0
  %175 = load i32, ptr %174, align 8, !tbaa !18
  %176 = icmp ult i32 %172, %175
  br i1 %176, label %178, label %177

177:                                              ; preds = %170
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #5
  br label %195

178:                                              ; preds = %170
  %179 = load ptr, ptr %15, align 8, !tbaa !5
  %180 = load i16, ptr %16, align 2, !tbaa !22
  %181 = zext i16 %180 to i32
  %182 = mul nsw i32 2, %181
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds i8, ptr %179, i64 %183
  %185 = call zeroext i16 @read_16u(ptr noundef %184)
  %186 = load ptr, ptr %7, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.table_cvt, ptr %186, i32 0, i32 1
  %188 = load ptr, ptr %187, align 8, !tbaa !21
  %189 = load i16, ptr %16, align 2, !tbaa !22
  %190 = zext i16 %189 to i64
  %191 = getelementptr inbounds i16, ptr %188, i64 %190
  store i16 %185, ptr %191, align 2, !tbaa !22
  br label %192

192:                                              ; preds = %178
  %193 = load i16, ptr %16, align 2, !tbaa !22
  %194 = add i16 %193, 1
  store i16 %194, ptr %16, align 2, !tbaa !22
  br label %170, !llvm.loop !32

195:                                              ; preds = %177
  %196 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %196) #5
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %197

197:                                              ; preds = %195
  store i8 0, ptr %13, align 1, !tbaa !14
  %198 = load ptr, ptr %5, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.otfcc_Options, ptr %198, i32 0, i32 24
  %200 = load ptr, ptr %199, align 8, !tbaa !9
  %201 = getelementptr inbounds %struct.otfcc_ILogger, ptr %200, i32 0, i32 8
  %202 = load ptr, ptr %201, align 8, !tbaa !28
  %203 = load ptr, ptr %5, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.otfcc_Options, ptr %203, i32 0, i32 24
  %205 = load ptr, ptr %204, align 8, !tbaa !9
  call void %202(ptr noundef %205)
  br label %140, !llvm.loop !33

206:                                              ; preds = %143
  br label %207

207:                                              ; preds = %206, %124
  br label %208

208:                                              ; preds = %207, %123
  %209 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret ptr %209
}

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

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

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

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


; 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"

@.str = external hidden unnamed_addr constant [4 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: inlinehint nounwind uwtable
declare hidden ptr @__caryll_allocate_clean(i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @read_16u(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 #2

declare ptr @sdsempty() local_unnamed_addr #2

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

6:                                                ; preds = %3
  %7 = getelementptr inbounds i8, ptr %1, i64 32
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %8, i64 32
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  %11 = tail call ptr @sdsempty() #5
  %12 = tail call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %11, ptr noundef nonnull @.str) #5
  tail call void %10(ptr noundef %8, ptr noundef %12) #5
  %13 = getelementptr inbounds i8, ptr %5, i64 16
  %14 = getelementptr inbounds i8, ptr %5, i64 24
  %15 = tail call ptr @__caryll_allocate_clean(i64 noundef 16, i64 noundef 44)
  %16 = load i32, ptr %13, align 8, !tbaa !13
  store i32 %16, ptr %15, align 8, !tbaa !14
  %17 = add i32 %16, 1
  %18 = zext i32 %17 to i64
  %19 = shl nuw nsw i64 %18, 1
  %20 = tail call ptr @__caryll_allocate_clean(i64 noundef %19, i64 noundef 46)
  %21 = getelementptr inbounds i8, ptr %15, i64 8
  store ptr %20, ptr %21, align 8, !tbaa !17
  %22 = load i32, ptr %15, align 8, !tbaa !14
  %.not61 = icmp eq i32 %22, 0
  br i1 %.not61, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %40, %6
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %23, i64 64
  %25 = load ptr, ptr %24, align 8, !tbaa !18
  tail call void %25(ptr noundef %23) #5
  br label %84

.lr.ph:                                           ; preds = %6, %40
  %.04856 = phi i16 [ %42, %40 ], [ 0, %6 ]
  %26 = load ptr, ptr %14, align 8, !tbaa !13
  %27 = zext i16 %.04856 to i64
  %28 = getelementptr inbounds ptr, ptr %26, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !19
  %30 = getelementptr inbounds i8, ptr %29, i64 8
  %31 = load i32, ptr %30, align 8, !tbaa !20
  switch i32 %31, label %40 [
    i32 3, label %32
    i32 4, label %36
  ]

32:                                               ; preds = %.lr.ph
  %33 = getelementptr inbounds i8, ptr %29, i64 16
  %34 = load i64, ptr %33, align 8, !tbaa !13
  %35 = trunc i64 %34 to i16
  br label %40

36:                                               ; preds = %.lr.ph
  %37 = getelementptr inbounds i8, ptr %29, i64 16
  %38 = load double, ptr %37, align 8, !tbaa !13
  %39 = fptoui double %38 to i16
  br label %40

40:                                               ; preds = %.lr.ph, %36, %32
  %.sink = phi i16 [ %39, %36 ], [ %35, %32 ], [ 0, %.lr.ph ]
  %41 = getelementptr inbounds i16, ptr %20, i64 %27
  store i16 %.sink, ptr %41, align 2, !tbaa !22
  %42 = add i16 %.04856, 1
  %43 = zext i16 %42 to i32
  %44 = icmp ugt i32 %22, %43
  br i1 %44, label %.lr.ph, label %._crit_edge, !llvm.loop !24

45:                                               ; preds = %3
  %46 = tail call ptr @json_obj_get_type(ptr noundef %0, ptr noundef %2, i32 noundef 5)
  %.not54 = icmp eq ptr %46, null
  br i1 %.not54, label %84, label %47

47:                                               ; preds = %45
  %48 = getelementptr inbounds i8, ptr %1, i64 32
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 32
  %51 = load ptr, ptr %50, align 8, !tbaa !11
  %52 = tail call ptr @sdsempty() #5
  %53 = tail call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %52, ptr noundef nonnull @.str) #5
  tail call void %51(ptr noundef %49, ptr noundef %53) #5
  %54 = getelementptr inbounds i8, ptr %46, i64 16
  %55 = getelementptr inbounds i8, ptr %46, i64 24
  %56 = tail call ptr @__caryll_allocate_clean(i64 noundef 16, i64 noundef 61)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %57 = load ptr, ptr %55, align 8, !tbaa !13
  %58 = load i32, ptr %54, align 8, !tbaa !13
  %59 = zext i32 %58 to i64
  %60 = call ptr @base64_decode(ptr noundef %57, i64 noundef %59, ptr noundef nonnull %4) #5
  %61 = load i64, ptr %4, align 8, !tbaa !26
  %62 = lshr i64 %61, 1
  %63 = trunc i64 %62 to i32
  store i32 %63, ptr %56, align 8, !tbaa !14
  %64 = add i64 %61, 2
  %65 = and i64 %64, 8589934590
  %66 = call ptr @__caryll_allocate_clean(i64 noundef %65, i64 noundef 66)
  %67 = getelementptr inbounds i8, ptr %56, i64 8
  store ptr %66, ptr %67, align 8, !tbaa !17
  %68 = load i32, ptr %56, align 8, !tbaa !14
  %.not62 = icmp eq i32 %68, 0
  br i1 %.not62, label %._crit_edge60, label %.lr.ph59

._crit_edge60:                                    ; preds = %.lr.ph59, %47
  call void @free(ptr noundef %60) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %69 = load ptr, ptr %48, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i64 64
  %71 = load ptr, ptr %70, align 8, !tbaa !18
  call void %71(ptr noundef %69) #5
  br label %84

.lr.ph59:                                         ; preds = %47, %.lr.ph59
  %72 = phi i32 [ %81, %.lr.ph59 ], [ 0, %47 ]
  %.057 = phi i16 [ %80, %.lr.ph59 ], [ 0, %47 ]
  %73 = shl nuw nsw i32 %72, 1
  %74 = zext nneg i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %60, i64 %74
  %76 = call zeroext i16 @read_16u(ptr noundef %75)
  %77 = load ptr, ptr %67, align 8, !tbaa !17
  %78 = zext i16 %.057 to i64
  %79 = getelementptr inbounds i16, ptr %77, i64 %78
  store i16 %76, ptr %79, align 2, !tbaa !22
  %80 = add i16 %.057, 1
  %81 = zext i16 %80 to i32
  %82 = load i32, ptr %56, align 8, !tbaa !14
  %83 = icmp ugt i32 %82, %81
  br i1 %83, label %.lr.ph59, label %._crit_edge60, !llvm.loop !28

84:                                               ; preds = %._crit_edge, %._crit_edge60, %45
  %.2 = phi ptr [ null, %45 ], [ %56, %._crit_edge60 ], [ %15, %._crit_edge ]
  ret ptr %.2
}

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 #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, !10, i64 32}
!6 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19, !7, i64 20, !7, i64 21, !7, i64 22, !10, i64 24, !10, i64 32}
!7 = !{!"_Bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !10, i64 32}
!12 = !{!"otfcc_ILogger", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88}
!13 = !{!8, !8, i64 0}
!14 = !{!15, !16, i64 0}
!15 = !{!"", !16, i64 0, !10, i64 8}
!16 = !{!"int", !8, i64 0}
!17 = !{!15, !10, i64 8}
!18 = !{!12, !10, i64 64}
!19 = !{!10, !10, i64 0}
!20 = !{!21, !16, i64 8}
!21 = !{!"_json_value", !10, i64 0, !16, i64 8, !8, i64 16, !8, i64 32}
!22 = !{!23, !23, i64 0}
!23 = !{!"short", !8, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !27, i64 0}
!27 = !{!"long", !8, i64 0}
!28 = distinct !{!28, !25}


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