; LLVM IR from dynexcoin/Dynex :: src/Wallet (WalletGreen)

; 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.DynexCN::WalletGreen::WalletOuts" = type { ptr, %"class.std::vector.201" }
%"class.std::vector.201" = type { %"struct.std::_Vector_base.202" }
%"struct.std::_Vector_base.202" = type { %"struct.std::_Vector_base<DynexCN::TransactionOutputInformation, std::allocator<DynexCN::TransactionOutputInformation>>::_Vector_impl" }
%"struct.std::_Vector_base<DynexCN::TransactionOutputInformation, std::allocator<DynexCN::TransactionOutputInformation>>::_Vector_impl" = type { %"struct.std::_Vector_base<DynexCN::TransactionOutputInformation, std::allocator<DynexCN::TransactionOutputInformation>>::_Vector_impl_data" }
%"struct.std::_Vector_base<DynexCN::TransactionOutputInformation, std::allocator<DynexCN::TransactionOutputInformation>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.DynexCN::WalletRecord" = type { %"struct.Crypto::PublicKey", %"struct.Crypto::SecretKey", ptr, i64, i64, i64 }
%"struct.Crypto::PublicKey" = type { [32 x i8] }
%"struct.Crypto::SecretKey" = type { [32 x i8] }

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: 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 noundef nonnull align 8 dereferenceable(96) ptr @_ZNK7DynexCN11WalletGreen15getWalletRecordERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1872), ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK7DynexCN11WalletGreen10pickWalletERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias writable sret(%"struct.DynexCN::WalletGreen::WalletOuts") align 8 %0, ptr noundef nonnull align 8 dereferenceable(1872) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i1, align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %12 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNK7DynexCN11WalletGreen15getWalletRecordERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1872) %12, ptr noundef nonnull align 8 dereferenceable(32) %13)
  store ptr %14, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = getelementptr inbounds %"struct.DynexCN::WalletRecord", ptr %15, i32 0, i32 2
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  store ptr %17, ptr %8, align 8, !tbaa !5
  store i1 false, ptr %9, align 1
  call void @_ZN7DynexCN11WalletGreen10WalletOutsC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %18 = load ptr, ptr %8, align 8, !tbaa !5
  %19 = getelementptr inbounds %"struct.DynexCN::WalletGreen::WalletOuts", ptr %0, i32 0, i32 1
  %20 = load ptr, ptr %18, align 8, !tbaa !14
  %21 = getelementptr inbounds ptr, ptr %20, i64 5
  %22 = load ptr, ptr %21, align 8
  invoke void %22(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(24) %19, i32 noundef 257)
          to label %23 unwind label %27

23:                                               ; preds = %3
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.DynexCN::WalletGreen::WalletOuts", ptr %0, i32 0, i32 0
  store ptr %24, ptr %25, align 8, !tbaa !16
  store i1 true, ptr %9, align 1
  %26 = load i1, ptr %9, align 1
  br i1 %26, label %32, label %31

27:                                               ; preds = %3
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %10, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %11, align 4
  call void @_ZN7DynexCN11WalletGreen10WalletOutsD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %33

31:                                               ; preds = %23
  call void @_ZN7DynexCN11WalletGreen10WalletOutsD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  br label %32

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

33:                                               ; preds = %27
  %34 = load ptr, ptr %10, align 8
  %35 = load i32, ptr %11, align 4
  %36 = insertvalue { ptr, i32 } poison, ptr %34, 0
  %37 = insertvalue { ptr, i32 } %36, i32 %35, 1
  resume { ptr, i32 } %37
}

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 = { 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 #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"}
!9 = !{!10, !6, i64 64}
!10 = !{!"_ZTSN7DynexCN12WalletRecordE", !11, i64 0, !12, i64 32, !6, i64 64, !13, i64 72, !13, i64 80, !13, i64 88}
!11 = !{!"_ZTSN6Crypto9PublicKeyE", !7, i64 0}
!12 = !{!"_ZTSN6Crypto9SecretKeyE", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !8, i64 0}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTSN7DynexCN11WalletGreen10WalletOutsE", !6, i64 0, !18, i64 8}
!18 = !{!"_ZTSSt6vectorIN7DynexCN28TransactionOutputInformationESaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIN7DynexCN28TransactionOutputInformationESaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN7DynexCN28TransactionOutputInformationESaIS1_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN7DynexCN28TransactionOutputInformationESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}


; 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.DynexCN::WalletGreen::WalletOuts" = type { ptr, %"class.std::vector.201" }
%"class.std::vector.201" = type { %"struct.std::_Vector_base.202" }
%"struct.std::_Vector_base.202" = type { %"struct.std::_Vector_base<DynexCN::TransactionOutputInformation, std::allocator<DynexCN::TransactionOutputInformation>>::_Vector_impl" }
%"struct.std::_Vector_base<DynexCN::TransactionOutputInformation, std::allocator<DynexCN::TransactionOutputInformation>>::_Vector_impl" = type { %"struct.std::_Vector_base<DynexCN::TransactionOutputInformation, std::allocator<DynexCN::TransactionOutputInformation>>::_Vector_impl_data" }
%"struct.std::_Vector_base<DynexCN::TransactionOutputInformation, std::allocator<DynexCN::TransactionOutputInformation>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(96) ptr @_ZNK7DynexCN11WalletGreen15getWalletRecordERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1872), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK7DynexCN11WalletGreen10pickWalletERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias writable sret(%"struct.DynexCN::WalletGreen::WalletOuts") align 8 %0, ptr noundef nonnull align 8 dereferenceable(1872) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %4 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNK7DynexCN11WalletGreen15getWalletRecordERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1872) %1, ptr noundef nonnull align 8 dereferenceable(32) %2)
  %5 = getelementptr inbounds i8, ptr %4, i64 64
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  tail call void @_ZN7DynexCN11WalletGreen10WalletOutsC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #2
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load ptr, ptr %6, align 8, !tbaa !13
  %9 = getelementptr inbounds i8, ptr %8, i64 40
  %10 = load ptr, ptr %9, align 8
  invoke void %10(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef 257)
          to label %11 unwind label %12

11:                                               ; preds = %3
  store ptr %4, ptr %0, align 8, !tbaa !15
  ret void

12:                                               ; preds = %3
  %13 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN7DynexCN11WalletGreen10WalletOutsD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #2
  resume { ptr, i32 } %13
}

attributes #0 = { 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 #1 = { 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 #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, !11, i64 64}
!6 = !{!"_ZTSN7DynexCN12WalletRecordE", !7, i64 0, !10, i64 32, !11, i64 64, !12, i64 72, !12, i64 80, !12, i64 88}
!7 = !{!"_ZTSN6Crypto9PublicKeyE", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN6Crypto9SecretKeyE", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !9, i64 0}
!15 = !{!16, !11, i64 0}
!16 = !{!"_ZTSN7DynexCN11WalletGreen10WalletOutsE", !11, i64 0, !17, i64 8}
!17 = !{!"_ZTSSt6vectorIN7DynexCN28TransactionOutputInformationESaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIN7DynexCN28TransactionOutputInformationESaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN7DynexCN28TransactionOutputInformationESaIS1_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN7DynexCN28TransactionOutputInformationESaIS1_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass