; LLVM IR from google/rune :: benchmarks (binary_trees)

; 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.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }

@.str = external hidden unnamed_addr constant [36 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [39 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 i32, align 4
  %9 = alloca %"class.std::unique_ptr", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::unique_ptr", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"class.std::unique_ptr", align 8
  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) #6
  store i32 4, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 10, ptr %7, align 4, !tbaa !5
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 1
  br i1 %20, label %21, label %26

21:                                               ; preds = %2
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 1
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = call i32 @atoi(ptr noundef %24) #7
  store i32 %25, ptr %7, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %21, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %27 = load i32, ptr %7, align 4, !tbaa !5
  %28 = add i32 %27, 1
  store i32 %28, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %29 = load i32, ptr %8, align 4, !tbaa !5
  call void @_ZN4Node8makeTreeEj(ptr dead_on_unwind writable sret(%"class.std::unique_ptr") align 8 %9, i32 noundef %29)
  %30 = load i32, ptr %8, align 4, !tbaa !5
  %31 = call noundef ptr @_ZNKSt10unique_ptrI4NodeSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %32 = invoke noundef i32 @_ZN4Node5checkEv(ptr noundef nonnull align 8 dereferenceable(16) %31)
          to label %33 unwind label %46

33:                                               ; preds = %26
  %34 = invoke i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %30, i32 noundef %32)
          to label %35 unwind label %46

35:                                               ; preds = %33
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EE5resetEPS0_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef null) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %36 = load i32, ptr %7, align 4, !tbaa !5
  invoke void @_ZN4Node8makeTreeEj(ptr dead_on_unwind writable sret(%"class.std::unique_ptr") align 8 %12, i32 noundef %36)
          to label %37 unwind label %50

37:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = shl i32 1, %38
  store i32 %39, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %40 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %40, ptr %14, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %89, %37
  %42 = load i32, ptr %14, align 4, !tbaa !5
  %43 = load i32, ptr %8, align 4, !tbaa !5
  %44 = icmp ult i32 %42, %43
  br i1 %44, label %54, label %45

45:                                               ; preds = %41
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %97

46:                                               ; preds = %33, %26
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %10, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %11, align 4
  br label %111

50:                                               ; preds = %35
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %10, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %11, align 4
  br label %110

54:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %69, %54
  %56 = load i32, ptr %17, align 4, !tbaa !5
  %57 = load i32, ptr %13, align 4, !tbaa !5
  %58 = add i32 %57, 1
  %59 = icmp ult i32 %56, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %55
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %81

61:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %62 = load i32, ptr %14, align 4, !tbaa !5
  invoke void @_ZN4Node8makeTreeEj(ptr dead_on_unwind writable sret(%"class.std::unique_ptr") align 8 %18, i32 noundef %62)
          to label %63 unwind label %72

63:                                               ; preds = %61
  %64 = call noundef ptr @_ZNKSt10unique_ptrI4NodeSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  %65 = invoke noundef i32 @_ZN4Node5checkEv(ptr noundef nonnull align 8 dereferenceable(16) %64)
          to label %66 unwind label %76

66:                                               ; preds = %63
  %67 = load i32, ptr %16, align 4, !tbaa !5
  %68 = add i32 %67, %65
  store i32 %68, ptr %16, align 4, !tbaa !5
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EE5resetEPS0_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef null) #6
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %69

69:                                               ; preds = %66
  %70 = load i32, ptr %17, align 4, !tbaa !5
  %71 = add i32 %70, 1
  store i32 %71, ptr %17, align 4, !tbaa !5
  br label %55, !llvm.loop !11

72:                                               ; preds = %61
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %10, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %11, align 4
  br label %80

76:                                               ; preds = %63
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %10, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %11, align 4
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  br label %80

80:                                               ; preds = %76, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %96

81:                                               ; preds = %60
  %82 = load i32, ptr %13, align 4, !tbaa !5
  %83 = load i32, ptr %14, align 4, !tbaa !5
  %84 = load i32, ptr %16, align 4, !tbaa !5
  %85 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %82, i32 noundef %83, i32 noundef %84)
          to label %86 unwind label %92

86:                                               ; preds = %81
  %87 = load i32, ptr %13, align 4, !tbaa !5
  %88 = lshr i32 %87, 2
  store i32 %88, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %89

89:                                               ; preds = %86
  %90 = load i32, ptr %14, align 4, !tbaa !5
  %91 = add i32 %90, 2
  store i32 %91, ptr %14, align 4, !tbaa !5
  br label %41, !llvm.loop !13

92:                                               ; preds = %81
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %10, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %11, align 4
  br label %96

96:                                               ; preds = %92, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %109

97:                                               ; preds = %45
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = call noundef ptr @_ZNKSt10unique_ptrI4NodeSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %100 = invoke noundef i32 @_ZN4Node5checkEv(ptr noundef nonnull align 8 dereferenceable(16) %99)
          to label %101 unwind label %105

101:                                              ; preds = %97
  %102 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %98, i32 noundef %100)
          to label %103 unwind label %105

103:                                              ; preds = %101
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %104 = load i32, ptr %3, align 4
  ret i32 %104

105:                                              ; preds = %101, %97
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %10, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %11, align 4
  br label %109

109:                                              ; preds = %105, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  br label %110

110:                                              ; preds = %109, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %111

111:                                              ; preds = %110, %46
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %112

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

; 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: mustprogress uwtable
declare dso_local void @_ZN4Node8makeTreeEj(ptr dead_on_unwind noalias writable sret(%"class.std::unique_ptr") align 8, i32 noundef) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN4Node5checkEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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 = { 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 #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 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 }
attributes #7 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }

@.str = external hidden unnamed_addr constant [36 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [39 x i8], align 1

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

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

11:                                               ; preds = %7, %2
  %.031 = phi i32 [ %10, %7 ], [ 10, %2 ]
  %12 = add i32 %.031, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  call void @_ZN4Node8makeTreeEj(ptr dead_on_unwind nonnull writable sret(%"class.std::unique_ptr") align 8 %3, i32 noundef %12)
  %13 = call noundef ptr @_ZNKSt10unique_ptrI4NodeSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %14 = invoke noundef i32 @_ZN4Node5checkEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %15 unwind label %24

15:                                               ; preds = %11
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12, i32 noundef %14)
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EE5resetEPS0_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef null) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  invoke void @_ZN4Node8makeTreeEj(ptr dead_on_unwind nonnull writable sret(%"class.std::unique_ptr") align 8 %4, i32 noundef %.031)
          to label %17 unwind label %26

17:                                               ; preds = %15
  %18 = icmp ugt i32 %12, 4
  br i1 %18, label %.preheader.preheader, label %._crit_edge42

.preheader.preheader:                             ; preds = %17
  %19 = shl nuw i32 1, %.031
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %.02441 = phi i32 [ %30, %._crit_edge ], [ 4, %.preheader.preheader ]
  %.02540 = phi i32 [ %29, %._crit_edge ], [ %19, %.preheader.preheader ]
  %20 = add i32 %.02540, -1
  %21 = icmp ult i32 %20, -2
  br i1 %21, label %.lr.ph, label %._crit_edge

._crit_edge42:                                    ; preds = %._crit_edge, %17
  %22 = call noundef ptr @_ZNKSt10unique_ptrI4NodeSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %23 = invoke noundef i32 @_ZN4Node5checkEv(ptr noundef nonnull align 8 dereferenceable(16) %22)
          to label %43 unwind label %45

24:                                               ; preds = %11
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %49

26:                                               ; preds = %15
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %48

._crit_edge:                                      ; preds = %35, %.preheader
  %.023.lcssa = phi i32 [ 0, %.preheader ], [ %36, %35 ]
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.02540, i32 noundef %.02441, i32 noundef %.023.lcssa)
  %29 = lshr i32 %.02540, 2
  %30 = add i32 %.02441, 2
  %31 = icmp ult i32 %30, %12
  br i1 %31, label %.preheader, label %._crit_edge42, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader, %35
  %.039 = phi i32 [ %37, %35 ], [ 1, %.preheader ]
  %.02338 = phi i32 [ %36, %35 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  invoke void @_ZN4Node8makeTreeEj(ptr dead_on_unwind nonnull writable sret(%"class.std::unique_ptr") align 8 %5, i32 noundef %.02441)
          to label %32 unwind label %38

32:                                               ; preds = %.lr.ph
  %33 = call noundef ptr @_ZNKSt10unique_ptrI4NodeSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %34 = invoke noundef i32 @_ZN4Node5checkEv(ptr noundef nonnull align 8 dereferenceable(16) %33)
          to label %35 unwind label %40

35:                                               ; preds = %32
  %36 = add i32 %34, %.02338
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EE5resetEPS0_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef null) #7
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %37 = add nuw i32 %.039, 1
  %exitcond.not = icmp eq i32 %.039, %.02540
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

38:                                               ; preds = %.lr.ph
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %42

40:                                               ; preds = %32
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  br label %42

42:                                               ; preds = %40, %38
  %.pn = phi { ptr, i32 } [ %41, %40 ], [ %39, %38 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %47

43:                                               ; preds = %._crit_edge42
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.031, i32 noundef %23)
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  ret i32 0

45:                                               ; preds = %._crit_edge42
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %47

47:                                               ; preds = %45, %42
  %.pn.pn = phi { ptr, i32 } [ %.pn, %42 ], [ %46, %45 ]
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br label %48

48:                                               ; preds = %47, %26
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %47 ], [ %27, %26 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %49

49:                                               ; preds = %48, %24
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %48 ], [ %25, %24 ]
  call void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn.pn.pn.pn
}

; 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: mustprogress uwtable
declare dso_local void @_ZN4Node8makeTreeEj(ptr dead_on_unwind noalias writable sret(%"class.std::unique_ptr") align 8, i32 noundef) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN4Node5checkEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EE5resetEPS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrI4NodeSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) 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

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 = { 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 #4 = { 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 #5 = { 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 #6 = { nounwind willreturn memory(read) }
attributes #7 = { 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,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass