; 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.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 }

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local ptr @_ZNK7DynexCN20TransfersSyncronizer25findSubscriberForConsumerEPNS_19IBlockchainConsumerE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca %"struct.std::__detail::_Node_const_iterator", align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"struct.Crypto::PublicKey", align 1
  %7 = alloca %"struct.std::__detail::_Node_const_iterator", align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #3
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = call noundef zeroext i1 @_ZNK7DynexCN20TransfersSyncronizer22findViewKeyForConsumerEPNS_19IBlockchainConsumerERN6Crypto9PublicKeyE(ptr noundef nonnull align 8 dereferenceable(192) %9, ptr noundef %10, ptr noundef nonnull align 1 dereferenceable(32) %6)
  br i1 %11, label %12, label %24

12:                                               ; preds = %2
  %13 = getelementptr inbounds %"class.DynexCN::TransfersSyncronizer", ptr %9, i32 0, i32 4
  %14 = call ptr @_ZNKSt13unordered_mapIN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteIS7_EESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_SA_EEE4findERSG_(ptr noundef nonnull align 8 dereferenceable(56) %13, ptr noundef nonnull align 1 dereferenceable(32) %6)
  %15 = getelementptr inbounds %"struct.std::__detail::_Node_const_iterator", ptr %3, i32 0, i32 0
  %16 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.111", ptr %15, i32 0, i32 0
  store ptr %14, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %17 = getelementptr inbounds %"class.DynexCN::TransfersSyncronizer", ptr %9, i32 0, i32 4
  %18 = call ptr @_ZNKSt13unordered_mapIN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteIS7_EESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_SA_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %17) #3
  %19 = getelementptr inbounds %"struct.std::__detail::_Node_const_iterator", ptr %7, i32 0, i32 0
  %20 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.111", ptr %19, i32 0, i32 0
  store ptr %18, ptr %20, align 8
  %21 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteISA_EEELb1EEESH_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br i1 %21, label %22, label %23

22:                                               ; preds = %12
  store i32 1, ptr %8, align 4
  br label %29

23:                                               ; preds = %12
  br label %24

24:                                               ; preds = %23, %2
  %25 = getelementptr inbounds %"class.DynexCN::TransfersSyncronizer", ptr %9, i32 0, i32 4
  %26 = call ptr @_ZNKSt13unordered_mapIN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteIS7_EESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_SA_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %25) #3
  %27 = getelementptr inbounds %"struct.std::__detail::_Node_const_iterator", ptr %3, i32 0, i32 0
  %28 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.111", ptr %27, i32 0, i32 0
  store ptr %26, ptr %28, align 8
  store i32 1, ptr %8, align 4
  br label %29

29:                                               ; preds = %24, %22
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #3
  %30 = getelementptr inbounds %"struct.std::__detail::_Node_const_iterator", ptr %3, i32 0, i32 0
  %31 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.111", ptr %30, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8
  ret ptr %32
}

; 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)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7DynexCN20TransfersSyncronizer22findViewKeyForConsumerEPNS_19IBlockchainConsumerERN6Crypto9PublicKeyE(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef, ptr noundef nonnull align 1 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNKSt13unordered_mapIN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteIS7_EESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_SA_EEE4findERSG_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 1 dereferenceable(32)) #1 align 2

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

attributes #0 = { 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)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; 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.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
define dso_local ptr @_ZNK7DynexCN20TransfersSyncronizer25findSubscriberForConsumerEPNS_19IBlockchainConsumerE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %1) local_unnamed_addr #1 align 2 {
  %3 = alloca %"struct.std::__detail::_Node_const_iterator", align 8
  %4 = alloca %"struct.Crypto::PublicKey", align 1
  %5 = alloca %"struct.std::__detail::_Node_const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #3
  %6 = call noundef zeroext i1 @_ZNK7DynexCN20TransfersSyncronizer22findViewKeyForConsumerEPNS_19IBlockchainConsumerERN6Crypto9PublicKeyE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %1, ptr noundef nonnull align 1 dereferenceable(32) %4)
  br i1 %6, label %7, label %12

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 112
  %9 = call ptr @_ZNKSt13unordered_mapIN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteIS7_EESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_SA_EEE4findERSG_(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef nonnull align 1 dereferenceable(32) %4)
  store ptr %9, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %10 = call ptr @_ZNKSt13unordered_mapIN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteIS7_EESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_SA_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %8) #3
  store ptr %10, ptr %5, align 8
  %11 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteISA_EEELb1EEESH_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br i1 %11, label %._crit_edge, label %12

._crit_edge:                                      ; preds = %7
  %.pre = load ptr, ptr %3, align 8
  br label %15

12:                                               ; preds = %7, %2
  %13 = getelementptr inbounds i8, ptr %0, i64 112
  %14 = call ptr @_ZNKSt13unordered_mapIN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteIS7_EESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_SA_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %13) #3
  br label %15

15:                                               ; preds = %._crit_edge, %12
  %16 = phi ptr [ %.pre, %._crit_edge ], [ %14, %12 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #3
  ret ptr %16
}

; 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 uwtable
declare dso_local noundef zeroext i1 @_ZNK7DynexCN20TransfersSyncronizer22findViewKeyForConsumerEPNS_19IBlockchainConsumerERN6Crypto9PublicKeyE(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef, ptr noundef nonnull align 1 dereferenceable(32)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt13unordered_mapIN6Crypto9PublicKeyESt10unique_ptrIN5Tools15ObserverManagerIN7DynexCN30ITransfersSynchronizerObserverEEESt14default_deleteIS7_EESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_SA_EEE3endEv(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 = { 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,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass