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

; 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.obj_kind = type { ptr, ptr, i64, i32, i32 }
%struct.timespec = type { i64, i64 }
%struct.hblkhdr = type { ptr, ptr, ptr, i8, i8, i16, i64, i64, ptr, i64, [5 x i64] }

@GC_on_abort = external global ptr, align 8
@GC_obj_kinds = external global [16 x %struct.obj_kind], align 16
@GC_n_kinds = external global i32, align 4
@GC_print_stats = external global i32, align 4
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1
@GC_gc_no = external global i64, align 8
@.str.7 = external hidden unnamed_addr constant [47 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

declare ptr @GC_find_header(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @GC_reclaim_small_nonempty_block(ptr noundef, i64 noundef, i32 noundef) #4

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

17:                                               ; preds = %2
  br label %18

18:                                               ; preds = %17
  %19 = call i32 @clock_gettime(i32 noundef 1, ptr noundef %12) #6
  %20 = icmp eq i32 %19, -1
  br i1 %20, label %21, label %23

21:                                               ; preds = %18
  %22 = load ptr, ptr @GC_on_abort, align 8, !tbaa !5
  call void %22(ptr noundef @.str.6)
  call void @abort() #7
  unreachable

23:                                               ; preds = %18
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %25, %2
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %88, %26
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = load i32, ptr @GC_n_kinds, align 4, !tbaa !9
  %30 = icmp ult i32 %28, %29
  br i1 %30, label %31, label %91

31:                                               ; preds = %27
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds [16 x %struct.obj_kind], ptr @GC_obj_kinds, i64 0, i64 %33
  %35 = getelementptr inbounds %struct.obj_kind, ptr %34, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  store ptr %36, ptr %10, align 8, !tbaa !5
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %40

39:                                               ; preds = %31
  br label %88

40:                                               ; preds = %31
  store i64 1, ptr %6, align 8, !tbaa !14
  br label %41

41:                                               ; preds = %84, %40
  %42 = load i64, ptr %6, align 8, !tbaa !14
  %43 = icmp ule i64 %42, 128
  br i1 %43, label %44, label %87

44:                                               ; preds = %41
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = load i64, ptr %6, align 8, !tbaa !14
  %47 = getelementptr inbounds ptr, ptr %45, i64 %46
  store ptr %47, ptr %11, align 8, !tbaa !5
  br label %48

48:                                               ; preds = %82, %44
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  store ptr %50, ptr %9, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %83

52:                                               ; preds = %48
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %60

55:                                               ; preds = %52
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = call i32 %56()
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %55
  store i32 0, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %126

60:                                               ; preds = %55, %52
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = call ptr @GC_find_header(ptr noundef %61)
  store ptr %62, ptr %8, align 8, !tbaa !5
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.hblkhdr, ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !15
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %65, ptr %66, align 8, !tbaa !5
  %67 = load i32, ptr %5, align 4, !tbaa !9
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %77

69:                                               ; preds = %60
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.hblkhdr, ptr %70, i32 0, i32 5
  %72 = load i16, ptr %71, align 2, !tbaa !18
  %73 = zext i16 %72 to i64
  %74 = load i64, ptr @GC_gc_no, align 8, !tbaa !14
  %75 = sub i64 %74, 1
  %76 = icmp eq i64 %73, %75
  br i1 %76, label %77, label %82

77:                                               ; preds = %69, %60
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.hblkhdr, ptr %79, i32 0, i32 6
  %81 = load i64, ptr %80, align 8, !tbaa !19
  call void @GC_reclaim_small_nonempty_block(ptr noundef %78, i64 noundef %81, i32 noundef 0)
  br label %82

82:                                               ; preds = %77, %69
  br label %48, !llvm.loop !20

83:                                               ; preds = %48
  br label %84

84:                                               ; preds = %83
  %85 = load i64, ptr %6, align 8, !tbaa !14
  %86 = add i64 %85, 1
  store i64 %86, ptr %6, align 8, !tbaa !14
  br label %41, !llvm.loop !22

87:                                               ; preds = %41
  br label %88

88:                                               ; preds = %87, %39
  %89 = load i32, ptr %7, align 4, !tbaa !9
  %90 = add i32 %89, 1
  store i32 %90, ptr %7, align 4, !tbaa !9
  br label %27, !llvm.loop !23

91:                                               ; preds = %27
  %92 = load i32, ptr @GC_print_stats, align 4, !tbaa !9
  %93 = icmp eq i32 %92, 2
  br i1 %93, label %94, label %125

94:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  br label %95

95:                                               ; preds = %94
  %96 = call i32 @clock_gettime(i32 noundef 1, ptr noundef %14) #6
  %97 = icmp eq i32 %96, -1
  br i1 %97, label %98, label %100

98:                                               ; preds = %95
  %99 = load ptr, ptr @GC_on_abort, align 8, !tbaa !5
  call void %99(ptr noundef @.str.6)
  call void @abort() #7
  unreachable

100:                                              ; preds = %95
  br label %101

101:                                              ; preds = %100
  br label %102

102:                                              ; preds = %101
  %103 = getelementptr inbounds %struct.timespec, ptr %14, i32 0, i32 1
  %104 = load i64, ptr %103, align 8, !tbaa !24
  %105 = getelementptr inbounds %struct.timespec, ptr %12, i32 0, i32 1
  %106 = load i64, ptr %105, align 8, !tbaa !24
  %107 = sub nsw i64 1000000000, %106
  %108 = add nsw i64 %104, %107
  %109 = udiv i64 %108, 1000000
  %110 = getelementptr inbounds %struct.timespec, ptr %14, i32 0, i32 0
  %111 = load i64, ptr %110, align 8, !tbaa !26
  %112 = getelementptr inbounds %struct.timespec, ptr %12, i32 0, i32 0
  %113 = load i64, ptr %112, align 8, !tbaa !26
  %114 = sub nsw i64 %111, %113
  %115 = mul i64 %114, 1000
  %116 = add i64 %109, %115
  %117 = sub i64 %116, 1000
  %118 = getelementptr inbounds %struct.timespec, ptr %14, i32 0, i32 1
  %119 = load i64, ptr %118, align 8, !tbaa !24
  %120 = getelementptr inbounds %struct.timespec, ptr %12, i32 0, i32 1
  %121 = load i64, ptr %120, align 8, !tbaa !24
  %122 = sub nsw i64 1000000000, %121
  %123 = add nsw i64 %119, %122
  %124 = urem i64 %123, 1000000
  call void (ptr, ...) @GC_log_printf(ptr noundef @.str.7, i64 noundef %117, i64 noundef %124)
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  br label %125

125:                                              ; preds = %102, %91
  store i32 1, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %126

126:                                              ; preds = %125, %59
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %127 = load i32, ptr %3, align 4
  ret i32 %127
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { "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 "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 }
attributes #7 = { 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 = !{!12, !6, i64 8}
!12 = !{!"obj_kind", !6, i64 0, !6, i64 8, !13, i64 16, !10, i64 24, !10, i64 28}
!13 = !{!"long", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"hblkhdr", !6, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !7, i64 25, !17, i64 26, !13, i64 32, !13, i64 40, !6, i64 48, !13, i64 56, !7, i64 64}
!17 = !{!"short", !7, i64 0}
!18 = !{!16, !17, i64 26}
!19 = !{!16, !13, i64 32}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}
!24 = !{!25, !13, i64 8}
!25 = !{!"timespec", !13, i64 0, !13, i64 8}
!26 = !{!25, !13, 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.obj_kind = type { ptr, ptr, i64, i32, i32 }
%struct.timespec = type { i64, i64 }

@GC_on_abort = external local_unnamed_addr global ptr, align 8
@GC_obj_kinds = external local_unnamed_addr global [16 x %struct.obj_kind], align 16
@GC_n_kinds = external local_unnamed_addr global i32, align 4
@GC_print_stats = external local_unnamed_addr global i32, align 4
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1
@GC_gc_no = external local_unnamed_addr global i64, align 8
@.str.7 = external hidden unnamed_addr constant [47 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

declare ptr @GC_find_header(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @GC_reclaim_small_nonempty_block(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #4

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

7:                                                ; preds = %2
  %8 = call i32 @clock_gettime(i32 noundef 1, ptr noundef nonnull %3) #6
  %9 = icmp eq i32 %8, -1
  br i1 %9, label %10, label %12

10:                                               ; preds = %7
  %11 = load ptr, ptr @GC_on_abort, align 8, !tbaa !9
  call void %11(ptr noundef nonnull @.str.6) #6
  call void @abort() #7
  unreachable

12:                                               ; preds = %7, %2
  %13 = load i32, ptr @GC_n_kinds, align 4, !tbaa !5
  %.not47 = icmp eq i32 %13, 0
  br i1 %.not47, label %._crit_edge, label %.lr.ph37

.lr.ph37:                                         ; preds = %12
  %.not23 = icmp eq ptr %0, null
  %.not25 = icmp eq i32 %1, 0
  br i1 %.not25, label %.lr.ph37.split.us, label %.lr.ph37.split

.lr.ph37.split.us:                                ; preds = %.lr.ph37
  br i1 %.not23, label %.lr.ph37.split.us.split.us, label %.lr.ph37.split.us.split

.lr.ph37.split.us.split.us:                       ; preds = %.lr.ph37.split.us, %.loopexit26.split.us.split.us.us.us
  %14 = phi i32 [ %18, %.loopexit26.split.us.split.us.us.us ], [ %13, %.lr.ph37.split.us ]
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %.loopexit26.split.us.split.us.us.us ], [ 0, %.lr.ph37.split.us ]
  %15 = getelementptr inbounds [16 x %struct.obj_kind], ptr @GC_obj_kinds, i64 0, i64 %indvars.iv62, i32 1
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = icmp eq ptr %16, null
  br i1 %17, label %.loopexit26.split.us.split.us.us.us, label %.preheader.us.us

.loopexit26.split.us.split.us.us.us.loopexit:     ; preds = %._crit_edge.split.us.split.us.us.us.us.us
  %.pre69 = load i32, ptr @GC_n_kinds, align 4, !tbaa !5
  br label %.loopexit26.split.us.split.us.us.us

.loopexit26.split.us.split.us.us.us:              ; preds = %.loopexit26.split.us.split.us.us.us.loopexit, %.lr.ph37.split.us.split.us
  %18 = phi i32 [ %.pre69, %.loopexit26.split.us.split.us.us.us.loopexit ], [ %14, %.lr.ph37.split.us.split.us ]
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %19 = zext i32 %18 to i64
  %20 = icmp ult i64 %indvars.iv.next63, %19
  br i1 %20, label %.lr.ph37.split.us.split.us, label %._crit_edge, !llvm.loop !14

.preheader.us.us:                                 ; preds = %.lr.ph37.split.us.split.us, %._crit_edge.split.us.split.us.us.us.us.us
  %.01829.us.us.us.us = phi i64 [ %23, %._crit_edge.split.us.split.us.us.us.us.us ], [ 1, %.lr.ph37.split.us.split.us ]
  %21 = getelementptr inbounds ptr, ptr %16, i64 %.01829.us.us.us.us
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %.not27.us.us.us.us = icmp eq ptr %22, null
  br i1 %.not27.us.us.us.us, label %._crit_edge.split.us.split.us.us.us.us.us, label %.lr.ph.us.us.us.us

._crit_edge.split.us.split.us.us.us.us.us:        ; preds = %.lr.ph.us.us.us.us, %.preheader.us.us
  %23 = add nuw nsw i64 %.01829.us.us.us.us, 1
  %exitcond61.not = icmp eq i64 %23, 129
  br i1 %exitcond61.not, label %.loopexit26.split.us.split.us.us.us.loopexit, label %.preheader.us.us, !llvm.loop !16

.lr.ph.us.us.us.us:                               ; preds = %.preheader.us.us, %.lr.ph.us.us.us.us
  %24 = phi ptr [ %29, %.lr.ph.us.us.us.us ], [ %22, %.preheader.us.us ]
  %25 = call ptr @GC_find_header(ptr noundef nonnull %24) #6
  %26 = load ptr, ptr %25, align 8, !tbaa !17
  store ptr %26, ptr %21, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %25, i64 32
  %28 = load i64, ptr %27, align 8, !tbaa !20
  call void @GC_reclaim_small_nonempty_block(ptr noundef nonnull %24, i64 noundef %28, i32 noundef 0)
  %29 = load ptr, ptr %21, align 8, !tbaa !9
  %.not.us.us.us.us.us.us = icmp eq ptr %29, null
  br i1 %.not.us.us.us.us.us.us, label %._crit_edge.split.us.split.us.us.us.us.us, label %.lr.ph.us.us.us.us, !llvm.loop !21

.lr.ph37.split.us.split:                          ; preds = %.lr.ph37.split.us, %.loopexit26.split.us.split.us41
  %30 = phi i32 [ %34, %.loopexit26.split.us.split.us41 ], [ %13, %.lr.ph37.split.us ]
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %.loopexit26.split.us.split.us41 ], [ 0, %.lr.ph37.split.us ]
  %31 = getelementptr inbounds [16 x %struct.obj_kind], ptr @GC_obj_kinds, i64 0, i64 %indvars.iv58, i32 1
  %32 = load ptr, ptr %31, align 8, !tbaa !11
  %33 = icmp eq ptr %32, null
  br i1 %33, label %.loopexit26.split.us.split.us41, label %.preheader.us

.loopexit26.split.us.split.us41.loopexit:         ; preds = %._crit_edge.split.us.split.us31.us
  %.pre68 = load i32, ptr @GC_n_kinds, align 4, !tbaa !5
  br label %.loopexit26.split.us.split.us41

.loopexit26.split.us.split.us41:                  ; preds = %.loopexit26.split.us.split.us41.loopexit, %.lr.ph37.split.us.split
  %34 = phi i32 [ %.pre68, %.loopexit26.split.us.split.us41.loopexit ], [ %30, %.lr.ph37.split.us.split ]
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %35 = zext i32 %34 to i64
  %36 = icmp ult i64 %indvars.iv.next59, %35
  br i1 %36, label %.lr.ph37.split.us.split, label %._crit_edge, !llvm.loop !14

.preheader.us:                                    ; preds = %.lr.ph37.split.us.split, %._crit_edge.split.us.split.us31.us
  %.01829.us.us38 = phi i64 [ %39, %._crit_edge.split.us.split.us31.us ], [ 1, %.lr.ph37.split.us.split ]
  %37 = getelementptr inbounds ptr, ptr %32, i64 %.01829.us.us38
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %.not27.us.us39 = icmp eq ptr %38, null
  br i1 %.not27.us.us39, label %._crit_edge.split.us.split.us31.us, label %.lr.ph.us.us40

._crit_edge.split.us.split.us31.us:               ; preds = %42, %.preheader.us
  %39 = add nuw nsw i64 %.01829.us.us38, 1
  %exitcond57.not = icmp eq i64 %39, 129
  br i1 %exitcond57.not, label %.loopexit26.split.us.split.us41.loopexit, label %.preheader.us, !llvm.loop !16

.lr.ph.us.us40:                                   ; preds = %.preheader.us, %42
  %40 = phi ptr [ %47, %42 ], [ %38, %.preheader.us ]
  %41 = call i32 %0() #6
  %.not24.us.us.us = icmp eq i32 %41, 0
  br i1 %.not24.us.us.us, label %42, label %.loopexit

42:                                               ; preds = %.lr.ph.us.us40
  %43 = call ptr @GC_find_header(ptr noundef nonnull %40) #6
  %44 = load ptr, ptr %43, align 8, !tbaa !17
  store ptr %44, ptr %37, align 8, !tbaa !9
  %45 = getelementptr inbounds i8, ptr %43, i64 32
  %46 = load i64, ptr %45, align 8, !tbaa !20
  call void @GC_reclaim_small_nonempty_block(ptr noundef nonnull %40, i64 noundef %46, i32 noundef 0)
  %47 = load ptr, ptr %37, align 8, !tbaa !9
  %.not.us.us30.us = icmp eq ptr %47, null
  br i1 %.not.us.us30.us, label %._crit_edge.split.us.split.us31.us, label %.lr.ph.us.us40, !llvm.loop !21

.lr.ph37.split:                                   ; preds = %.lr.ph37
  br i1 %.not23, label %.lr.ph37.split.split.us, label %.lr.ph37.split.split

.lr.ph37.split.split.us:                          ; preds = %.lr.ph37.split, %.loopexit26.split.split.us.us
  %48 = phi i32 [ %52, %.loopexit26.split.split.us.us ], [ %13, %.lr.ph37.split ]
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %.loopexit26.split.split.us.us ], [ 0, %.lr.ph37.split ]
  %49 = getelementptr inbounds [16 x %struct.obj_kind], ptr @GC_obj_kinds, i64 0, i64 %indvars.iv54, i32 1
  %50 = load ptr, ptr %49, align 8, !tbaa !11
  %51 = icmp eq ptr %50, null
  br i1 %51, label %.loopexit26.split.split.us.us, label %.preheader.us44

.loopexit26.split.split.us.us.loopexit:           ; preds = %._crit_edge.split.split.us.us.us
  %.pre67 = load i32, ptr @GC_n_kinds, align 4, !tbaa !5
  br label %.loopexit26.split.split.us.us

.loopexit26.split.split.us.us:                    ; preds = %.loopexit26.split.split.us.us.loopexit, %.lr.ph37.split.split.us
  %52 = phi i32 [ %.pre67, %.loopexit26.split.split.us.us.loopexit ], [ %48, %.lr.ph37.split.split.us ]
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %53 = zext i32 %52 to i64
  %54 = icmp ult i64 %indvars.iv.next55, %53
  br i1 %54, label %.lr.ph37.split.split.us, label %._crit_edge, !llvm.loop !14

.preheader.us44:                                  ; preds = %.lr.ph37.split.split.us, %._crit_edge.split.split.us.us.us
  %.01829.us33.us = phi i64 [ %57, %._crit_edge.split.split.us.us.us ], [ 1, %.lr.ph37.split.split.us ]
  %55 = getelementptr inbounds ptr, ptr %50, i64 %.01829.us33.us
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  %.not27.us34.us = icmp eq ptr %56, null
  br i1 %.not27.us34.us, label %._crit_edge.split.split.us.us.us, label %.lr.ph.us35.us

._crit_edge.split.split.us.us.us:                 ; preds = %70, %.preheader.us44
  %57 = add nuw nsw i64 %.01829.us33.us, 1
  %exitcond53.not = icmp eq i64 %57, 129
  br i1 %exitcond53.not, label %.loopexit26.split.split.us.us.loopexit, label %.preheader.us44, !llvm.loop !16

.lr.ph.us35.us:                                   ; preds = %.preheader.us44, %70
  %58 = phi ptr [ %71, %70 ], [ %56, %.preheader.us44 ]
  %59 = call ptr @GC_find_header(ptr noundef nonnull %58) #6
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  store ptr %60, ptr %55, align 8, !tbaa !9
  %61 = getelementptr inbounds i8, ptr %59, i64 26
  %62 = load i16, ptr %61, align 2, !tbaa !22
  %63 = zext i16 %62 to i64
  %64 = load i64, ptr @GC_gc_no, align 8, !tbaa !23
  %65 = add i64 %64, -1
  %66 = icmp eq i64 %65, %63
  br i1 %66, label %67, label %70

67:                                               ; preds = %.lr.ph.us35.us
  %68 = getelementptr inbounds i8, ptr %59, i64 32
  %69 = load i64, ptr %68, align 8, !tbaa !20
  call void @GC_reclaim_small_nonempty_block(ptr noundef nonnull %58, i64 noundef %69, i32 noundef 0)
  %.pre66 = load ptr, ptr %55, align 8, !tbaa !9
  br label %70

70:                                               ; preds = %67, %.lr.ph.us35.us
  %71 = phi ptr [ %.pre66, %67 ], [ %60, %.lr.ph.us35.us ]
  %.not.us28.us.us = icmp eq ptr %71, null
  br i1 %.not.us28.us.us, label %._crit_edge.split.split.us.us.us, label %.lr.ph.us35.us, !llvm.loop !21

.lr.ph37.split.split:                             ; preds = %.lr.ph37.split, %.loopexit26.split.split
  %72 = phi i32 [ %95, %.loopexit26.split.split ], [ %13, %.lr.ph37.split ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.loopexit26.split.split ], [ 0, %.lr.ph37.split ]
  %73 = getelementptr inbounds [16 x %struct.obj_kind], ptr @GC_obj_kinds, i64 0, i64 %indvars.iv, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !11
  %75 = icmp eq ptr %74, null
  br i1 %75, label %.loopexit26.split.split, label %.preheader

.preheader:                                       ; preds = %.lr.ph37.split.split, %._crit_edge.split.split
  %.01829 = phi i64 [ %94, %._crit_edge.split.split ], [ 1, %.lr.ph37.split.split ]
  %76 = getelementptr inbounds ptr, ptr %74, i64 %.01829
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %.not27 = icmp eq ptr %77, null
  br i1 %.not27, label %._crit_edge.split.split, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %92
  %78 = phi ptr [ %93, %92 ], [ %77, %.preheader ]
  %79 = call i32 %0() #6
  %.not24 = icmp eq i32 %79, 0
  br i1 %.not24, label %80, label %.loopexit

80:                                               ; preds = %.lr.ph
  %81 = call ptr @GC_find_header(ptr noundef nonnull %78) #6
  %82 = load ptr, ptr %81, align 8, !tbaa !17
  store ptr %82, ptr %76, align 8, !tbaa !9
  %83 = getelementptr inbounds i8, ptr %81, i64 26
  %84 = load i16, ptr %83, align 2, !tbaa !22
  %85 = zext i16 %84 to i64
  %86 = load i64, ptr @GC_gc_no, align 8, !tbaa !23
  %87 = add i64 %86, -1
  %88 = icmp eq i64 %87, %85
  br i1 %88, label %89, label %92

89:                                               ; preds = %80
  %90 = getelementptr inbounds i8, ptr %81, i64 32
  %91 = load i64, ptr %90, align 8, !tbaa !20
  call void @GC_reclaim_small_nonempty_block(ptr noundef nonnull %78, i64 noundef %91, i32 noundef 0)
  %.pre = load ptr, ptr %76, align 8, !tbaa !9
  br label %92

92:                                               ; preds = %89, %80
  %93 = phi ptr [ %.pre, %89 ], [ %82, %80 ]
  %.not = icmp eq ptr %93, null
  br i1 %.not, label %._crit_edge.split.split, label %.lr.ph, !llvm.loop !21

._crit_edge.split.split:                          ; preds = %92, %.preheader
  %94 = add nuw nsw i64 %.01829, 1
  %exitcond.not = icmp eq i64 %94, 129
  br i1 %exitcond.not, label %.loopexit26.split.split.loopexit, label %.preheader, !llvm.loop !16

.loopexit26.split.split.loopexit:                 ; preds = %._crit_edge.split.split
  %.pre65 = load i32, ptr @GC_n_kinds, align 4, !tbaa !5
  br label %.loopexit26.split.split

.loopexit26.split.split:                          ; preds = %.loopexit26.split.split.loopexit, %.lr.ph37.split.split
  %95 = phi i32 [ %.pre65, %.loopexit26.split.split.loopexit ], [ %72, %.lr.ph37.split.split ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %96 = zext i32 %95 to i64
  %97 = icmp ult i64 %indvars.iv.next, %96
  br i1 %97, label %.lr.ph37.split.split, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %.loopexit26.split.split, %.loopexit26.split.split.us.us, %.loopexit26.split.us.split.us41, %.loopexit26.split.us.split.us.us.us, %12
  %98 = load i32, ptr @GC_print_stats, align 4, !tbaa !5
  %99 = icmp eq i32 %98, 2
  br i1 %99, label %100, label %.loopexit

100:                                              ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  %101 = call i32 @clock_gettime(i32 noundef 1, ptr noundef nonnull %4) #6
  %102 = icmp eq i32 %101, -1
  br i1 %102, label %103, label %105

103:                                              ; preds = %100
  %104 = load ptr, ptr @GC_on_abort, align 8, !tbaa !9
  call void %104(ptr noundef nonnull @.str.6) #6
  call void @abort() #7
  unreachable

105:                                              ; preds = %100
  %106 = getelementptr inbounds i8, ptr %4, i64 8
  %107 = load i64, ptr %106, align 8, !tbaa !24
  %108 = getelementptr inbounds i8, ptr %3, i64 8
  %109 = load i64, ptr %108, align 8, !tbaa !24
  %reass.sub = sub i64 %107, %109
  %110 = add i64 %reass.sub, 1000000000
  %111 = udiv i64 %110, 1000000
  %112 = load i64, ptr %4, align 8, !tbaa !26
  %113 = load i64, ptr %3, align 8, !tbaa !26
  %114 = sub nsw i64 %112, %113
  %115 = mul i64 %114, 1000
  %116 = add nsw i64 %111, -1000
  %117 = add i64 %116, %115
  %118 = urem i64 %110, 1000000
  call void (ptr, ...) @GC_log_printf(ptr noundef nonnull @.str.7, i64 noundef %117, i64 noundef %118) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %.lr.ph.us.us40, %._crit_edge, %105
  %.0 = phi i32 [ 1, %105 ], [ 1, %._crit_edge ], [ 0, %.lr.ph.us.us40 ], [ 0, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  ret i32 %.0
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { "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 "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 }
attributes #7 = { 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 = !{!12, !10, i64 8}
!12 = !{!"obj_kind", !10, i64 0, !10, i64 8, !13, i64 16, !6, i64 24, !6, i64 28}
!13 = !{!"long", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{!18, !10, i64 0}
!18 = !{!"hblkhdr", !10, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !7, i64 25, !19, i64 26, !13, i64 32, !13, i64 40, !10, i64 48, !13, i64 56, !7, i64 64}
!19 = !{!"short", !7, i64 0}
!20 = !{!18, !13, i64 32}
!21 = distinct !{!21, !15}
!22 = !{!18, !19, i64 26}
!23 = !{!13, !13, i64 0}
!24 = !{!25, !13, i64 8}
!25 = !{!"timespec", !13, i64 0, !13, i64 8}
!26 = !{!25, !13, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass