; LLVM IR from humz2k/sugaryc :: ext/bdwgc (alloc)

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

@measure_performance = external hidden global i32, align 4
@full_gc_total_time = external hidden global i64, align 8
@GC_incremental = external dso_local global i32, align 4
@GC_dont_gc = external global i32, align 4
@GC_on_collection_event = external hidden global ptr, align 8
@GC_print_stats = external global i32, align 4
@.str = external hidden unnamed_addr constant [59 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [40 x i8], align 1
@GC_on_abort = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@GC_find_leak = external global i32, align 4
@GC_is_full_gc = external hidden global i32, align 4
@full_gc_total_ns_frac = external hidden global i32, align 4
@.str.3 = external hidden unnamed_addr constant [40 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 uwtable
declare dso_local i32 @GC_never_stop_func() #1

; Function Attrs: nounwind uwtable
declare dso_local void @GC_collect_a_little_inner(i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @GC_try_to_collect_inner(ptr noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %struct.timespec, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.timespec, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #8
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %10 = load i32, ptr @GC_dont_gc, align 4, !tbaa !9
  %11 = icmp ne i32 %10, 0
  br i1 %11, label %16, label %12

12:                                               ; preds = %1
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = call i32 %13()
  %15 = icmp ne i32 %14, 0
  br i1 %15, label %16, label %17

16:                                               ; preds = %12, %1
  store i32 0, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %152

17:                                               ; preds = %12
  %18 = load ptr, ptr @GC_on_collection_event, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %22

20:                                               ; preds = %17
  %21 = load ptr, ptr @GC_on_collection_event, align 8, !tbaa !5
  call void %21(i32 noundef 0)
  br label %22

22:                                               ; preds = %20, %17
  %23 = load i32, ptr @GC_incremental, align 4, !tbaa !9
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %49

25:                                               ; preds = %22
  %26 = call i32 @GC_collection_in_progress()
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %49

28:                                               ; preds = %25
  %29 = load i32, ptr @GC_print_stats, align 4, !tbaa !9
  %30 = icmp ne i32 %29, 0
  %31 = xor i1 %30, true
  %32 = zext i1 %31 to i32
  %33 = sext i32 %32 to i64
  %34 = call i64 @llvm.expect.i64(i64 %33, i64 1)
  %35 = icmp ne i64 %34, 0
  br i1 %35, label %36, label %37

36:                                               ; preds = %28
  br label %38

37:                                               ; preds = %28
  call void (ptr, ...) @GC_log_printf(ptr noundef @.str)
  br label %38

38:                                               ; preds = %37, %36
  br label %39

39:                                               ; preds = %45, %38
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = call i32 %40()
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %39
  store i32 0, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %152

44:                                               ; preds = %39
  call void @GC_collect_a_little_inner(i32 noundef 1)
  br label %45

45:                                               ; preds = %44
  %46 = call i32 @GC_collection_in_progress()
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %39, label %48, !llvm.loop !11

48:                                               ; preds = %45
  br label %49

49:                                               ; preds = %48, %25, %22
  call void @GC_notify_full_gc()
  store i32 0, ptr %5, align 4, !tbaa !9
  %50 = load i32, ptr @GC_print_stats, align 4, !tbaa !9
  %51 = load i32, ptr @measure_performance, align 4, !tbaa !9
  %52 = or i32 %50, %51
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %67

54:                                               ; preds = %49
  %55 = load i32, ptr @GC_print_stats, align 4, !tbaa !9
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %54
  call void (ptr, ...) @GC_log_printf(ptr noundef @.str.1)
  br label %58

58:                                               ; preds = %57, %54
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %58
  %60 = call i32 @clock_gettime(i32 noundef 1, ptr noundef %4) #8
  %61 = icmp eq i32 %60, -1
  br i1 %61, label %62, label %64

62:                                               ; preds = %59
  %63 = load ptr, ptr @GC_on_abort, align 8, !tbaa !5
  call void %63(ptr noundef @.str.2)
  call void @abort() #9
  unreachable

64:                                               ; preds = %59
  br label %65

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66, %49
  call void @GC_promote_black_lists()
  %68 = load i32, ptr @GC_find_leak, align 4, !tbaa !9
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %73, label %70

70:                                               ; preds = %67
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = icmp ne ptr %71, @GC_never_stop_func
  br i1 %72, label %73, label %78

73:                                               ; preds = %70, %67
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = call i32 @GC_reclaim_all(ptr noundef %74, i32 noundef 0)
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  store i32 0, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %152

78:                                               ; preds = %73, %70
  call void @GC_invalidate_mark_state()
  call void @GC_clear_marks()
  store i32 1, ptr @GC_is_full_gc, align 4, !tbaa !9
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = call i32 @GC_stopped_mark(ptr noundef %79)
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %87, label %82

82:                                               ; preds = %78
  %83 = load i32, ptr @GC_incremental, align 4, !tbaa !9
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %86, label %85

85:                                               ; preds = %82
  call void @GC_invalidate_mark_state()
  call void @GC_unpromote_black_lists()
  br label %86

86:                                               ; preds = %85, %82
  store i32 0, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %152

87:                                               ; preds = %78
  call void @GC_finish_collection()
  %88 = load i32, ptr %5, align 4, !tbaa !9
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %146

90:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  br label %91

91:                                               ; preds = %90
  %92 = call i32 @clock_gettime(i32 noundef 1, ptr noundef %7) #8
  %93 = icmp eq i32 %92, -1
  br i1 %93, label %94, label %96

94:                                               ; preds = %91
  %95 = load ptr, ptr @GC_on_abort, align 8, !tbaa !5
  call void %95(ptr noundef @.str.2)
  call void @abort() #9
  unreachable

96:                                               ; preds = %91
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  %99 = getelementptr inbounds %struct.timespec, ptr %7, i32 0, i32 1
  %100 = load i64, ptr %99, align 8, !tbaa !13
  %101 = getelementptr inbounds %struct.timespec, ptr %4, i32 0, i32 1
  %102 = load i64, ptr %101, align 8, !tbaa !13
  %103 = sub nsw i64 1000000000, %102
  %104 = add nsw i64 %100, %103
  %105 = udiv i64 %104, 1000000
  %106 = getelementptr inbounds %struct.timespec, ptr %7, i32 0, i32 0
  %107 = load i64, ptr %106, align 8, !tbaa !16
  %108 = getelementptr inbounds %struct.timespec, ptr %4, i32 0, i32 0
  %109 = load i64, ptr %108, align 8, !tbaa !16
  %110 = sub nsw i64 %107, %109
  %111 = mul i64 %110, 1000
  %112 = add i64 %105, %111
  %113 = sub i64 %112, 1000
  store i64 %113, ptr %8, align 8, !tbaa !17
  %114 = getelementptr inbounds %struct.timespec, ptr %7, i32 0, i32 1
  %115 = load i64, ptr %114, align 8, !tbaa !13
  %116 = getelementptr inbounds %struct.timespec, ptr %4, i32 0, i32 1
  %117 = load i64, ptr %116, align 8, !tbaa !13
  %118 = sub nsw i64 1000000000, %117
  %119 = add nsw i64 %115, %118
  %120 = urem i64 %119, 1000000
  store i64 %120, ptr %9, align 8, !tbaa !17
  %121 = load i32, ptr @measure_performance, align 4, !tbaa !9
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %123, label %139

123:                                              ; preds = %98
  %124 = load i64, ptr %8, align 8, !tbaa !17
  %125 = load i64, ptr @full_gc_total_time, align 8, !tbaa !17
  %126 = add i64 %125, %124
  store i64 %126, ptr @full_gc_total_time, align 8, !tbaa !17
  %127 = load i64, ptr %9, align 8, !tbaa !17
  %128 = trunc i64 %127 to i32
  %129 = load i32, ptr @full_gc_total_ns_frac, align 4, !tbaa !9
  %130 = add i32 %129, %128
  store i32 %130, ptr @full_gc_total_ns_frac, align 4, !tbaa !9
  %131 = load i32, ptr @full_gc_total_ns_frac, align 4, !tbaa !9
  %132 = icmp uge i32 %131, 1000000
  br i1 %132, label %133, label %138

133:                                              ; preds = %123
  %134 = load i32, ptr @full_gc_total_ns_frac, align 4, !tbaa !9
  %135 = sub i32 %134, 1000000
  store i32 %135, ptr @full_gc_total_ns_frac, align 4, !tbaa !9
  %136 = load i64, ptr @full_gc_total_time, align 8, !tbaa !17
  %137 = add i64 %136, 1
  store i64 %137, ptr @full_gc_total_time, align 8, !tbaa !17
  br label %138

138:                                              ; preds = %133, %123
  br label %139

139:                                              ; preds = %138, %98
  %140 = load i32, ptr @GC_print_stats, align 4, !tbaa !9
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %145

142:                                              ; preds = %139
  %143 = load i64, ptr %8, align 8, !tbaa !17
  %144 = load i64, ptr %9, align 8, !tbaa !17
  call void (ptr, ...) @GC_log_printf(ptr noundef @.str.3, i64 noundef %143, i64 noundef %144)
  br label %145

145:                                              ; preds = %142, %139
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #8
  br label %146

146:                                              ; preds = %145, %87
  %147 = load ptr, ptr @GC_on_collection_event, align 8, !tbaa !5
  %148 = icmp ne ptr %147, null
  br i1 %148, label %149, label %151

149:                                              ; preds = %146
  %150 = load ptr, ptr @GC_on_collection_event, align 8, !tbaa !5
  call void %150(i32 noundef 5)
  br label %151

151:                                              ; preds = %149, %146
  store i32 1, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %152

152:                                              ; preds = %151, %86, %77, %43, %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #8
  %153 = load i32, ptr %2, align 4
  ret i32 %153
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare i32 @GC_collection_in_progress() #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #4

declare void @GC_log_printf(ptr noundef, ...) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @GC_notify_full_gc() #5

; Function Attrs: nounwind
declare i32 @clock_gettime(i32 noundef, ptr noundef) #6

; Function Attrs: noreturn nounwind
declare void @abort() #7

declare void @GC_promote_black_lists() #3

declare i32 @GC_reclaim_all(ptr noundef, i32 noundef) #3

declare void @GC_invalidate_mark_state() #3

declare void @GC_clear_marks() #3

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

declare void @GC_unpromote_black_lists() #3

; Function Attrs: nounwind uwtable
declare hidden void @GC_finish_collection() #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #5 = { 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 #6 = { 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !15, i64 8}
!14 = !{!"timespec", !15, i64 0, !15, i64 8}
!15 = !{!"long", !7, i64 0}
!16 = !{!14, !15, i64 0}
!17 = !{!15, !15, 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"

%struct.timespec = type { i64, i64 }

@measure_performance = external hidden local_unnamed_addr global i32, align 4
@full_gc_total_time = external hidden local_unnamed_addr global i64, align 8
@GC_incremental = external dso_local local_unnamed_addr global i32, align 4
@GC_dont_gc = external local_unnamed_addr global i32, align 4
@GC_on_collection_event = external hidden local_unnamed_addr global ptr, align 8
@GC_print_stats = external local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [59 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [40 x i8], align 1
@GC_on_abort = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@GC_find_leak = external local_unnamed_addr global i32, align 4
@GC_is_full_gc = external hidden local_unnamed_addr global i32, align 4
@full_gc_total_ns_frac = external hidden local_unnamed_addr global i32, align 4
@.str.3 = external hidden unnamed_addr constant [40 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: nounwind uwtable
declare dso_local i32 @GC_never_stop_func() #1

; Function Attrs: nounwind uwtable
declare dso_local void @GC_collect_a_little_inner(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @GC_try_to_collect_inner(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca %struct.timespec, align 8
  %3 = alloca %struct.timespec, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %2, i8 0, i64 16, i1 false)
  %4 = load i32, ptr @GC_dont_gc, align 4, !tbaa !5
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %5, label %.loopexit

5:                                                ; preds = %1
  %6 = tail call i32 %0() #7
  %.not15 = icmp eq i32 %6, 0
  br i1 %.not15, label %7, label %.loopexit

7:                                                ; preds = %5
  %8 = load ptr, ptr @GC_on_collection_event, align 8, !tbaa !9
  %.not16 = icmp eq ptr %8, null
  br i1 %.not16, label %10, label %9

9:                                                ; preds = %7
  tail call void %8(i32 noundef 0) #7
  br label %10

10:                                               ; preds = %9, %7
  %11 = load i32, ptr @GC_incremental, align 4, !tbaa !5
  %.not17 = icmp eq i32 %11, 0
  br i1 %.not17, label %.loopexit31, label %12

12:                                               ; preds = %10
  %13 = tail call i32 @GC_collection_in_progress() #7
  %.not18 = icmp eq i32 %13, 0
  br i1 %.not18, label %.loopexit31, label %14

14:                                               ; preds = %12
  %15 = load i32, ptr @GC_print_stats, align 4, !tbaa !5
  %.not19 = icmp eq i32 %15, 0
  br i1 %.not19, label %.preheader, label %16, !prof !11

16:                                               ; preds = %14
  tail call void (ptr, ...) @GC_log_printf(ptr noundef nonnull @.str) #7
  br label %.preheader

.preheader:                                       ; preds = %14, %16
  br label %17

17:                                               ; preds = %.preheader, %19
  %18 = tail call i32 %0() #7
  %.not20 = icmp eq i32 %18, 0
  br i1 %.not20, label %19, label %.loopexit

19:                                               ; preds = %17
  tail call void @GC_collect_a_little_inner(i32 noundef 1)
  %20 = tail call i32 @GC_collection_in_progress() #7
  %.not21 = icmp eq i32 %20, 0
  br i1 %.not21, label %.loopexit31, label %17, !llvm.loop !12

.loopexit31:                                      ; preds = %19, %12, %10
  tail call void @GC_notify_full_gc()
  %21 = load i32, ptr @GC_print_stats, align 4, !tbaa !5
  %22 = load i32, ptr @measure_performance, align 4, !tbaa !5
  %23 = or i32 %22, %21
  %.not22 = icmp eq i32 %23, 0
  br i1 %.not22, label %31, label %24

24:                                               ; preds = %.loopexit31
  %.not23 = icmp eq i32 %21, 0
  br i1 %.not23, label %26, label %25

25:                                               ; preds = %24
  tail call void (ptr, ...) @GC_log_printf(ptr noundef nonnull @.str.1) #7
  br label %26

26:                                               ; preds = %25, %24
  %27 = call i32 @clock_gettime(i32 noundef 1, ptr noundef nonnull %2) #7
  %28 = icmp eq i32 %27, -1
  br i1 %28, label %29, label %31

29:                                               ; preds = %26
  %30 = load ptr, ptr @GC_on_abort, align 8, !tbaa !9
  call void %30(ptr noundef nonnull @.str.2) #7
  call void @abort() #8
  unreachable

31:                                               ; preds = %26, %.loopexit31
  call void @GC_promote_black_lists() #7
  %32 = load i32, ptr @GC_find_leak, align 4, !tbaa !5
  %33 = icmp ne i32 %32, 0
  %34 = icmp ne ptr %0, @GC_never_stop_func
  %or.cond = or i1 %34, %33
  br i1 %or.cond, label %35, label %37

35:                                               ; preds = %31
  %36 = call i32 @GC_reclaim_all(ptr noundef %0, i32 noundef 0) #7
  %.not24 = icmp eq i32 %36, 0
  br i1 %.not24, label %.loopexit, label %37

37:                                               ; preds = %31, %35
  call void @GC_invalidate_mark_state() #7
  call void @GC_clear_marks() #7
  store i32 1, ptr @GC_is_full_gc, align 4, !tbaa !5
  %38 = call i32 @GC_stopped_mark(ptr noundef %0)
  %.not25 = icmp eq i32 %38, 0
  br i1 %.not25, label %39, label %42

39:                                               ; preds = %37
  %40 = load i32, ptr @GC_incremental, align 4, !tbaa !5
  %.not26 = icmp eq i32 %40, 0
  br i1 %.not26, label %41, label %.loopexit

41:                                               ; preds = %39
  call void @GC_invalidate_mark_state() #7
  call void @GC_unpromote_black_lists() #7
  br label %.loopexit

42:                                               ; preds = %37
  call void @GC_finish_collection()
  br i1 %.not22, label %77, label %43

43:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  %44 = call i32 @clock_gettime(i32 noundef 1, ptr noundef nonnull %3) #7
  %45 = icmp eq i32 %44, -1
  br i1 %45, label %46, label %48

46:                                               ; preds = %43
  %47 = load ptr, ptr @GC_on_abort, align 8, !tbaa !9
  call void %47(ptr noundef nonnull @.str.2) #7
  call void @abort() #8
  unreachable

48:                                               ; preds = %43
  %49 = getelementptr inbounds i8, ptr %3, i64 8
  %50 = load i64, ptr %49, align 8, !tbaa !14
  %51 = getelementptr inbounds i8, ptr %2, i64 8
  %52 = load i64, ptr %51, align 8, !tbaa !14
  %reass.sub = sub i64 %50, %52
  %53 = add i64 %reass.sub, 1000000000
  %54 = udiv i64 %53, 1000000
  %55 = load i64, ptr %3, align 8, !tbaa !17
  %56 = load i64, ptr %2, align 8, !tbaa !17
  %57 = sub nsw i64 %55, %56
  %58 = mul i64 %57, 1000
  %59 = add nsw i64 %54, -1000
  %60 = add i64 %59, %58
  %61 = urem i64 %53, 1000000
  %62 = load i32, ptr @measure_performance, align 4, !tbaa !5
  %.not28 = icmp eq i32 %62, 0
  br i1 %.not28, label %73, label %63

63:                                               ; preds = %48
  %64 = load i64, ptr @full_gc_total_time, align 8, !tbaa !18
  %65 = add i64 %64, %60
  store i64 %65, ptr @full_gc_total_time, align 8, !tbaa !18
  %66 = trunc nuw nsw i64 %61 to i32
  %67 = load i32, ptr @full_gc_total_ns_frac, align 4, !tbaa !5
  %68 = add i32 %67, %66
  store i32 %68, ptr @full_gc_total_ns_frac, align 4, !tbaa !5
  %69 = icmp ugt i32 %68, 999999
  br i1 %69, label %70, label %73

70:                                               ; preds = %63
  %71 = add i32 %68, -1000000
  store i32 %71, ptr @full_gc_total_ns_frac, align 4, !tbaa !5
  %72 = add i64 %65, 1
  store i64 %72, ptr @full_gc_total_time, align 8, !tbaa !18
  br label %73

73:                                               ; preds = %63, %70, %48
  %74 = load i32, ptr @GC_print_stats, align 4, !tbaa !5
  %.not29 = icmp eq i32 %74, 0
  br i1 %.not29, label %76, label %75

75:                                               ; preds = %73
  call void (ptr, ...) @GC_log_printf(ptr noundef nonnull @.str.3, i64 noundef %60, i64 noundef %61) #7
  br label %76

76:                                               ; preds = %75, %73
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  br label %77

77:                                               ; preds = %76, %42
  %78 = load ptr, ptr @GC_on_collection_event, align 8, !tbaa !9
  %.not30 = icmp eq ptr %78, null
  br i1 %.not30, label %.loopexit, label %79

79:                                               ; preds = %77
  call void %78(i32 noundef 5) #7
  br label %.loopexit

.loopexit:                                        ; preds = %17, %77, %79, %39, %41, %35, %1, %5
  %.0 = phi i32 [ 0, %5 ], [ 0, %1 ], [ 0, %35 ], [ 0, %41 ], [ 0, %39 ], [ 1, %79 ], [ 1, %77 ], [ 0, %17 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #7
  ret i32 %.0
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare i32 @GC_collection_in_progress() local_unnamed_addr #3

declare void @GC_log_printf(ptr noundef, ...) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @GC_notify_full_gc() local_unnamed_addr #4

; Function Attrs: nounwind
declare i32 @clock_gettime(i32 noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #6

declare void @GC_promote_black_lists() local_unnamed_addr #3

declare i32 @GC_reclaim_all(ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @GC_invalidate_mark_state() local_unnamed_addr #3

declare void @GC_clear_marks() local_unnamed_addr #3

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

declare void @GC_unpromote_black_lists() local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @GC_finish_collection() local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !16, i64 8}
!15 = !{!"timespec", !16, i64 0, !16, i64 8}
!16 = !{!"long", !7, i64 0}
!17 = !{!15, !16, i64 0}
!18 = !{!16, !16, i64 0}


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