; LLVM IR from marcobambini/gravity :: src/shared (gravity_value)

; 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.gravity_function_t = type { ptr, %struct.gravity_gc_s, ptr, ptr, i16, i16, i16, i16, i32, %union.anon.4 }
%struct.gravity_gc_s = type { i8, i8, ptr, ptr, ptr, ptr }
%union.anon.4 = type { %struct.anon.5 }
%struct.anon.5 = type { %struct.gravity_value_r, %struct.gravity_value_r, %struct.gravity_value_r, i32, ptr, ptr, float, i8 }
%struct.gravity_value_r = type { i64, i64, ptr }

@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [7 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
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #1

declare ptr @json_get_label(ptr noundef, ptr noundef) #2

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

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

declare void @json_add_int(ptr noundef, ptr noundef, i64 noundef) #2

declare void @json_add_bool(ptr noundef, ptr noundef, i1 noundef zeroext) #2

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

declare void @json_end_array(ptr noundef) #2

declare void @json_end_object(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @gravity_function_serialize(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [256 x i8], align 16
  %7 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.gravity_function_t, ptr %8, i32 0, i32 8
  %10 = load i32, ptr %9, align 8, !tbaa !9
  %11 = icmp eq i32 %10, 3
  br i1 %11, label %12, label %18

12:                                               ; preds = %2
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.gravity_function_t, ptr %14, i32 0, i32 3
  %16 = load ptr, ptr %15, align 8, !tbaa !15
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  call void @gravity_function_special_serialize(ptr noundef %13, ptr noundef %16, ptr noundef %17)
  br label %121

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.gravity_function_t, ptr %19, i32 0, i32 3
  %21 = load ptr, ptr %20, align 8, !tbaa !15
  store ptr %21, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %6) #4
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %29, label %24

24:                                               ; preds = %18
  %25 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %25, i64 noundef 256, ptr noundef @.str.28, ptr noundef %26) #4
  %28 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  store ptr %28, ptr %5, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %24, %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = call ptr @json_get_label(ptr noundef %30, ptr noundef %31)
  store ptr %32, ptr %7, align 8, !tbaa !5
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  call void @json_begin_object(ptr noundef %33, ptr noundef %34)
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  call void @json_add_cstring(ptr noundef %35, ptr noundef @.str.5, ptr noundef @.str.29)
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  call void @json_add_cstring(ptr noundef %36, ptr noundef @.str.7, ptr noundef %37)
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.gravity_function_t, ptr %39, i32 0, i32 8
  %41 = load i32, ptr %40, align 8, !tbaa !9
  %42 = zext i32 %41 to i64
  call void @json_add_int(ptr noundef %38, ptr noundef @.str.30, i64 noundef %42)
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.gravity_function_t, ptr %44, i32 0, i32 4
  %46 = load i16, ptr %45, align 8, !tbaa !16
  %47 = zext i16 %46 to i64
  call void @json_add_int(ptr noundef %43, ptr noundef @.str.31, i64 noundef %47)
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.gravity_function_t, ptr %49, i32 0, i32 9
  %51 = getelementptr inbounds %struct.anon.5, ptr %50, i32 0, i32 7
  %52 = load i8, ptr %51, align 4, !tbaa !17, !range !18, !noundef !19
  %53 = trunc i8 %52 to i1
  call void @json_add_bool(ptr noundef %48, ptr noundef @.str.32, i1 noundef zeroext %53)
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.gravity_function_t, ptr %54, i32 0, i32 8
  %56 = load i32, ptr %55, align 8, !tbaa !9
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %119

58:                                               ; preds = %29
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.gravity_function_t, ptr %60, i32 0, i32 5
  %62 = load i16, ptr %61, align 2, !tbaa !20
  %63 = zext i16 %62 to i64
  call void @json_add_int(ptr noundef %59, ptr noundef @.str.33, i64 noundef %63)
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.gravity_function_t, ptr %65, i32 0, i32 6
  %67 = load i16, ptr %66, align 4, !tbaa !21
  %68 = zext i16 %67 to i64
  call void @json_add_int(ptr noundef %64, ptr noundef @.str.34, i64 noundef %68)
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.gravity_function_t, ptr %70, i32 0, i32 7
  %72 = load i16, ptr %71, align 2, !tbaa !22
  %73 = zext i16 %72 to i64
  call void @json_add_int(ptr noundef %69, ptr noundef @.str.35, i64 noundef %73)
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.gravity_function_t, ptr %75, i32 0, i32 9
  %77 = getelementptr inbounds %struct.anon.5, ptr %76, i32 0, i32 6
  %78 = load float, ptr %77, align 8, !tbaa !17
  %79 = fpext float %78 to double
  call void @json_add_double(ptr noundef %74, ptr noundef @.str.36, double noundef %79)
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  call void @gravity_function_bytecode_serialize(ptr noundef %80, ptr noundef %81)
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  call void @json_begin_array(ptr noundef %82, ptr noundef @.str.37)
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.gravity_function_t, ptr %85, i32 0, i32 9
  %87 = getelementptr inbounds %struct.anon.5, ptr %86, i32 0, i32 0
  call void @gravity_function_array_serialize(ptr noundef %83, ptr noundef %84, ptr noundef byval(%struct.gravity_value_r) align 8 %87)
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  call void @json_end_array(ptr noundef %88)
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.gravity_function_t, ptr %89, i32 0, i32 9
  %91 = getelementptr inbounds %struct.anon.5, ptr %90, i32 0, i32 1
  %92 = getelementptr inbounds %struct.gravity_value_r, ptr %91, i32 0, i32 0
  %93 = load i64, ptr %92, align 8, !tbaa !17
  %94 = icmp ne i64 %93, 0
  br i1 %94, label %95, label %103

95:                                               ; preds = %58
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  call void @json_begin_array(ptr noundef %96, ptr noundef @.str.38)
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.gravity_function_t, ptr %99, i32 0, i32 9
  %101 = getelementptr inbounds %struct.anon.5, ptr %100, i32 0, i32 1
  call void @gravity_function_array_serialize(ptr noundef %97, ptr noundef %98, ptr noundef byval(%struct.gravity_value_r) align 8 %101)
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  call void @json_end_array(ptr noundef %102)
  br label %103

103:                                              ; preds = %95, %58
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.gravity_function_t, ptr %104, i32 0, i32 9
  %106 = getelementptr inbounds %struct.anon.5, ptr %105, i32 0, i32 2
  %107 = getelementptr inbounds %struct.gravity_value_r, ptr %106, i32 0, i32 0
  %108 = load i64, ptr %107, align 8, !tbaa !17
  %109 = icmp ne i64 %108, 0
  br i1 %109, label %110, label %118

110:                                              ; preds = %103
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  call void @json_begin_array(ptr noundef %111, ptr noundef @.str.39)
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.gravity_function_t, ptr %114, i32 0, i32 9
  %116 = getelementptr inbounds %struct.anon.5, ptr %115, i32 0, i32 2
  call void @gravity_function_array_serialize(ptr noundef %112, ptr noundef %113, ptr noundef byval(%struct.gravity_value_r) align 8 %116)
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  call void @json_end_array(ptr noundef %117)
  br label %118

118:                                              ; preds = %110, %103
  br label %119

119:                                              ; preds = %118, %29
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  call void @json_end_object(ptr noundef %120)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 256, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %121

121:                                              ; preds = %119, %12
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @gravity_function_special_serialize(ptr noundef, ptr noundef, ptr noundef) #3

declare void @json_add_double(ptr noundef, ptr noundef, double noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @gravity_function_bytecode_serialize(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @gravity_function_array_serialize(ptr noundef, ptr noundef, ptr noundef byval(%struct.gravity_value_r) align 8) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 }

!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, !14, i64 72}
!10 = !{!"", !6, i64 0, !11, i64 8, !6, i64 48, !6, i64 56, !13, i64 64, !13, i64 66, !13, i64 68, !13, i64 70, !14, i64 72, !7, i64 80}
!11 = !{!"gravity_gc_s", !12, i64 0, !12, i64 1, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!10, !6, i64 56}
!16 = !{!10, !13, i64 64}
!17 = !{!7, !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!10, !13, i64 66}
!21 = !{!10, !13, i64 68}
!22 = !{!10, !13, i64 70}


; 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.gravity_value_r = type { i64, i64, ptr }

@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [7 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

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

declare ptr @json_get_label(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

declare void @json_add_int(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @json_add_bool(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

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

declare void @json_end_array(ptr noundef) local_unnamed_addr #2

declare void @json_end_object(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @gravity_function_serialize(ptr noundef %0, ptr noundef %1) local_unnamed_addr #3 {
  %3 = alloca [256 x i8], align 16
  %4 = getelementptr inbounds i8, ptr %0, i64 72
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = icmp eq i32 %5, 3
  %7 = getelementptr inbounds i8, ptr %0, i64 56
  %8 = load ptr, ptr %7, align 8, !tbaa !14
  br i1 %6, label %9, label %10

9:                                                ; preds = %2
  tail call void @gravity_function_special_serialize(ptr noundef nonnull %0, ptr noundef %8, ptr noundef %1)
  br label %47

10:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %3) #4
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %11, label %13

11:                                               ; preds = %10
  %12 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %3, i64 noundef 256, ptr noundef nonnull @.str.28, ptr noundef nonnull %0) #4
  br label %13

13:                                               ; preds = %11, %10
  %.0 = phi ptr [ %8, %10 ], [ %3, %11 ]
  %14 = call ptr @json_get_label(ptr noundef %1, ptr noundef nonnull %.0) #4
  call void @json_begin_object(ptr noundef %1, ptr noundef %14) #4
  call void @json_add_cstring(ptr noundef %1, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.29) #4
  call void @json_add_cstring(ptr noundef %1, ptr noundef nonnull @.str.7, ptr noundef nonnull %.0) #4
  %15 = load i32, ptr %4, align 8, !tbaa !5
  %16 = zext i32 %15 to i64
  call void @json_add_int(ptr noundef %1, ptr noundef nonnull @.str.30, i64 noundef %16) #4
  %17 = getelementptr inbounds i8, ptr %0, i64 64
  %18 = load i16, ptr %17, align 8, !tbaa !15
  %19 = zext i16 %18 to i64
  call void @json_add_int(ptr noundef %1, ptr noundef nonnull @.str.31, i64 noundef %19) #4
  %20 = getelementptr inbounds i8, ptr %0, i64 180
  %21 = load i8, ptr %20, align 4, !tbaa !16, !range !17, !noundef !18
  %22 = trunc nuw i8 %21 to i1
  call void @json_add_bool(ptr noundef %1, ptr noundef nonnull @.str.32, i1 noundef zeroext %22) #4
  %23 = load i32, ptr %4, align 8, !tbaa !5
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %46

25:                                               ; preds = %13
  %26 = getelementptr inbounds i8, ptr %0, i64 80
  %27 = getelementptr inbounds i8, ptr %0, i64 66
  %28 = load i16, ptr %27, align 2, !tbaa !19
  %29 = zext i16 %28 to i64
  call void @json_add_int(ptr noundef %1, ptr noundef nonnull @.str.33, i64 noundef %29) #4
  %30 = getelementptr inbounds i8, ptr %0, i64 68
  %31 = load i16, ptr %30, align 4, !tbaa !20
  %32 = zext i16 %31 to i64
  call void @json_add_int(ptr noundef %1, ptr noundef nonnull @.str.34, i64 noundef %32) #4
  %33 = getelementptr inbounds i8, ptr %0, i64 70
  %34 = load i16, ptr %33, align 2, !tbaa !21
  %35 = zext i16 %34 to i64
  call void @json_add_int(ptr noundef %1, ptr noundef nonnull @.str.35, i64 noundef %35) #4
  %36 = getelementptr inbounds i8, ptr %0, i64 176
  %37 = load float, ptr %36, align 8, !tbaa !16
  %38 = fpext float %37 to double
  call void @json_add_double(ptr noundef %1, ptr noundef nonnull @.str.36, double noundef %38) #4
  call void @gravity_function_bytecode_serialize(ptr noundef nonnull %0, ptr noundef %1)
  call void @json_begin_array(ptr noundef %1, ptr noundef nonnull @.str.37) #4
  call void @gravity_function_array_serialize(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull byval(%struct.gravity_value_r) align 8 %26)
  call void @json_end_array(ptr noundef %1) #4
  %39 = getelementptr inbounds i8, ptr %0, i64 104
  %40 = load i64, ptr %39, align 8, !tbaa !16
  %.not50 = icmp eq i64 %40, 0
  br i1 %.not50, label %42, label %41

41:                                               ; preds = %25
  call void @json_begin_array(ptr noundef %1, ptr noundef nonnull @.str.38) #4
  call void @gravity_function_array_serialize(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull byval(%struct.gravity_value_r) align 8 %39)
  call void @json_end_array(ptr noundef %1) #4
  br label %42

42:                                               ; preds = %41, %25
  %43 = getelementptr inbounds i8, ptr %0, i64 128
  %44 = load i64, ptr %43, align 8, !tbaa !16
  %.not51 = icmp eq i64 %44, 0
  br i1 %.not51, label %46, label %45

45:                                               ; preds = %42
  call void @json_begin_array(ptr noundef %1, ptr noundef nonnull @.str.39) #4
  call void @gravity_function_array_serialize(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull byval(%struct.gravity_value_r) align 8 %43)
  call void @json_end_array(ptr noundef %1) #4
  br label %46

46:                                               ; preds = %42, %45, %13
  call void @json_end_object(ptr noundef %1) #4
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %3) #4
  br label %47

47:                                               ; preds = %46, %9
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @gravity_function_special_serialize(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @json_add_double(ptr noundef, ptr noundef, double noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @gravity_function_bytecode_serialize(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @gravity_function_array_serialize(ptr noundef, ptr noundef, ptr noundef byval(%struct.gravity_value_r) align 8) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nofree 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 #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 }

!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, !13, i64 72}
!6 = !{!"", !7, i64 0, !10, i64 8, !7, i64 48, !7, i64 56, !12, i64 64, !12, i64 66, !12, i64 68, !12, i64 70, !13, i64 72, !8, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"gravity_gc_s", !11, i64 0, !11, i64 1, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!11 = !{!"_Bool", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!6, !7, i64 56}
!15 = !{!6, !12, i64 64}
!16 = !{!8, !8, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!6, !12, i64 66}
!20 = !{!6, !12, i64 68}
!21 = !{!6, !12, i64 70}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass