; LLVM IR from brewlin/garbage-collect :: generational (test)

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

@.str.1 = external hidden unnamed_addr constant [77 x i8], align 1
@newg = external global i32, align 4
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__.test_add_root_gc = external hidden unnamed_addr constant [24 x i8], align 1
@survivorfromg = external global i32, align 4
@.str.6 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [35 x i8], align 1

declare void @gc_init(i64 noundef) #0

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

declare ptr @minor_malloc(i64 noundef) #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

declare ptr @is_pointer_to_space(ptr noundef, i64 noundef) #0

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

; Function Attrs: nounwind uwtable
define dso_local void @test_add_root_gc() #3 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  call void @gc_init(i64 noundef 128)
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  %6 = call ptr @minor_malloc(i64 noundef 16)
  store ptr %6, ptr %1, align 8, !tbaa !5
  %7 = load ptr, ptr %1, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.t, ptr %7, i32 0, i32 0
  store i32 11, ptr %8, align 8, !tbaa !9
  %9 = load ptr, ptr %1, align 8, !tbaa !5
  %10 = load i32, ptr @newg, align 4, !tbaa !12
  %11 = sext i32 %10 to i64
  %12 = call ptr @is_pointer_to_space(ptr noundef %9, i64 noundef %11)
  %13 = icmp ne ptr %12, null
  br i1 %13, label %14, label %15

14:                                               ; preds = %0
  br label %16

15:                                               ; preds = %0
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 58, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

16:                                               ; preds = %14
  call void @add_roots(ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  %17 = call ptr @minor_malloc(i64 noundef 16)
  store ptr %17, ptr %2, align 8, !tbaa !5
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.t, ptr %18, i32 0, i32 0
  store i32 22, ptr %19, align 8, !tbaa !9
  %20 = load ptr, ptr %1, align 8, !tbaa !5
  %21 = load i32, ptr @newg, align 4, !tbaa !12
  %22 = sext i32 %21 to i64
  %23 = call ptr @is_pointer_to_space(ptr noundef %20, i64 noundef %22)
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %26

25:                                               ; preds = %16
  br label %27

26:                                               ; preds = %16
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 65, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

27:                                               ; preds = %25
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = load ptr, ptr %1, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.t, ptr %29, i32 0, i32 1
  store ptr %28, ptr %30, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %31 = call ptr @minor_malloc(i64 noundef 16)
  store ptr %31, ptr %3, align 8, !tbaa !5
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.t, ptr %32, i32 0, i32 0
  store i32 33, ptr %33, align 8, !tbaa !9
  %34 = load ptr, ptr %1, align 8, !tbaa !5
  %35 = load i32, ptr @survivorfromg, align 4, !tbaa !12
  %36 = sext i32 %35 to i64
  %37 = call ptr @is_pointer_to_space(ptr noundef %34, i64 noundef %36)
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %40

39:                                               ; preds = %27
  br label %41

40:                                               ; preds = %27
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 75, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

41:                                               ; preds = %39
  %42 = load ptr, ptr %1, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.t, ptr %42, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !13
  %45 = load i32, ptr @survivorfromg, align 4, !tbaa !12
  %46 = sext i32 %45 to i64
  %47 = call ptr @is_pointer_to_space(ptr noundef %44, i64 noundef %46)
  %48 = icmp ne ptr %47, null
  br i1 %48, label %49, label %50

49:                                               ; preds = %41
  br label %51

50:                                               ; preds = %41
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 76, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

51:                                               ; preds = %49
  %52 = load ptr, ptr %1, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.t, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !13
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = icmp ne ptr %54, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %51
  br label %59

58:                                               ; preds = %51
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 81, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

59:                                               ; preds = %57
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = load i32, ptr @newg, align 4, !tbaa !12
  %62 = sext i32 %61 to i64
  %63 = call ptr @is_pointer_to_space(ptr noundef %60, i64 noundef %62)
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %66

65:                                               ; preds = %59
  br label %67

66:                                               ; preds = %59
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 82, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

67:                                               ; preds = %65
  %68 = load ptr, ptr %1, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.header, ptr %68, i64 -1
  %70 = getelementptr inbounds %struct.header, ptr %69, i32 0, i32 3
  %71 = load i64, ptr %70, align 8, !tbaa !14
  %72 = icmp eq i64 %71, 1
  br i1 %72, label %73, label %74

73:                                               ; preds = %67
  br label %75

74:                                               ; preds = %67
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 84, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

75:                                               ; preds = %73
  %76 = load ptr, ptr %1, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.t, ptr %76, i32 0, i32 1
  %78 = load ptr, ptr %77, align 8, !tbaa !13
  %79 = getelementptr inbounds %struct.header, ptr %78, i64 -1
  %80 = getelementptr inbounds %struct.header, ptr %79, i32 0, i32 3
  %81 = load i64, ptr %80, align 8, !tbaa !14
  %82 = icmp eq i64 %81, 1
  br i1 %82, label %83, label %84

83:                                               ; preds = %75
  br label %85

84:                                               ; preds = %75
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 85, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

85:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %86 = call ptr @minor_malloc(i64 noundef 16)
  store ptr %86, ptr %4, align 8, !tbaa !5
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = icmp ne ptr %87, null
  br i1 %88, label %89, label %90

89:                                               ; preds = %85
  br label %91

90:                                               ; preds = %85
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 89, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

91:                                               ; preds = %89
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = load i32, ptr @newg, align 4, !tbaa !12
  %94 = sext i32 %93 to i64
  %95 = call ptr @is_pointer_to_space(ptr noundef %92, i64 noundef %94)
  %96 = icmp ne ptr %95, null
  br i1 %96, label %97, label %98

97:                                               ; preds = %91
  br label %99

98:                                               ; preds = %91
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 90, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

99:                                               ; preds = %97
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.t, ptr %100, i32 0, i32 0
  store i32 44, ptr %101, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %102 = call ptr @minor_malloc(i64 noundef 16)
  store ptr %102, ptr %5, align 8, !tbaa !5
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = icmp ne ptr %103, null
  br i1 %104, label %105, label %106

105:                                              ; preds = %99
  br label %107

106:                                              ; preds = %99
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.1, i32 noundef 98, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

107:                                              ; preds = %105
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = load i32, ptr @newg, align 4, !tbaa !12
  %110 = sext i32 %109 to i64
  %111 = call ptr @is_pointer_to_space(ptr noundef %108, i64 noundef %110)
  %112 = icmp ne ptr %111, null
  br i1 %112, label %113, label %114

113:                                              ; preds = %107
  br label %115

114:                                              ; preds = %107
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.1, i32 noundef 99, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

115:                                              ; preds = %113
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.t, ptr %116, i32 0, i32 0
  %118 = load i32, ptr %117, align 8, !tbaa !9
  %119 = icmp ne i32 %118, 33
  br i1 %119, label %120, label %121

120:                                              ; preds = %115
  br label %122

121:                                              ; preds = %115
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str.1, i32 noundef 101, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

122:                                              ; preds = %120
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.t, ptr %123, i32 0, i32 0
  %125 = load i32, ptr %124, align 8, !tbaa !9
  %126 = icmp ne i32 %125, 44
  br i1 %126, label %127, label %128

127:                                              ; preds = %122
  br label %129

128:                                              ; preds = %122
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 102, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

129:                                              ; preds = %127
  %130 = load ptr, ptr %1, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.header, ptr %130, i64 -1
  %132 = getelementptr inbounds %struct.header, ptr %131, i32 0, i32 3
  %133 = load i64, ptr %132, align 8, !tbaa !14
  %134 = icmp eq i64 %133, 2
  br i1 %134, label %135, label %136

135:                                              ; preds = %129
  br label %137

136:                                              ; preds = %129
  call void @__assert_fail(ptr noundef @.str.18, ptr noundef @.str.1, i32 noundef 103, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

137:                                              ; preds = %135
  %138 = load ptr, ptr %1, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.t, ptr %138, i32 0, i32 1
  %140 = load ptr, ptr %139, align 8, !tbaa !13
  %141 = getelementptr inbounds %struct.header, ptr %140, i64 -1
  %142 = getelementptr inbounds %struct.header, ptr %141, i32 0, i32 3
  %143 = load i64, ptr %142, align 8, !tbaa !14
  %144 = icmp eq i64 %143, 2
  br i1 %144, label %145, label %146

145:                                              ; preds = %137
  br label %147

146:                                              ; preds = %137
  call void @__assert_fail(ptr noundef @.str.19, ptr noundef @.str.1, i32 noundef 105, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

147:                                              ; preds = %145
  %148 = load ptr, ptr %1, align 8, !tbaa !5
  %149 = load i32, ptr @survivorfromg, align 4, !tbaa !12
  %150 = sext i32 %149 to i64
  %151 = call ptr @is_pointer_to_space(ptr noundef %148, i64 noundef %150)
  %152 = icmp ne ptr %151, null
  br i1 %152, label %153, label %154

153:                                              ; preds = %147
  br label %155

154:                                              ; preds = %147
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 106, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

155:                                              ; preds = %153
  %156 = load ptr, ptr %1, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.t, ptr %156, i32 0, i32 1
  %158 = load ptr, ptr %157, align 8, !tbaa !13
  %159 = load i32, ptr @survivorfromg, align 4, !tbaa !12
  %160 = sext i32 %159 to i64
  %161 = call ptr @is_pointer_to_space(ptr noundef %158, i64 noundef %160)
  %162 = icmp ne ptr %161, null
  br i1 %162, label %163, label %164

163:                                              ; preds = %155
  br label %165

164:                                              ; preds = %155
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 107, ptr noundef @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

165:                                              ; preds = %163
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

declare void @add_roots(ptr noundef) #0

attributes #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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn 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 = { nounwind }
attributes #5 = { noreturn 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, !11, i64 0}
!10 = !{!"t", !11, i64 0, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !6, i64 8}
!14 = !{!15, !16, i64 24}
!15 = !{!"header", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !6, i64 32, !6, i64 40}
!16 = !{!"long", !7, i64 0}


; 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.1 = external hidden unnamed_addr constant [77 x i8], align 1
@newg = external local_unnamed_addr global i32, align 4
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__.test_add_root_gc = external hidden unnamed_addr constant [24 x i8], align 1
@survivorfromg = external local_unnamed_addr global i32, align 4
@.str.6 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [35 x i8], align 1

declare void @gc_init(i64 noundef) local_unnamed_addr #0

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

declare ptr @minor_malloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare ptr @is_pointer_to_space(ptr noundef, i64 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local void @test_add_root_gc() local_unnamed_addr #3 {
  %1 = alloca ptr, align 8
  tail call void @gc_init(i64 noundef 128) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  %2 = tail call ptr @minor_malloc(i64 noundef 16) #4
  store ptr %2, ptr %1, align 8, !tbaa !5
  store i32 11, ptr %2, align 8, !tbaa !9
  %3 = load i32, ptr @newg, align 4, !tbaa !12
  %4 = sext i32 %3 to i64
  %5 = tail call ptr @is_pointer_to_space(ptr noundef nonnull %2, i64 noundef %4) #4
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %6, label %7

6:                                                ; preds = %0
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 58, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

7:                                                ; preds = %0
  call void @add_roots(ptr noundef nonnull %1) #4
  %8 = call ptr @minor_malloc(i64 noundef 16) #4
  store i32 22, ptr %8, align 8, !tbaa !9
  %9 = load ptr, ptr %1, align 8, !tbaa !5
  %10 = load i32, ptr @newg, align 4, !tbaa !12
  %11 = sext i32 %10 to i64
  %12 = call ptr @is_pointer_to_space(ptr noundef %9, i64 noundef %11) #4
  %.not13 = icmp eq ptr %12, null
  br i1 %.not13, label %13, label %14

13:                                               ; preds = %7
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 65, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

14:                                               ; preds = %7
  %15 = load ptr, ptr %1, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 8
  store ptr %8, ptr %16, align 8, !tbaa !13
  %17 = call ptr @minor_malloc(i64 noundef 16) #4
  store i32 33, ptr %17, align 8, !tbaa !9
  %18 = load ptr, ptr %1, align 8, !tbaa !5
  %19 = load i32, ptr @survivorfromg, align 4, !tbaa !12
  %20 = sext i32 %19 to i64
  %21 = call ptr @is_pointer_to_space(ptr noundef %18, i64 noundef %20) #4
  %.not14 = icmp eq ptr %21, null
  br i1 %.not14, label %22, label %23

22:                                               ; preds = %14
  call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 75, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

23:                                               ; preds = %14
  %24 = load ptr, ptr %1, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 8
  %26 = load ptr, ptr %25, align 8, !tbaa !13
  %27 = load i32, ptr @survivorfromg, align 4, !tbaa !12
  %28 = sext i32 %27 to i64
  %29 = call ptr @is_pointer_to_space(ptr noundef %26, i64 noundef %28) #4
  %.not15 = icmp eq ptr %29, null
  br i1 %.not15, label %30, label %31

30:                                               ; preds = %23
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 76, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

31:                                               ; preds = %23
  %32 = load ptr, ptr %1, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !13
  %.not16 = icmp eq ptr %34, %8
  br i1 %.not16, label %35, label %36

35:                                               ; preds = %31
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 81, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

36:                                               ; preds = %31
  %37 = load i32, ptr @newg, align 4, !tbaa !12
  %38 = sext i32 %37 to i64
  %39 = call ptr @is_pointer_to_space(ptr noundef nonnull %17, i64 noundef %38) #4
  %.not17 = icmp eq ptr %39, null
  br i1 %.not17, label %40, label %41

40:                                               ; preds = %36
  call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 82, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

41:                                               ; preds = %36
  %42 = load ptr, ptr %1, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 -24
  %44 = load i64, ptr %43, align 8, !tbaa !14
  %45 = icmp eq i64 %44, 1
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 84, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

47:                                               ; preds = %41
  %48 = getelementptr inbounds i8, ptr %42, i64 8
  %49 = load ptr, ptr %48, align 8, !tbaa !13
  %50 = getelementptr inbounds i8, ptr %49, i64 -24
  %51 = load i64, ptr %50, align 8, !tbaa !14
  %52 = icmp eq i64 %51, 1
  br i1 %52, label %54, label %53

53:                                               ; preds = %47
  call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 85, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

54:                                               ; preds = %47
  %55 = call ptr @minor_malloc(i64 noundef 16) #4
  %.not18 = icmp eq ptr %55, null
  br i1 %.not18, label %56, label %57

56:                                               ; preds = %54
  call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 89, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

57:                                               ; preds = %54
  %58 = load i32, ptr @newg, align 4, !tbaa !12
  %59 = sext i32 %58 to i64
  %60 = call ptr @is_pointer_to_space(ptr noundef nonnull %55, i64 noundef %59) #4
  %.not19 = icmp eq ptr %60, null
  br i1 %.not19, label %61, label %62

61:                                               ; preds = %57
  call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i32 noundef 90, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

62:                                               ; preds = %57
  store i32 44, ptr %55, align 8, !tbaa !9
  %63 = call ptr @minor_malloc(i64 noundef 16) #4
  %.not20 = icmp eq ptr %63, null
  br i1 %.not20, label %64, label %65

64:                                               ; preds = %62
  call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.1, i32 noundef 98, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

65:                                               ; preds = %62
  %66 = load i32, ptr @newg, align 4, !tbaa !12
  %67 = sext i32 %66 to i64
  %68 = call ptr @is_pointer_to_space(ptr noundef nonnull %63, i64 noundef %67) #4
  %.not21 = icmp eq ptr %68, null
  br i1 %.not21, label %69, label %70

69:                                               ; preds = %65
  call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.1, i32 noundef 99, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

70:                                               ; preds = %65
  %71 = load i32, ptr %17, align 8, !tbaa !9
  %.not22 = icmp eq i32 %71, 33
  br i1 %.not22, label %72, label %73

72:                                               ; preds = %70
  call void @__assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.1, i32 noundef 101, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

73:                                               ; preds = %70
  %74 = load i32, ptr %55, align 8, !tbaa !9
  %.not23 = icmp eq i32 %74, 44
  br i1 %.not23, label %75, label %76

75:                                               ; preds = %73
  call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 102, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

76:                                               ; preds = %73
  %77 = load ptr, ptr %1, align 8, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %77, i64 -24
  %79 = load i64, ptr %78, align 8, !tbaa !14
  %80 = icmp eq i64 %79, 2
  br i1 %80, label %82, label %81

81:                                               ; preds = %76
  call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.1, i32 noundef 103, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

82:                                               ; preds = %76
  %83 = getelementptr inbounds i8, ptr %77, i64 8
  %84 = load ptr, ptr %83, align 8, !tbaa !13
  %85 = getelementptr inbounds i8, ptr %84, i64 -24
  %86 = load i64, ptr %85, align 8, !tbaa !14
  %87 = icmp eq i64 %86, 2
  br i1 %87, label %89, label %88

88:                                               ; preds = %82
  call void @__assert_fail(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.1, i32 noundef 105, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

89:                                               ; preds = %82
  %90 = load i32, ptr @survivorfromg, align 4, !tbaa !12
  %91 = sext i32 %90 to i64
  %92 = call ptr @is_pointer_to_space(ptr noundef nonnull %77, i64 noundef %91) #4
  %.not24 = icmp eq ptr %92, null
  br i1 %.not24, label %93, label %94

93:                                               ; preds = %89
  call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 106, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

94:                                               ; preds = %89
  %95 = load ptr, ptr %1, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %95, i64 8
  %97 = load ptr, ptr %96, align 8, !tbaa !13
  %98 = load i32, ptr @survivorfromg, align 4, !tbaa !12
  %99 = sext i32 %98 to i64
  %100 = call ptr @is_pointer_to_space(ptr noundef %97, i64 noundef %99) #4
  %.not25 = icmp eq ptr %100, null
  br i1 %.not25, label %101, label %102

101:                                              ; preds = %94
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 107, ptr noundef nonnull @__PRETTY_FUNCTION__.test_add_root_gc) #5
  unreachable

102:                                              ; preds = %94
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  ret void
}

declare void @add_roots(ptr noundef) local_unnamed_addr #0

attributes #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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn 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 = { nounwind }
attributes #5 = { noreturn 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, !11, i64 0}
!10 = !{!"t", !11, i64 0, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !6, i64 8}
!14 = !{!15, !16, i64 24}
!15 = !{!"header", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !6, i64 32, !6, i64 40}
!16 = !{!"long", !7, i64 0}


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