; LLVM IR from gstonge/spreading_CR :: src/BinaryTree.ll (ZN3net10BinaryTreeaSERKS0_)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.net::BinaryTree" = type { ptr, ptr, %"class.std::vector", %"class.std::unordered_map" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<net::BinaryTreeNode *, std::allocator<net::BinaryTreeNode *>>::_Vector_impl" }
%"struct.std::_Vector_base<net::BinaryTreeNode *, std::allocator<net::BinaryTreeNode *>>::_Vector_impl" = type { %"struct.std::_Vector_base<net::BinaryTreeNode *, std::allocator<net::BinaryTreeNode *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<net::BinaryTreeNode *, std::allocator<net::BinaryTreeNode *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"struct.net::BinaryTreeNode" = type { double, ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #1

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3net10BinaryTree6branchEPNS_14BinaryTreeNodeEii(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef, i32 noundef, i32 noundef) #4 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN3net14BinaryTreeNodeESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3net10BinaryTree12update_valueEjd(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef, double noundef) #4 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(96) ptr @_ZN3net10BinaryTreeaSERKS0_(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull align 8 dereferenceable(96) %1) #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8
  %14 = getelementptr inbounds %"class.net::BinaryTree", ptr %13, i32 0, i32 0
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  call void @_ZN3net10BinaryTree12destroy_treeEPNS_14BinaryTreeNodeE(ptr noundef nonnull align 8 dereferenceable(96) %13, ptr noundef %15)
  %16 = getelementptr inbounds %"class.net::BinaryTree", ptr %13, i32 0, i32 2
  call void @_ZNSt6vectorIPN3net14BinaryTreeNodeESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %17 = getelementptr inbounds %"class.net::BinaryTree", ptr %13, i32 0, i32 3
  call void @_ZNSt13unordered_mapIPN3net14BinaryTreeNodeEjSt4hashIS2_ESt8equal_toIS2_ESaISt4pairIKS2_jEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(56) %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.net::BinaryTree", ptr %18, i32 0, i32 2
  %20 = call noundef i64 @_ZNKSt6vectorIPN3net14BinaryTreeNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #6
  %21 = trunc i64 %20 to i32
  store i32 %21, ptr %5, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %22 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 32) #7
  invoke void @_ZN3net14BinaryTreeNodeC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22)
          to label %23 unwind label %52

23:                                               ; preds = %2
  store ptr %22, ptr %6, align 8, !tbaa !5
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %"class.net::BinaryTree", ptr %13, i32 0, i32 0
  store ptr %24, ptr %25, align 8, !tbaa !9
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.net::BinaryTree", ptr %13, i32 0, i32 1
  store ptr %26, ptr %27, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %28 = load i32, ptr %5, align 4, !tbaa !21
  %29 = mul i32 2, %28
  %30 = sub i32 %29, 1
  store i32 %30, ptr %9, align 4, !tbaa !21
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = load i32, ptr %9, align 4, !tbaa !21
  %33 = call noundef ptr @_ZN3net10BinaryTree6branchEPNS_14BinaryTreeNodeEii(ptr noundef nonnull align 8 dereferenceable(96) %13, ptr noundef %31, i32 noundef 1, i32 noundef %32)
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.net::BinaryTreeNode", ptr %34, i32 0, i32 2
  store ptr %33, ptr %35, align 8, !tbaa !24
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = load i32, ptr %9, align 4, !tbaa !21
  %38 = call noundef ptr @_ZN3net10BinaryTree6branchEPNS_14BinaryTreeNodeEii(ptr noundef nonnull align 8 dereferenceable(96) %13, ptr noundef %36, i32 noundef 2, i32 noundef %37)
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.net::BinaryTreeNode", ptr %39, i32 0, i32 3
  store ptr %38, ptr %40, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %"class.net::BinaryTree", ptr %41, i32 0, i32 2
  %43 = call ptr @_ZNKSt6vectorIPN3net14BinaryTreeNodeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #6
  %44 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %43, ptr %44, align 8
  br label %45

45:                                               ; preds = %64, %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %"class.net::BinaryTree", ptr %46, i32 0, i32 2
  %48 = call ptr @_ZNKSt6vectorIPN3net14BinaryTreeNodeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #6
  %49 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %48, ptr %49, align 8
  %50 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN3net14BinaryTreeNodeESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br i1 %50, label %56, label %51

51:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %66

52:                                               ; preds = %2
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %7, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %8, align 4
  call void @_ZdlPvm(ptr noundef %22, i64 noundef 32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %67

56:                                               ; preds = %45
  %57 = load i32, ptr %10, align 4, !tbaa !21
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKPN3net14BinaryTreeNodeESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  %60 = getelementptr inbounds %"struct.net::BinaryTreeNode", ptr %59, i32 0, i32 0
  %61 = load double, ptr %60, align 8, !tbaa !28
  call void @_ZN3net10BinaryTree12update_valueEjd(ptr noundef nonnull align 8 dereferenceable(96) %13, i32 noundef %57, double noundef %61)
  %62 = load i32, ptr %10, align 4, !tbaa !21
  %63 = add i32 %62, 1
  store i32 %63, ptr %10, align 4, !tbaa !21
  br label %64

64:                                               ; preds = %56
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKPN3net14BinaryTreeNodeESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  br label %45, !llvm.loop !29

66:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret ptr %13

67:                                               ; preds = %52
  %68 = load ptr, ptr %7, align 8
  %69 = load i32, ptr %8, align 4
  %70 = insertvalue { ptr, i32 } poison, ptr %68, 0
  %71 = insertvalue { ptr, i32 } %70, i32 %69, 1
  resume { ptr, i32 } %71
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3net10BinaryTree12destroy_treeEPNS_14BinaryTreeNodeE(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef) #4 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 #3 = { nobuiltin 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 = { 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 #5 = { inlinehint 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 = { builtin allocsize(0) }
attributes #8 = { builtin 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, !6, i64 0}
!10 = !{!"_ZTSN3net10BinaryTreeE", !6, i64 0, !6, i64 8, !11, i64 16, !15, i64 40}
!11 = !{!"_ZTSSt6vectorIPN3net14BinaryTreeNodeESaIS2_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIPN3net14BinaryTreeNodeESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIPN3net14BinaryTreeNodeESaIS2_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIPN3net14BinaryTreeNodeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!"_ZTSSt13unordered_mapIPN3net14BinaryTreeNodeEjSt4hashIS2_ESt8equal_toIS2_ESaISt4pairIKS2_jEEE", !16, i64 0}
!16 = !{!"_ZTSSt10_HashtableIPN3net14BinaryTreeNodeESt4pairIKS2_jESaIS5_ENSt8__detail10_Select1stESt8equal_toIS2_ESt4hashIS2_ENS7_18_Mod_range_hashingENS7_20_Default_ranged_hashENS7_20_Prime_rehash_policyENS7_17_Hashtable_traitsILb0ELb0ELb1EEEE", !6, i64 0, !17, i64 8, !18, i64 16, !17, i64 24, !19, i64 32, !6, i64 48}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!19 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !20, i64 0, !17, i64 8}
!20 = !{!"float", !7, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = !{!10, !6, i64 8}
!24 = !{!25, !6, i64 16}
!25 = !{!"_ZTSN3net14BinaryTreeNodeE", !26, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!26 = !{!"double", !7, i64 0}
!27 = !{!25, !6, i64 24}
!28 = !{!25, !26, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


; 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.__gnu_cxx::__normal_iterator" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN3net14BinaryTreeNodeESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3net10BinaryTree12update_valueEjd(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef, double noundef) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(96) ptr @_ZN3net10BinaryTreeaSERKS0_(ptr noundef nonnull returned align 8 dereferenceable(96) %0, ptr noundef nonnull align 8 dereferenceable(96) %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = load ptr, ptr %0, align 8, !tbaa !5
  tail call void @_ZN3net10BinaryTree12destroy_treeEPNS_14BinaryTreeNodeE(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef %5)
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void @_ZNSt6vectorIPN3net14BinaryTreeNodeESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  tail call void @_ZNSt13unordered_mapIPN3net14BinaryTreeNodeEjSt4hashIS2_ESt8equal_toIS2_ESaISt4pairIKS2_jEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(56) %7) #5
  %8 = getelementptr inbounds i8, ptr %1, i64 16
  %9 = tail call noundef i64 @_ZNKSt6vectorIPN3net14BinaryTreeNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  %10 = trunc i64 %9 to i32
  %11 = tail call noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i64 noundef 32) #6
  tail call void @_ZN3net14BinaryTreeNodeC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11)
  store ptr %11, ptr %0, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %11, ptr %12, align 8, !tbaa !20
  %13 = shl i32 %10, 1
  %14 = add i32 %13, -1
  %15 = tail call noundef ptr @_ZN3net10BinaryTree6branchEPNS_14BinaryTreeNodeEii(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull %11, i32 noundef 1, i32 noundef %14)
  %16 = getelementptr inbounds i8, ptr %11, i64 16
  store ptr %15, ptr %16, align 8, !tbaa !21
  %17 = tail call noundef ptr @_ZN3net10BinaryTree6branchEPNS_14BinaryTreeNodeEii(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull %11, i32 noundef 2, i32 noundef %14)
  %18 = getelementptr inbounds i8, ptr %11, i64 24
  store ptr %17, ptr %18, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %19 = tail call ptr @_ZNKSt6vectorIPN3net14BinaryTreeNodeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  store ptr %19, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %20 = tail call ptr @_ZNKSt6vectorIPN3net14BinaryTreeNodeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  store ptr %20, ptr %4, align 8
  %21 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN3net14BinaryTreeNodeESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br i1 %21, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret ptr %0

.lr.ph:                                           ; preds = %2, %.lr.ph
  %.014 = phi i32 [ %25, %.lr.ph ], [ 0, %2 ]
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKPN3net14BinaryTreeNodeESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %23 = load ptr, ptr %22, align 8, !tbaa !25
  %24 = load double, ptr %23, align 8, !tbaa !26
  call void @_ZN3net10BinaryTree12update_valueEjd(ptr noundef nonnull align 8 dereferenceable(96) %0, i32 noundef %.014, double noundef %24)
  %25 = add i32 %.014, 1
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKPN3net14BinaryTreeNodeESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %27 = call ptr @_ZNKSt6vectorIPN3net14BinaryTreeNodeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  store ptr %27, ptr %4, align 8
  %28 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN3net14BinaryTreeNodeESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !27
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3net10BinaryTree12destroy_treeEPNS_14BinaryTreeNodeE(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef) local_unnamed_addr #3 align 2

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

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

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

!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 = !{!"_ZTSN3net10BinaryTreeE", !7, i64 0, !7, i64 8, !10, i64 16, !14, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIPN3net14BinaryTreeNodeESaIS2_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIPN3net14BinaryTreeNodeESaIS2_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIPN3net14BinaryTreeNodeESaIS2_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIPN3net14BinaryTreeNodeESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!14 = !{!"_ZTSSt13unordered_mapIPN3net14BinaryTreeNodeEjSt4hashIS2_ESt8equal_toIS2_ESaISt4pairIKS2_jEEE", !15, i64 0}
!15 = !{!"_ZTSSt10_HashtableIPN3net14BinaryTreeNodeESt4pairIKS2_jESaIS5_ENSt8__detail10_Select1stESt8equal_toIS2_ESt4hashIS2_ENS7_18_Mod_range_hashingENS7_20_Default_ranged_hashENS7_20_Prime_rehash_policyENS7_17_Hashtable_traitsILb0ELb0ELb1EEEE", !7, i64 0, !16, i64 8, !17, i64 16, !16, i64 24, !18, i64 32, !7, i64 48}
!16 = !{!"long", !8, i64 0}
!17 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !7, i64 0}
!18 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !19, i64 0, !16, i64 8}
!19 = !{!"float", !8, i64 0}
!20 = !{!6, !7, i64 8}
!21 = !{!22, !7, i64 16}
!22 = !{!"_ZTSN3net14BinaryTreeNodeE", !23, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!23 = !{!"double", !8, i64 0}
!24 = !{!22, !7, i64 24}
!25 = !{!7, !7, i64 0}
!26 = !{!22, !23, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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