; 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.Crypto::PublicKey" = type { [32 x i8] }
%"struct.Crypto::Hash" = type { [32 x i8] }
%"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" }
%"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
declare dso_local void @_ZN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEE6notifyIMS2_FvRKN6Crypto9PublicKeyENS5_4HashEEJS6_S9_EEEvT_DpT0_(ptr noundef nonnull align 8 dereferenceable(64), i64, i64, ptr noundef byval(%"struct.Crypto::PublicKey") align 8, ptr noundef byval(%"struct.Crypto::Hash") align 8) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7DynexCN20TransfersSyncronizer22onTransactionDeleteEndEPNS_19IBlockchainConsumerEN6Crypto4HashE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %1, ptr noundef byval(%"struct.Crypto::Hash") align 8 %2) unnamed_addr #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"struct.std::__detail::_Node_const_iterator", align 8
  %7 = alloca %"struct.std::__detail::_Node_iterator.112", align 8
  %8 = alloca %"struct.Crypto::PublicKey", align 8
  %9 = alloca %"struct.Crypto::Hash", 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
  %11 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #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 %6, 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 %7) #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 %7, 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) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br i1 %20, label %21, label %31

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

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

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 = !{i64 0, i64 32, !10}
!10 = !{!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.Crypto::PublicKey" = type { [32 x i8] }
%"struct.Crypto::Hash" = type { [32 x i8] }
%"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" }

; 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
declare dso_local void @_ZN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEE6notifyIMS2_FvRKN6Crypto9PublicKeyENS5_4HashEEJS6_S9_EEEvT_DpT0_(ptr noundef nonnull align 8 dereferenceable(64), i64, i64, ptr noundef byval(%"struct.Crypto::PublicKey") align 8, ptr noundef byval(%"struct.Crypto::Hash") align 8) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7DynexCN20TransfersSyncronizer22onTransactionDeleteEndEPNS_19IBlockchainConsumerEN6Crypto4HashE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %1, ptr nocapture noundef readonly byval(%"struct.Crypto::Hash") align 8 %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_FvRKN6Crypto9PublicKeyENS5_4HashEEJS6_S9_EEEvT_DpT0_(ptr noundef nonnull align 8 dereferenceable(64) %13, i64 25, i64 0, ptr noundef nonnull byval(%"struct.Crypto::PublicKey") align 8 %14, ptr noundef nonnull byval(%"struct.Crypto::Hash") align 8 %2)
  br label %15

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

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,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass