; LLVM IR from frol/completely-unscientific-benchmarks :: c++ (main-tuned-unique_ptr)

; 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.Tree::Node" = type { i32, i32, %"class.std::unique_ptr", %"class.std::unique_ptr" }
%"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 }

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEcvbEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Tree5splitEOSt10unique_ptrINS_4NodeESt14default_deleteIS1_EERS4_S6_i(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef %3) #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  %9 = load ptr, ptr %5, align 8, !tbaa !5
  %10 = call noundef zeroext i1 @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEcvbEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #2
  br i1 %10, label %16, label %11

11:                                               ; preds = %4
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEaSEDn(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr null) #2
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEaSEDn(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr null) #2
  br label %47

16:                                               ; preds = %4
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = call noundef ptr @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #2
  %19 = getelementptr inbounds %"struct.Tree::Node", ptr %18, i32 0, i32 0
  %20 = load i32, ptr %19, align 8, !tbaa !11
  %21 = load i32, ptr %8, align 4, !tbaa !9
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %23, label %35

23:                                               ; preds = %16
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %24) #2
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = call noundef ptr @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %27) #2
  %29 = getelementptr inbounds %"struct.Tree::Node", ptr %28, i32 0, i32 3
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = call noundef ptr @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %30) #2
  %32 = getelementptr inbounds %"struct.Tree::Node", ptr %31, i32 0, i32 3
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = load i32, ptr %8, align 4, !tbaa !9
  call void @_ZN4Tree5splitEOSt10unique_ptrINS_4NodeESt14default_deleteIS1_EERS4_S6_i(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull align 8 dereferenceable(8) %33, i32 noundef %34)
  br label %47

35:                                               ; preds = %16
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(8) %36) #2
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = call noundef ptr @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %39) #2
  %41 = getelementptr inbounds %"struct.Tree::Node", ptr %40, i32 0, i32 2
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = call noundef ptr @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %43) #2
  %45 = getelementptr inbounds %"struct.Tree::Node", ptr %44, i32 0, i32 2
  %46 = load i32, ptr %8, align 4, !tbaa !9
  call void @_ZN4Tree5splitEOSt10unique_ptrINS_4NodeESt14default_deleteIS1_EERS4_S6_i(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull align 8 dereferenceable(8) %45, i32 noundef %46)
  br label %47

47:                                               ; preds = %35, %23, %11
  ret void
}

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

attributes #0 = { 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 #1 = { 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 #2 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSN4Tree4NodeE", !10, i64 0, !10, i64 4, !13, i64 8, !13, i64 16}
!13 = !{!"_ZTSSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt15__uniq_ptr_dataIN4Tree4NodeESt14default_deleteIS1_ELb1ELb1EE", !15, i64 0}
!15 = !{!"_ZTSSt15__uniq_ptr_implIN4Tree4NodeESt14default_deleteIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt5tupleIJPN4Tree4NodeESt14default_deleteIS1_EEE", !17, i64 0}
!17 = !{!"_ZTSSt11_Tuple_implILm0EJPN4Tree4NodeESt14default_deleteIS1_EEE", !18, i64 0}
!18 = !{!"_ZTSSt10_Head_baseILm0EPN4Tree4NodeELb0EE", !6, 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"

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEcvbEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4Tree5splitEOSt10unique_ptrINS_4NodeESt14default_deleteIS1_EERS4_S6_i(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef %3) local_unnamed_addr #0 align 2 {
  %5 = tail call noundef zeroext i1 @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEcvbEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #1
  br i1 %5, label %.lr.ph, label %tailrecurse.outer._crit_edge

.lr.ph:                                           ; preds = %4, %tailrecurse.outer
  %.tr17.ph28 = phi ptr [ %.tr1722, %tailrecurse.outer ], [ %2, %4 ]
  %.tr16.ph27 = phi ptr [ %16, %tailrecurse.outer ], [ %1, %4 ]
  %.tr.ph26 = phi ptr [ %14, %tailrecurse.outer ], [ %0, %4 ]
  br label %8

tailrecurse.outer._crit_edge:                     ; preds = %tailrecurse.outer, %tailrecurse, %4
  %.tr16.ph.lcssa = phi ptr [ %1, %4 ], [ %.tr16.ph27, %tailrecurse ], [ %16, %tailrecurse.outer ]
  %.tr17.lcssa = phi ptr [ %2, %4 ], [ %22, %tailrecurse ], [ %.tr1722, %tailrecurse.outer ]
  %6 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEaSEDn(ptr noundef nonnull align 8 dereferenceable(8) %.tr16.ph.lcssa, ptr null) #1
  %7 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEaSEDn(ptr noundef nonnull align 8 dereferenceable(8) %.tr17.lcssa, ptr null) #1
  ret void

8:                                                ; preds = %.lr.ph, %tailrecurse
  %.tr1722 = phi ptr [ %.tr17.ph28, %.lr.ph ], [ %22, %tailrecurse ]
  %.tr21 = phi ptr [ %.tr.ph26, %.lr.ph ], [ %20, %tailrecurse ]
  %9 = tail call noundef ptr @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %.tr21) #1
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = icmp slt i32 %10, %3
  br i1 %11, label %tailrecurse.outer, label %tailrecurse

tailrecurse.outer:                                ; preds = %8
  %12 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(8) %.tr16.ph27, ptr noundef nonnull align 8 dereferenceable(8) %.tr21) #1
  %13 = tail call noundef ptr @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %.tr16.ph27) #1
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  %15 = tail call noundef ptr @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %.tr16.ph27) #1
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  %17 = tail call noundef zeroext i1 @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEcvbEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #1
  br i1 %17, label %.lr.ph, label %tailrecurse.outer._crit_edge

tailrecurse:                                      ; preds = %8
  %18 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(8) %.tr1722, ptr noundef nonnull align 8 dereferenceable(8) %.tr21) #1
  %19 = tail call noundef ptr @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %.tr1722) #1
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  %21 = tail call noundef ptr @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %.tr1722) #1
  %22 = getelementptr inbounds i8, ptr %21, i64 8
  %23 = tail call noundef zeroext i1 @_ZNKSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EEcvbEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #1
  br i1 %23, label %8, label %tailrecurse.outer._crit_edge
}

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

attributes #0 = { 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 #1 = { 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, !7, i64 0}
!6 = !{!"_ZTSN4Tree4NodeE", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt10unique_ptrIN4Tree4NodeESt14default_deleteIS1_EE", !11, i64 0}
!11 = !{!"_ZTSSt15__uniq_ptr_dataIN4Tree4NodeESt14default_deleteIS1_ELb1ELb1EE", !12, i64 0}
!12 = !{!"_ZTSSt15__uniq_ptr_implIN4Tree4NodeESt14default_deleteIS1_EE", !13, i64 0}
!13 = !{!"_ZTSSt5tupleIJPN4Tree4NodeESt14default_deleteIS1_EEE", !14, i64 0}
!14 = !{!"_ZTSSt11_Tuple_implILm0EJPN4Tree4NodeESt14default_deleteIS1_EEE", !15, i64 0}
!15 = !{!"_ZTSSt10_Head_baseILm0EPN4Tree4NodeELb0EE", !16, i64 0}
!16 = !{!"any pointer", !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass