; LLVM IR from dynexcoin/Dynex :: src/Transfers (TransfersSynchronizer)

; 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.std::__detail::_Node_const_iterator" = type { %"struct.std::__detail::_Node_iterator_base.111" }
%"struct.std::__detail::_Node_iterator_base.111" = type { ptr }
%"struct.std::__detail::_Node_iterator.112" = type { %"struct.std::__detail::_Node_iterator_base.111" }
%"struct.Crypto::PublicKey" = type { [32 x i8] }
%"class.DynexCN::TransfersSyncronizer" = type { %"class.DynexCN::ITransfersSynchronizer", %"class.DynexCN::IBlockchainConsumerObserver", %"class.Logging::LoggerRef", %"class.std::unordered_map", %"class.std::unordered_map.9", ptr, ptr, ptr }
%"class.DynexCN::ITransfersSynchronizer" = type { %"class.DynexCN::IStreamSerializable" }
%"class.DynexCN::IStreamSerializable" = type { ptr }
%"class.DynexCN::IBlockchainConsumerObserver" = type { ptr }
%"class.Logging::LoggerRef" = type { ptr, %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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 }
%"class.std::unordered_map.9" = type { %"class.std::_Hashtable.10" }
%"class.std::_Hashtable.10" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::pair.113" = type { %"struct.Crypto::PublicKey", %"class.std::unique_ptr.115" }
%"class.std::unique_ptr.115" = type { %"struct.std::__uniq_ptr_data.116" }
%"struct.std::__uniq_ptr_data.116" = type { %"class.std::__uniq_ptr_impl.117" }
%"class.std::__uniq_ptr_impl.117" = type { %"class.std::tuple.118" }
%"class.std::tuple.118" = type { %"struct.std::_Tuple_impl.119" }
%"struct.std::_Tuple_impl.119" = type { %"struct.std::_Head_base.122" }
%"struct.std::_Head_base.122" = type { ptr }

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7DynexCN20TransfersSyncronizer18onBlockchainDetachEPNS_19IBlockchainConsumerEj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %1, i32 noundef %2) unnamed_addr #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::__detail::_Node_const_iterator", align 8
  %8 = alloca %"struct.std::__detail::_Node_iterator.112", align 8
  %9 = alloca %"struct.Crypto::PublicKey", align 8
  %10 = alloca { i64, i64 }, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %11 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = call ptr @_ZNK7DynexCN20TransfersSyncronizer25findSubscriberForConsumerEPNS_19IBlockchainConsumerE(ptr noundef nonnull align 8 dereferenceable(192) %11, ptr noundef %12)
  %14 = getelementptr inbounds %"struct.std::__detail::_Node_const_iterator", ptr %7, i32 0, i32 0
  %15 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.111", ptr %14, i32 0, i32 0
  store ptr %13, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %16 = getelementptr inbounds %"class.DynexCN::TransfersSyncronizer", ptr %11, i32 0, i32 4
  %17 = call ptr @_ZNSt13unordered_mapIN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteIS7_EESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_SA_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %16) #4
  %18 = getelementptr inbounds %"struct.std::__detail::_Node_iterator.112", ptr %8, i32 0, i32 0
  %19 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.111", ptr %18, i32 0, i32 0
  store ptr %17, ptr %19, align 8
  %20 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteISA_EEELb1EEESH_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br i1 %20, label %21, label %32

21:                                               ; preds = %3
  %22 = call noundef ptr @_ZNKSt8__detail20_Node_const_iteratorISt4pairIKN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteISA_EEELb0ELb1EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  %23 = getelementptr inbounds %"struct.std::pair.113", ptr %22, i32 0, i32 1
  %24 = call noundef ptr @_ZNKSt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteIS4_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #4
  %25 = call noundef ptr @_ZNKSt8__detail20_Node_const_iteratorISt4pairIKN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteISA_EEELb0ELb1EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  %26 = getelementptr inbounds %"struct.std::pair.113", ptr %25, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %9, ptr align 8 %26, i64 32, i1 false), !tbaa.struct !11
  %27 = load i32, ptr %6, align 4, !tbaa !9
  store { i64, i64 } { i64 9, i64 0 }, ptr %10, align 8, !tbaa !12
  %28 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  %29 = load i64, ptr %28, align 8
  %30 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  %31 = load i64, ptr %30, align 8
  call void @_ZN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEE6notifyIMS2_FvRKN6Crypto9PublicKeyEjEJS6_jEEEvT_DpT0_(ptr noundef nonnull align 8 dereferenceable(64) %24, i64 %29, i64 %31, ptr noundef byval(%"struct.Crypto::PublicKey") align 8 %9, i32 noundef %27)
  br label %32

32:                                               ; preds = %21, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEE6notifyIMS2_FvRKN6Crypto9PublicKeyEjEJS6_jEEEvT_DpT0_(ptr noundef nonnull align 8 dereferenceable(64), i64, i64, ptr noundef byval(%"struct.Crypto::PublicKey") align 8, i32 noundef) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 = !{i64 0, i64 32, !12}
!12 = !{!7, !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.std::__detail::_Node_const_iterator" = type { %"struct.std::__detail::_Node_iterator_base.111" }
%"struct.std::__detail::_Node_iterator_base.111" = type { ptr }
%"struct.std::__detail::_Node_iterator.112" = type { %"struct.std::__detail::_Node_iterator_base.111" }
%"struct.Crypto::PublicKey" = type { [32 x i8] }

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNK7DynexCN20TransfersSyncronizer25findSubscriberForConsumerEPNS_19IBlockchainConsumerE(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7DynexCN20TransfersSyncronizer18onBlockchainDetachEPNS_19IBlockchainConsumerEj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %1, i32 noundef %2) unnamed_addr #1 align 2 {
  %4 = alloca %"struct.std::__detail::_Node_const_iterator", align 8
  %5 = alloca %"struct.std::__detail::_Node_iterator.112", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %6 = tail call ptr @_ZNK7DynexCN20TransfersSyncronizer25findSubscriberForConsumerEPNS_19IBlockchainConsumerE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %1)
  store ptr %6, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %7 = getelementptr inbounds i8, ptr %0, i64 112
  %8 = tail call ptr @_ZNSt13unordered_mapIN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteIS7_EESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_SA_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %7) #3
  store ptr %8, ptr %5, align 8
  %9 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteISA_EEELb1EEESH_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br i1 %9, label %10, label %15

10:                                               ; preds = %3
  %11 = call noundef ptr @_ZNKSt8__detail20_Node_const_iteratorISt4pairIKN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteISA_EEELb0ELb1EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %12 = getelementptr inbounds i8, ptr %11, i64 32
  %13 = call noundef ptr @_ZNKSt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteIS4_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #3
  %14 = call noundef ptr @_ZNKSt8__detail20_Node_const_iteratorISt4pairIKN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteISA_EEELb0ELb1EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  call void @_ZN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEE6notifyIMS2_FvRKN6Crypto9PublicKeyEjEJS6_jEEEvT_DpT0_(ptr noundef nonnull align 8 dereferenceable(64) %13, i64 9, i64 0, ptr noundef nonnull byval(%"struct.Crypto::PublicKey") align 8 %14, i32 noundef %2)
  br label %15

15:                                               ; preds = %10, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEE6notifyIMS2_FvRKN6Crypto9PublicKeyEjEJS6_jEEEvT_DpT0_(ptr noundef nonnull align 8 dereferenceable(64), i64, i64, ptr noundef byval(%"struct.Crypto::PublicKey") align 8, i32 noundef) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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)"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SROAPass,TailCallElimPass