; LLVM IR from knizhnik/cppgc :: samples (testgc)

; 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"

%"class.GC::MemoryAllocator" = type { i64, ptr, ptr, ptr, i64, i64 }
%"class.GC::Var" = type { %"class.GC::Root", ptr }
%"class.GC::Root" = type { ptr, ptr }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [36 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca %"class.GC::MemoryAllocator", align 8
  %10 = alloca %"class.GC::Var", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 1
  br i1 %17, label %18, label %23

18:                                               ; preds = %2
  %19 = load ptr, ptr %5, align 8, !tbaa !9
  %20 = getelementptr inbounds ptr, ptr %19, i64 1
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = call i32 @atoi(ptr noundef %21) #8
  br label %24

23:                                               ; preds = %2
  br label %24

24:                                               ; preds = %23, %18
  %25 = phi i32 [ %22, %18 ], [ 100, %23 ]
  store i32 %25, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = icmp sgt i32 %26, 2
  br i1 %27, label %28, label %33

28:                                               ; preds = %24
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  %30 = getelementptr inbounds ptr, ptr %29, i64 2
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = call i32 @atoi(ptr noundef %31) #8
  br label %34

33:                                               ; preds = %24
  br label %34

34:                                               ; preds = %33, %28
  %35 = phi i32 [ %32, %28 ], [ 15, %33 ]
  store i32 %35, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %36 = call i64 @time(ptr noundef null) #7
  store i64 %36, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 48, ptr %9) #7
  call void @_ZN2GC15MemoryAllocatorC1Emm(ptr noundef nonnull align 8 dereferenceable(48) %9, i64 noundef 1048576, i64 noundef 1048576)
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #7
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = invoke noundef ptr @_ZN2GC11ObjectArrayI4TreeE6createEm(i64 noundef %38)
          to label %40 unwind label %47

40:                                               ; preds = %34
  invoke void @_ZN2GC3VarINS_11ObjectArrayI4TreeEEEC2EPS3_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef %39)
          to label %41 unwind label %47

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %96, %41
  %43 = load i32, ptr %13, align 4, !tbaa !5
  %44 = load i32, ptr %7, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %51, label %46

46:                                               ; preds = %42
  store i32 2, ptr %14, align 4
  br label %99

47:                                               ; preds = %40, %34
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %11, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %12, align 4
  br label %110

51:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %90, %51
  %53 = load i32, ptr %15, align 4, !tbaa !5
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  store i32 5, ptr %14, align 4
  br label %93

57:                                               ; preds = %52
  %58 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN2GC3VarINS_11ObjectArrayI4TreeEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %59 unwind label %75

59:                                               ; preds = %57
  %60 = load i32, ptr %15, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN2GC11ObjectArrayI4TreeEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %61)
          to label %63 unwind label %75

63:                                               ; preds = %59
  %64 = load ptr, ptr %62, align 8, !tbaa !9
  %65 = load i32, ptr %13, align 4, !tbaa !5
  %66 = sub nsw i32 %65, 1
  %67 = sext i32 %66 to i64
  %68 = invoke noundef zeroext i1 @_ZN4Tree5checkEPS_m(ptr noundef %64, i64 noundef %67)
          to label %69 unwind label %75

69:                                               ; preds = %63
  br i1 %68, label %79, label %70

70:                                               ; preds = %69
  %71 = load ptr, ptr @stderr, align 8, !tbaa !9
  %72 = load i32, ptr %13, align 4, !tbaa !5
  %73 = load i32, ptr %15, align 4, !tbaa !5
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef @.str, i32 noundef %72, i32 noundef %73) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %93

75:                                               ; preds = %85, %83, %79, %63, %59, %57
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %11, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @_ZN2GC4RootD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  br label %110

79:                                               ; preds = %69
  %80 = load i32, ptr %13, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = invoke noundef ptr @_ZN4Tree5buildEm(i64 noundef %81)
          to label %83 unwind label %75

83:                                               ; preds = %79
  %84 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN2GC3VarINS_11ObjectArrayI4TreeEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %85 unwind label %75

85:                                               ; preds = %83
  %86 = load i32, ptr %15, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN2GC11ObjectArrayI4TreeEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %87)
          to label %89 unwind label %75

89:                                               ; preds = %85
  store ptr %82, ptr %88, align 8, !tbaa !9
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %15, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %15, align 4, !tbaa !5
  br label %52, !llvm.loop !13

93:                                               ; preds = %70, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  %94 = load i32, ptr %14, align 4
  switch i32 %94, label %99 [
    i32 5, label %95
  ]

95:                                               ; preds = %93
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %13, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %13, align 4, !tbaa !5
  br label %42, !llvm.loop !15

99:                                               ; preds = %93, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %100 = load i32, ptr %14, align 4
  switch i32 %100, label %102 [
    i32 2, label %101
  ]

101:                                              ; preds = %99
  store i32 0, ptr %14, align 4
  br label %102

102:                                              ; preds = %101, %99
  call void @_ZN2GC4RootD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #7
  call void @_ZN2GC15MemoryAllocatorD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #7
  %103 = load i32, ptr %14, align 4
  switch i32 %103, label %111 [
    i32 0, label %104
  ]

104:                                              ; preds = %102
  %105 = call i64 @time(ptr noundef null) #7
  %106 = load i64, ptr %8, align 8, !tbaa !11
  %107 = sub nsw i64 %105, %106
  %108 = trunc i64 %107 to i32
  %109 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %108)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %111

110:                                              ; preds = %75, %47
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #7
  call void @_ZN2GC15MemoryAllocatorD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %113

111:                                              ; preds = %104, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %112 = load i32, ptr %3, align 4
  ret i32 %112

113:                                              ; preds = %110
  %114 = load ptr, ptr %11, align 8
  %115 = load i32, ptr %12, align 4
  %116 = insertvalue { ptr, i32 } poison, ptr %114, 0
  %117 = insertvalue { ptr, i32 } %116, i32 %115, 1
  resume { ptr, i32 } %117
}

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

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #2

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #3

declare void @_ZN2GC15MemoryAllocatorC1Emm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef) unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN2GC11ObjectArrayI4TreeE6createEm(i64 noundef) #5 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2GC3VarINS_11ObjectArrayI4TreeEEEC2EPS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Tree5checkEPS_m(ptr noundef, i64 noundef) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN2GC3VarINS_11ObjectArrayI4TreeEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN2GC11ObjectArrayI4TreeEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #6 align 2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4Tree5buildEm(i64 noundef) #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2GC4RootD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #6 align 2

; Function Attrs: nounwind
declare void @_ZN2GC15MemoryAllocatorD1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3

declare i32 @printf(ptr noundef, ...) #4

attributes #0 = { mustprogress norecurse 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress nounwind willreturn memory(read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "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 = { "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 = { mustprogress 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 = { mustprogress 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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"

%"class.GC::MemoryAllocator" = type { i64, ptr, ptr, ptr, i64, i64 }
%"class.GC::Var" = type { %"class.GC::Root", ptr }
%"class.GC::Root" = type { ptr, ptr }

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [36 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.GC::MemoryAllocator", align 8
  %4 = alloca %"class.GC::Var", align 8
  %5 = icmp sgt i32 %0, 1
  br i1 %5, label %6, label %.thread

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %1, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = tail call i32 @atoi(ptr nocapture noundef %8) #8
  %.not35 = icmp eq i32 %0, 2
  br i1 %.not35, label %.thread, label %10

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %1, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = tail call i32 @atoi(ptr nocapture noundef %12) #8
  br label %.thread

.thread:                                          ; preds = %2, %6, %10
  %14 = phi i32 [ %9, %10 ], [ %9, %6 ], [ 100, %2 ]
  %15 = phi i32 [ %13, %10 ], [ 15, %6 ], [ 15, %2 ]
  %16 = tail call i64 @time(ptr noundef null) #9
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #9
  call void @_ZN2GC15MemoryAllocatorC1Emm(ptr noundef nonnull align 8 dereferenceable(48) %3, i64 noundef 1048576, i64 noundef 1048576)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #9
  %17 = sext i32 %14 to i64
  %18 = invoke noundef ptr @_ZN2GC11ObjectArrayI4TreeE6createEm(i64 noundef %17)
          to label %19 unwind label %34

19:                                               ; preds = %.thread
  invoke void @_ZN2GC3VarINS_11ObjectArrayI4TreeEEEC2EPS3_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef %18)
          to label %.preheader36 unwind label %34

.preheader36:                                     ; preds = %19
  %.not3146 = icmp sgt i32 %15, 1
  %.not44 = icmp sgt i32 %14, 0
  %or.cond = select i1 %.not3146, i1 %.not44, i1 false
  br i1 %or.cond, label %.preheader.us.preheader, label %.loopexit

.preheader.us.preheader:                          ; preds = %.preheader36
  %20 = zext nneg i32 %15 to i64
  %wide.trip.count64 = zext nneg i32 %15 to i64
  %wide.trip.count = zext nneg i32 %14 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %indvars.iv62 = phi i64 [ 1, %.preheader.us.preheader ], [ %indvars.iv.next63, %._crit_edge.us ]
  %.not3148.us = phi i1 [ true, %.preheader.us.preheader ], [ %.not31.us, %._crit_edge.us ]
  %21 = add nsw i64 %indvars.iv62, -1
  br label %22

22:                                               ; preds = %.preheader.us, %30
  %indvars.iv = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next, %30 ]
  %23 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN2GC3VarINS_11ObjectArrayI4TreeEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2GC11ObjectArrayI4TreeEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %indvars.iv)
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  %26 = invoke noundef zeroext i1 @_ZN4Tree5checkEPS_m(ptr noundef %25, i64 noundef %21)
          to label %27 unwind label %.split.us

27:                                               ; preds = %22
  br i1 %26, label %28, label %.thread33

28:                                               ; preds = %27
  %29 = invoke noundef ptr @_ZN4Tree5buildEm(i64 noundef %indvars.iv62)
          to label %30 unwind label %.split.us

30:                                               ; preds = %28
  %31 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN2GC3VarINS_11ObjectArrayI4TreeEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2GC11ObjectArrayI4TreeEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %indvars.iv)
  store ptr %29, ptr %32, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond61.not, label %._crit_edge.us, label %22, !llvm.loop !9

._crit_edge.us:                                   ; preds = %30
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %.not31.us = icmp ult i64 %indvars.iv.next63, %20
  %exitcond65.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count64
  br i1 %exitcond65.not, label %.loopexit, label %.preheader.us, !llvm.loop !11

.split.us:                                        ; preds = %28, %22
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2GC4RootD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #9
  br label %45

34:                                               ; preds = %19, %.thread
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %45

.thread33:                                        ; preds = %27
  %36 = trunc nuw nsw i64 %indvars.iv62 to i32
  %37 = trunc nuw nsw i64 %indvars.iv to i32
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str, i32 noundef %36, i32 noundef %37) #10
  br label %.loopexit

.loopexit:                                        ; preds = %._crit_edge.us, %.preheader36, %.thread33
  %.not3141 = phi i1 [ %.not3148.us, %.thread33 ], [ false, %.preheader36 ], [ %.not31.us, %._crit_edge.us ]
  %.2 = phi i32 [ 1, %.thread33 ], [ 0, %.preheader36 ], [ 0, %._crit_edge.us ]
  call void @_ZN2GC4RootD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #9
  call void @_ZN2GC15MemoryAllocatorD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #9
  br i1 %.not3141, label %46, label %40

40:                                               ; preds = %.loopexit
  %41 = call i64 @time(ptr noundef null) #9
  %42 = sub nsw i64 %41, %16
  %43 = trunc i64 %42 to i32
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %43)
  br label %46

45:                                               ; preds = %.split.us, %34
  %.pn = phi { ptr, i32 } [ %33, %.split.us ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #9
  call void @_ZN2GC15MemoryAllocatorD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #9
  resume { ptr, i32 } %.pn

46:                                               ; preds = %.loopexit, %40
  %.3 = phi i32 [ 0, %40 ], [ %.2, %.loopexit ]
  ret i32 %.3
}

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #2

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #3

declare void @_ZN2GC15MemoryAllocatorC1Emm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef) unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN2GC11ObjectArrayI4TreeE6createEm(i64 noundef) local_unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2GC3VarINS_11ObjectArrayI4TreeEEEC2EPS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Tree5checkEPS_m(ptr noundef, i64 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN2GC3VarINS_11ObjectArrayI4TreeEEEdeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN2GC11ObjectArrayI4TreeEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #6 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #7

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4Tree5buildEm(i64 noundef) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2GC4RootD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #6 align 2

; Function Attrs: nounwind
declare void @_ZN2GC15MemoryAllocatorD1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7

attributes #0 = { mustprogress norecurse 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "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 = { "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 = { mustprogress 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 = { mustprogress 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 #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind }
attributes #10 = { cold 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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass