; 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_value_t = type { ptr, %union.anon }
%union.anon = type { i64 }
%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 }
%struct.gravity_delegate_t = type { ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

; 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 void @free(ptr noundef) #1

; 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) #2

declare ptr @gravity_vm_delegate(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @gravity_value_free(ptr noundef, ptr, i64) #4

; Function Attrs: nounwind uwtable
define dso_local void @gravity_function_free(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %struct.gravity_value_t, align 8
  %9 = alloca i64, align 8
  %10 = alloca %struct.gravity_value_t, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = icmp ne ptr %11, null
  br i1 %12, label %14, label %13

13:                                               ; preds = %2
  br label %166

14:                                               ; preds = %2
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.gravity_function_t, ptr %15, i32 0, i32 2
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %36

19:                                               ; preds = %14
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %36

22:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = call ptr @gravity_vm_delegate(ptr noundef %23)
  store ptr %24, ptr %5, align 8, !tbaa !5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.gravity_delegate_t, ptr %25, i32 0, i32 24
  %27 = load ptr, ptr %26, align 8, !tbaa !15
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %35

29:                                               ; preds = %22
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.gravity_delegate_t, ptr %30, i32 0, i32 24
  %32 = load ptr, ptr %31, align 8, !tbaa !15
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  call void %32(ptr noundef %33, ptr noundef %34)
  br label %35

35:                                               ; preds = %29, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %36

36:                                               ; preds = %35, %19, %14
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.gravity_function_t, ptr %37, i32 0, i32 3
  %39 = load ptr, ptr %38, align 8, !tbaa !17
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %45

41:                                               ; preds = %36
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.gravity_function_t, ptr %42, i32 0, i32 3
  %44 = load ptr, ptr %43, align 8, !tbaa !17
  call void @free(ptr noundef %44) #5
  br label %45

45:                                               ; preds = %41, %36
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.gravity_function_t, ptr %46, i32 0, i32 8
  %48 = load i32, ptr %47, align 8, !tbaa !18
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %164

50:                                               ; preds = %45
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.gravity_function_t, ptr %51, i32 0, i32 9
  %53 = getelementptr inbounds %struct.anon.5, ptr %52, i32 0, i32 4
  %54 = load ptr, ptr %53, align 8, !tbaa !19
  %55 = icmp ne ptr %54, null
  br i1 %55, label %56, label %61

56:                                               ; preds = %50
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.gravity_function_t, ptr %57, i32 0, i32 9
  %59 = getelementptr inbounds %struct.anon.5, ptr %58, i32 0, i32 4
  %60 = load ptr, ptr %59, align 8, !tbaa !19
  call void @free(ptr noundef %60) #5
  br label %61

61:                                               ; preds = %56, %50
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.gravity_function_t, ptr %62, i32 0, i32 9
  %64 = getelementptr inbounds %struct.anon.5, ptr %63, i32 0, i32 5
  %65 = load ptr, ptr %64, align 8, !tbaa !19
  %66 = icmp ne ptr %65, null
  br i1 %66, label %67, label %72

67:                                               ; preds = %61
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.gravity_function_t, ptr %68, i32 0, i32 9
  %70 = getelementptr inbounds %struct.anon.5, ptr %69, i32 0, i32 5
  %71 = load ptr, ptr %70, align 8, !tbaa !19
  call void @free(ptr noundef %71) #5
  br label %72

72:                                               ; preds = %67, %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.gravity_function_t, ptr %73, i32 0, i32 9
  %75 = getelementptr inbounds %struct.anon.5, ptr %74, i32 0, i32 1
  %76 = getelementptr inbounds %struct.gravity_value_r, ptr %75, i32 0, i32 0
  %77 = load i64, ptr %76, align 8, !tbaa !19
  store i64 %77, ptr %6, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !20
  br label %78

78:                                               ; preds = %95, %72
  %79 = load i64, ptr %7, align 8, !tbaa !20
  %80 = load i64, ptr %6, align 8, !tbaa !20
  %81 = icmp ult i64 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %98

83:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #5
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.gravity_function_t, ptr %84, i32 0, i32 9
  %86 = getelementptr inbounds %struct.anon.5, ptr %85, i32 0, i32 1
  %87 = getelementptr inbounds %struct.gravity_value_r, ptr %86, i32 0, i32 2
  %88 = load ptr, ptr %87, align 8, !tbaa !19
  %89 = load i64, ptr %7, align 8, !tbaa !20
  %90 = getelementptr inbounds %struct.gravity_value_t, ptr %88, i64 %89
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %90, i64 16, i1 false), !tbaa.struct !22
  %91 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8
  %93 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 1
  %94 = load i64, ptr %93, align 8
  call void @gravity_value_free(ptr noundef null, ptr %92, i64 %94)
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  br label %95

95:                                               ; preds = %83
  %96 = load i64, ptr %7, align 8, !tbaa !20
  %97 = add i64 %96, 1
  store i64 %97, ptr %7, align 8, !tbaa !20
  br label %78, !llvm.loop !23

98:                                               ; preds = %82
  %99 = load ptr, ptr %4, 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
  %102 = getelementptr inbounds %struct.gravity_value_r, ptr %101, i32 0, i32 2
  %103 = load ptr, ptr %102, align 8, !tbaa !19
  %104 = icmp ne ptr %103, null
  br i1 %104, label %105, label %111

105:                                              ; preds = %98
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.gravity_function_t, ptr %106, i32 0, i32 9
  %108 = getelementptr inbounds %struct.anon.5, ptr %107, i32 0, i32 1
  %109 = getelementptr inbounds %struct.gravity_value_r, ptr %108, i32 0, i32 2
  %110 = load ptr, ptr %109, align 8, !tbaa !19
  call void @free(ptr noundef %110) #5
  br label %111

111:                                              ; preds = %105, %98
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.gravity_function_t, ptr %112, i32 0, i32 9
  %114 = getelementptr inbounds %struct.anon.5, ptr %113, i32 0, i32 2
  %115 = getelementptr inbounds %struct.gravity_value_r, ptr %114, i32 0, i32 0
  %116 = load i64, ptr %115, align 8, !tbaa !19
  store i64 %116, ptr %6, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !20
  br label %117

117:                                              ; preds = %134, %111
  %118 = load i64, ptr %9, align 8, !tbaa !20
  %119 = load i64, ptr %6, align 8, !tbaa !20
  %120 = icmp ult i64 %118, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %137

122:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.gravity_function_t, ptr %123, i32 0, i32 9
  %125 = getelementptr inbounds %struct.anon.5, ptr %124, i32 0, i32 2
  %126 = getelementptr inbounds %struct.gravity_value_r, ptr %125, i32 0, i32 2
  %127 = load ptr, ptr %126, align 8, !tbaa !19
  %128 = load i64, ptr %9, align 8, !tbaa !20
  %129 = getelementptr inbounds %struct.gravity_value_t, ptr %127, i64 %128
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %129, i64 16, i1 false), !tbaa.struct !22
  %130 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8
  %132 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 1
  %133 = load i64, ptr %132, align 8
  call void @gravity_value_free(ptr noundef null, ptr %131, i64 %133)
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %134

134:                                              ; preds = %122
  %135 = load i64, ptr %9, align 8, !tbaa !20
  %136 = add i64 %135, 1
  store i64 %136, ptr %9, align 8, !tbaa !20
  br label %117, !llvm.loop !25

137:                                              ; preds = %121
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.gravity_function_t, ptr %138, i32 0, i32 9
  %140 = getelementptr inbounds %struct.anon.5, ptr %139, i32 0, i32 2
  %141 = getelementptr inbounds %struct.gravity_value_r, ptr %140, i32 0, i32 2
  %142 = load ptr, ptr %141, align 8, !tbaa !19
  %143 = icmp ne ptr %142, null
  br i1 %143, label %144, label %150

144:                                              ; preds = %137
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.gravity_function_t, ptr %145, i32 0, i32 9
  %147 = getelementptr inbounds %struct.anon.5, ptr %146, i32 0, i32 2
  %148 = getelementptr inbounds %struct.gravity_value_r, ptr %147, i32 0, i32 2
  %149 = load ptr, ptr %148, align 8, !tbaa !19
  call void @free(ptr noundef %149) #5
  br label %150

150:                                              ; preds = %144, %137
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.gravity_function_t, ptr %151, i32 0, i32 9
  %153 = getelementptr inbounds %struct.anon.5, ptr %152, i32 0, i32 0
  %154 = getelementptr inbounds %struct.gravity_value_r, ptr %153, i32 0, i32 2
  %155 = load ptr, ptr %154, align 8, !tbaa !19
  %156 = icmp ne ptr %155, null
  br i1 %156, label %157, label %163

157:                                              ; preds = %150
  %158 = load ptr, ptr %4, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.gravity_function_t, ptr %158, i32 0, i32 9
  %160 = getelementptr inbounds %struct.anon.5, ptr %159, i32 0, i32 0
  %161 = getelementptr inbounds %struct.gravity_value_r, ptr %160, i32 0, i32 2
  %162 = load ptr, ptr %161, align 8, !tbaa !19
  call void @free(ptr noundef %162) #5
  br label %163

163:                                              ; preds = %157, %150
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %164

164:                                              ; preds = %163, %45
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %165) #5
  br label %166

166:                                              ; preds = %164, %13
  ret void
}

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind 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 = !{!"", !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 = !{!16, !6, i64 184}
!16 = !{!"", !6, i64 0, !12, i64 8, !12, i64 9, !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, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184}
!17 = !{!10, !6, i64 56}
!18 = !{!10, !14, i64 72}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{i64 0, i64 8, !5, i64 8, i64 8, !19}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.gravity_value_t = type { ptr, %union.anon }
%union.anon = type { i64 }

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

declare ptr @gravity_vm_delegate(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @gravity_value_free(ptr noundef, ptr, i64) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @gravity_function_free(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %56, label %3

3:                                                ; preds = %2
  %4 = getelementptr inbounds i8, ptr %1, i64 48
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = icmp ne ptr %5, null
  %7 = icmp ne ptr %0, null
  %or.cond = and i1 %7, %6
  br i1 %or.cond, label %8, label %13

8:                                                ; preds = %3
  %9 = tail call ptr @gravity_vm_delegate(ptr noundef nonnull %0) #3
  %10 = getelementptr inbounds i8, ptr %9, i64 184
  %11 = load ptr, ptr %10, align 8, !tbaa !14
  %.not46 = icmp eq ptr %11, null
  br i1 %.not46, label %13, label %12

12:                                               ; preds = %8
  tail call void %11(ptr noundef nonnull %0, ptr noundef nonnull %1) #3
  br label %13

13:                                               ; preds = %8, %12, %3
  %14 = getelementptr inbounds i8, ptr %1, i64 56
  %15 = load ptr, ptr %14, align 8, !tbaa !16
  %.not47 = icmp eq ptr %15, null
  br i1 %.not47, label %17, label %16

16:                                               ; preds = %13
  tail call void @free(ptr noundef nonnull %15) #3
  br label %17

17:                                               ; preds = %16, %13
  %18 = getelementptr inbounds i8, ptr %1, i64 72
  %19 = load i32, ptr %18, align 8, !tbaa !17
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %55

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %1, i64 160
  %23 = load ptr, ptr %22, align 8, !tbaa !18
  %.not48 = icmp eq ptr %23, null
  br i1 %.not48, label %25, label %24

24:                                               ; preds = %21
  tail call void @free(ptr noundef nonnull %23) #3
  br label %25

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

28:                                               ; preds = %25
  tail call void @free(ptr noundef nonnull %27) #3
  br label %29

29:                                               ; preds = %28, %25
  %30 = getelementptr inbounds i8, ptr %1, i64 104
  %31 = load i64, ptr %30, align 8, !tbaa !18
  %.not58 = icmp eq i64 %31, 0
  br i1 %.not58, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %29
  %32 = getelementptr inbounds i8, ptr %1, i64 120
  br label %35

._crit_edge:                                      ; preds = %35, %29
  %33 = getelementptr inbounds i8, ptr %1, i64 120
  %34 = load ptr, ptr %33, align 8, !tbaa !18
  %.not50 = icmp eq ptr %34, null
  br i1 %.not50, label %40, label %39

35:                                               ; preds = %.lr.ph, %35
  %.053 = phi i64 [ 0, %.lr.ph ], [ %38, %35 ]
  %36 = load ptr, ptr %32, align 8, !tbaa !18
  %37 = getelementptr inbounds %struct.gravity_value_t, ptr %36, i64 %.053
  %.sroa.04.0.copyload = load ptr, ptr %37, align 8, !tbaa !19
  %.sroa.45.0..sroa_idx = getelementptr inbounds i8, ptr %37, i64 8
  %.sroa.45.0.copyload = load i64, ptr %.sroa.45.0..sroa_idx, align 8, !tbaa !18
  tail call void @gravity_value_free(ptr noundef null, ptr %.sroa.04.0.copyload, i64 %.sroa.45.0.copyload)
  %38 = add nuw i64 %.053, 1
  %exitcond.not = icmp eq i64 %38, %31
  br i1 %exitcond.not, label %._crit_edge, label %35, !llvm.loop !20

39:                                               ; preds = %._crit_edge
  tail call void @free(ptr noundef nonnull %34) #3
  br label %40

40:                                               ; preds = %39, %._crit_edge
  %41 = getelementptr inbounds i8, ptr %1, i64 128
  %42 = load i64, ptr %41, align 8, !tbaa !18
  %.not59 = icmp eq i64 %42, 0
  br i1 %.not59, label %._crit_edge57, label %.lr.ph56

.lr.ph56:                                         ; preds = %40
  %43 = getelementptr inbounds i8, ptr %1, i64 144
  br label %46

._crit_edge57:                                    ; preds = %46, %40
  %44 = getelementptr inbounds i8, ptr %1, i64 144
  %45 = load ptr, ptr %44, align 8, !tbaa !18
  %.not51 = icmp eq ptr %45, null
  br i1 %.not51, label %51, label %50

46:                                               ; preds = %.lr.ph56, %46
  %.03654 = phi i64 [ 0, %.lr.ph56 ], [ %49, %46 ]
  %47 = load ptr, ptr %43, align 8, !tbaa !18
  %48 = getelementptr inbounds %struct.gravity_value_t, ptr %47, i64 %.03654
  %.sroa.0.0.copyload = load ptr, ptr %48, align 8, !tbaa !19
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %48, i64 8
  %.sroa.4.0.copyload = load i64, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !18
  tail call void @gravity_value_free(ptr noundef null, ptr %.sroa.0.0.copyload, i64 %.sroa.4.0.copyload)
  %49 = add nuw i64 %.03654, 1
  %exitcond60.not = icmp eq i64 %49, %42
  br i1 %exitcond60.not, label %._crit_edge57, label %46, !llvm.loop !22

50:                                               ; preds = %._crit_edge57
  tail call void @free(ptr noundef nonnull %45) #3
  br label %51

51:                                               ; preds = %50, %._crit_edge57
  %52 = getelementptr inbounds i8, ptr %1, i64 96
  %53 = load ptr, ptr %52, align 8, !tbaa !18
  %.not52 = icmp eq ptr %53, null
  br i1 %.not52, label %55, label %54

54:                                               ; preds = %51
  tail call void @free(ptr noundef nonnull %53) #3
  br label %55

55:                                               ; preds = %51, %54, %17
  tail call void @free(ptr noundef nonnull %1) #3
  br label %56

56:                                               ; preds = %2, %55
  ret void
}

attributes #0 = { 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 #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 = { 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 = !{!"", !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 = !{!15, !7, i64 184}
!15 = !{!"", !7, i64 0, !11, i64 8, !11, i64 9, !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, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184}
!16 = !{!6, !7, i64 56}
!17 = !{!6, !13, i64 72}
!18 = !{!8, !8, i64 0}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


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