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

; 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::KeysStorage" = type { i64, %"struct.Crypto::PublicKey", %"struct.Crypto::SecretKey", %"struct.Crypto::PublicKey", %"struct.Crypto::SecretKey" }
%"struct.Crypto::PublicKey" = type { [32 x i8] }
%"struct.Crypto::SecretKey" = type { [32 x i8] }
%"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::allocator" = type { i8 }
%"class.std::error_code" = type { i32, ptr }
%"struct.DynexCN::WalletRecord" = type { %"struct.Crypto::PublicKey", %"struct.Crypto::SecretKey", ptr, i64, i64, i64 }
%"struct.std::pair" = type <{ %"class.boost::multi_index::detail::rnd_node_iterator", i8, [7 x i8] }>
%"class.boost::multi_index::detail::rnd_node_iterator" = type { ptr }
%"class.DynexCN::WalletSerializerV1" = type <{ ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, [4 x i8] }>

@_ZTISt12system_error = external constant ptr
@_ZTISt13runtime_error = external constant ptr
@.str.11 = external hidden unnamed_addr constant [5 x i8], align 1

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 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: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #2

declare ptr @__cxa_begin_catch(ptr)

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

declare void @__cxa_end_catch()

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local { i32, ptr } @_Z15make_error_codeN7DynexCN5error16WalletErrorCodesE(i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt12system_errorC2ESt10error_code(ptr noundef nonnull align 8 dereferenceable(32), i32, ptr) unnamed_addr #5 align 2

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZNSt12system_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #6

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7DynexCN18WalletSerializerV116loadWalletV1KeysERNS_27BinaryInputStreamSerializerE(ptr noundef nonnull align 8 dereferenceable(92) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.DynexCN::KeysStorage", align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"class.std::error_code", align 8
  %12 = alloca %"struct.DynexCN::WalletRecord", align 8
  %13 = alloca %"struct.std::pair", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 136, ptr %5) #9
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef @.str.11, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %16 unwind label %18

16:                                               ; preds = %2
  invoke void @_ZN7DynexCN11KeysStorage9serializeERNS_11ISerializerERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(136) %5, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %17 unwind label %22

17:                                               ; preds = %16
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #9
  br label %56

18:                                               ; preds = %2
  %19 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt13runtime_error
  %20 = extractvalue { ptr, i32 } %19, 0
  store ptr %20, ptr %8, align 8
  %21 = extractvalue { ptr, i32 } %19, 1
  store i32 %21, ptr %9, align 4
  br label %26

22:                                               ; preds = %16
  %23 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt13runtime_error
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %8, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %9, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  br label %26

26:                                               ; preds = %22, %18
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #9
  br label %27

27:                                               ; preds = %26
  %28 = load i32, ptr %9, align 4
  %29 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt13runtime_error) #9
  %30 = icmp eq i32 %28, %29
  br i1 %30, label %31, label %80

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %32 = load ptr, ptr %8, align 8
  %33 = call ptr @__cxa_begin_catch(ptr %32) #9
  store ptr %33, ptr %10, align 8
  %34 = call ptr @__cxa_allocate_exception(i64 32) #9
  %35 = invoke { i32, ptr } @_Z15make_error_codeN7DynexCN5error16WalletErrorCodesE(i32 noundef 4)
          to label %36 unwind label %46

36:                                               ; preds = %31
  %37 = getelementptr inbounds { i32, ptr }, ptr %11, i32 0, i32 0
  %38 = extractvalue { i32, ptr } %35, 0
  store i32 %38, ptr %37, align 8
  %39 = getelementptr inbounds { i32, ptr }, ptr %11, i32 0, i32 1
  %40 = extractvalue { i32, ptr } %35, 1
  store ptr %40, ptr %39, align 8
  %41 = getelementptr inbounds { i32, ptr }, ptr %11, i32 0, i32 0
  %42 = load i32, ptr %41, align 8
  %43 = getelementptr inbounds { i32, ptr }, ptr %11, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8
  invoke void @_ZNSt12system_errorC2ESt10error_code(ptr noundef nonnull align 8 dereferenceable(32) %34, i32 %42, ptr %44)
          to label %45 unwind label %46

45:                                               ; preds = %36
  invoke void @__cxa_throw(ptr %34, ptr @_ZTISt12system_error, ptr @_ZNSt12system_errorD1Ev) #10
          to label %89 unwind label %50

46:                                               ; preds = %36, %31
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %8, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %9, align 4
  call void @__cxa_free_exception(ptr %34) #9
  br label %54

50:                                               ; preds = %45
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %8, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %9, align 4
  br label %54

54:                                               ; preds = %50, %46
  invoke void @__cxa_end_catch()
          to label %55 unwind label %86

55:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  br label %80

56:                                               ; preds = %17
  %57 = getelementptr inbounds %"struct.DynexCN::KeysStorage", ptr %5, i32 0, i32 3
  %58 = getelementptr inbounds %"class.DynexCN::WalletSerializerV1", ptr %14, i32 0, i32 1
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %59, ptr align 8 %57, i64 32, i1 false), !tbaa.struct !12
  %60 = getelementptr inbounds %"struct.DynexCN::KeysStorage", ptr %5, i32 0, i32 4
  %61 = getelementptr inbounds %"class.DynexCN::WalletSerializerV1", ptr %14, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %62, ptr align 8 %60, i64 32, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.start.p0(i64 96, ptr %12) #9
  call void @_ZN7DynexCN12WalletRecordC2Ev(ptr noundef nonnull align 8 dereferenceable(96) %12) #9
  %63 = getelementptr inbounds %"struct.DynexCN::KeysStorage", ptr %5, i32 0, i32 1
  %64 = getelementptr inbounds %"struct.DynexCN::WalletRecord", ptr %12, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %64, ptr align 8 %63, i64 32, i1 false), !tbaa.struct !12
  %65 = getelementptr inbounds %"struct.DynexCN::KeysStorage", ptr %5, i32 0, i32 2
  %66 = getelementptr inbounds %"struct.DynexCN::WalletRecord", ptr %12, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %66, ptr align 8 %65, i64 32, i1 false), !tbaa.struct !12
  %67 = getelementptr inbounds %"struct.DynexCN::WalletRecord", ptr %12, i32 0, i32 4
  store i64 0, ptr %67, align 8, !tbaa !15
  %68 = getelementptr inbounds %"struct.DynexCN::WalletRecord", ptr %12, i32 0, i32 3
  store i64 0, ptr %68, align 8, !tbaa !20
  %69 = getelementptr inbounds %"struct.DynexCN::KeysStorage", ptr %5, i32 0, i32 0
  %70 = load i64, ptr %69, align 8, !tbaa !21
  %71 = getelementptr inbounds %"struct.DynexCN::WalletRecord", ptr %12, i32 0, i32 5
  store i64 %70, ptr %71, align 8, !tbaa !23
  %72 = getelementptr inbounds %"class.DynexCN::WalletSerializerV1", ptr %14, i32 0, i32 5
  %73 = load ptr, ptr %72, align 8, !tbaa !24
  %74 = call noundef nonnull align 8 dereferenceable(152) ptr @_ZN5boost11multi_index21multi_index_containerIN7DynexCN12WalletRecordENS0_10indexed_byINS0_13random_accessINS0_3tagINS2_17RandomAccessIndexEN4mpl_2naES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEENS0_13hashed_uniqueINS6_INS2_9KeysIndexES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EENS0_6memberIS3_N6Crypto9PublicKeyEXadL_ZNS3_14spendPublicKeyEEEEES9_S9_EENSC_INS6_INS2_23TransfersContainerIndexES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EENSF_IS3_PNS2_19ITransfersContainerEXadL_ZNS3_9containerEEEEES9_S9_EES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EESaIS3_EE3getIS7_EERNSS_5indexIT_E4typeEv(ptr noundef nonnull align 8 dereferenceable(176) %73) #9
  %75 = call { ptr, i8 } @_ZN5boost11multi_index6detail19random_access_indexINS1_9nth_layerILi1EN7DynexCN12WalletRecordENS0_10indexed_byINS0_13random_accessINS0_3tagINS4_17RandomAccessIndexEN4mpl_2naESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EEEENS0_13hashed_uniqueINS8_INS4_9KeysIndexESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EENS0_6memberIS5_N6Crypto9PublicKeyEXadL_ZNS5_14spendPublicKeyEEEEESB_SB_EENSE_INS8_INS4_23TransfersContainerIndexESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EENSH_IS5_PNS4_19ITransfersContainerEXadL_ZNS5_9containerEEEEESB_SB_EESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EESaIS5_EEENS_3mpl6v_itemIS9_NSV_7vector0ISB_EELi0EEEE9push_backERKS5_(ptr noundef nonnull align 8 dereferenceable(152) %74, ptr noundef nonnull align 8 dereferenceable(96) %12)
  %76 = getelementptr inbounds { ptr, i8 }, ptr %13, i32 0, i32 0
  %77 = extractvalue { ptr, i8 } %75, 0
  store ptr %77, ptr %76, align 8
  %78 = getelementptr inbounds { ptr, i8 }, ptr %13, i32 0, i32 1
  %79 = extractvalue { ptr, i8 } %75, 1
  store i8 %79, ptr %78, align 8
  call void @llvm.lifetime.end.p0(i64 96, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 136, ptr %5) #9
  ret void

80:                                               ; preds = %55, %27
  call void @llvm.lifetime.end.p0(i64 136, ptr %5) #9
  br label %81

81:                                               ; preds = %80
  %82 = load ptr, ptr %8, align 8
  %83 = load i32, ptr %9, align 4
  %84 = insertvalue { ptr, i32 } poison, ptr %82, 0
  %85 = insertvalue { ptr, i32 } %84, i32 %83, 1
  resume { ptr, i32 } %85

86:                                               ; preds = %54
  %87 = landingpad { ptr, i32 }
          catch ptr null
  %88 = extractvalue { ptr, i32 } %87, 0
  call void @__clang_call_terminate(ptr %88) #11
  unreachable

89:                                               ; preds = %45
  unreachable
}

declare void @_ZN7DynexCN11KeysStorage9serializeERNS_11ISerializerERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) #7

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #8

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZN5boost11multi_index6detail19random_access_indexINS1_9nth_layerILi1EN7DynexCN12WalletRecordENS0_10indexed_byINS0_13random_accessINS0_3tagINS4_17RandomAccessIndexEN4mpl_2naESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EEEENS0_13hashed_uniqueINS8_INS4_9KeysIndexESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EENS0_6memberIS5_N6Crypto9PublicKeyEXadL_ZNS5_14spendPublicKeyEEEEESB_SB_EENSE_INS8_INS4_23TransfersContainerIndexESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EENSH_IS5_PNS4_19ITransfersContainerEXadL_ZNS5_9containerEEEEESB_SB_EESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EESaIS5_EEENS_3mpl6v_itemIS9_NSV_7vector0ISB_EELi0EEEE9push_backERKS5_(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(96)) #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noinline noreturn nounwind uwtable "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 = { 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 = { 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 #6 = { 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 #7 = { "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 #8 = { nounwind memory(none) }
attributes #9 = { nounwind }
attributes #10 = { noreturn }
attributes #11 = { noreturn 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 8}
!10 = !{!"_ZTSN7DynexCN18WalletSerializerV1E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !11, i64 88}
!11 = !{!"int", !7, i64 0}
!12 = !{i64 0, i64 32, !13}
!13 = !{!7, !7, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!16, !19, i64 80}
!16 = !{!"_ZTSN7DynexCN12WalletRecordE", !17, i64 0, !18, i64 32, !6, i64 64, !19, i64 72, !19, i64 80, !19, i64 88}
!17 = !{!"_ZTSN6Crypto9PublicKeyE", !7, i64 0}
!18 = !{!"_ZTSN6Crypto9SecretKeyE", !7, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!16, !19, i64 72}
!21 = !{!22, !19, i64 0}
!22 = !{!"_ZTSN7DynexCN11KeysStorageE", !19, i64 0, !17, i64 8, !18, i64 40, !17, i64 72, !18, i64 104}
!23 = !{!16, !19, i64 88}
!24 = !{!10, !6, i64 40}


; 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::KeysStorage" = type { i64, %"struct.Crypto::PublicKey", %"struct.Crypto::SecretKey", %"struct.Crypto::PublicKey", %"struct.Crypto::SecretKey" }
%"struct.Crypto::PublicKey" = type { [32 x i8] }
%"struct.Crypto::SecretKey" = type { [32 x i8] }
%"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::allocator" = type { i8 }
%"struct.DynexCN::WalletRecord" = type { %"struct.Crypto::PublicKey", %"struct.Crypto::SecretKey", ptr, i64, i64, i64 }

@_ZTISt12system_error = external constant ptr
@_ZTISt13runtime_error = external constant ptr
@.str.11 = external hidden unnamed_addr constant [5 x i8], align 1

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

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #2

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

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

declare void @__cxa_end_catch() local_unnamed_addr

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local { i32, ptr } @_Z15make_error_codeN7DynexCN5error16WalletErrorCodesE(i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt12system_errorC2ESt10error_code(ptr noundef nonnull align 8 dereferenceable(32), i32, ptr) unnamed_addr #5 align 2

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZNSt12system_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #6

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7DynexCN18WalletSerializerV116loadWalletV1KeysERNS_27BinaryInputStreamSerializerE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(92) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.DynexCN::KeysStorage", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca %"struct.DynexCN::WalletRecord", align 8
  call void @llvm.lifetime.start.p0(i64 136, ptr nonnull %3) #10
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #10
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #10
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #10
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.11, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %7 unwind label %25

7:                                                ; preds = %2
  invoke void @_ZN7DynexCN11KeysStorage9serializeERNS_11ISerializerERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(136) %3, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %8 unwind label %27

8:                                                ; preds = %7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #10
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #10
  %9 = getelementptr inbounds i8, ptr %3, i64 72
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %9, i64 32, i1 false), !tbaa.struct !11
  %12 = getelementptr inbounds i8, ptr %3, i64 104
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(32) %12, i64 32, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %6) #10
  call void @_ZN7DynexCN12WalletRecordC2Ev(ptr noundef nonnull align 8 dereferenceable(96) %6) #10
  %15 = getelementptr inbounds i8, ptr %3, i64 8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) %15, i64 32, i1 false), !tbaa.struct !11
  %16 = getelementptr inbounds i8, ptr %3, i64 40
  %17 = getelementptr inbounds i8, ptr %6, i64 32
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 8 dereferenceable(32) %16, i64 32, i1 false), !tbaa.struct !11
  %18 = getelementptr inbounds i8, ptr %6, i64 72
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %18, i8 0, i64 16, i1 false)
  %19 = load i64, ptr %3, align 8, !tbaa !14
  %20 = getelementptr inbounds i8, ptr %6, i64 88
  store i64 %19, ptr %20, align 8, !tbaa !19
  %21 = getelementptr inbounds i8, ptr %0, i64 40
  %22 = load ptr, ptr %21, align 8, !tbaa !21
  %23 = call noundef nonnull align 8 dereferenceable(152) ptr @_ZN5boost11multi_index21multi_index_containerIN7DynexCN12WalletRecordENS0_10indexed_byINS0_13random_accessINS0_3tagINS2_17RandomAccessIndexEN4mpl_2naES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEENS0_13hashed_uniqueINS6_INS2_9KeysIndexES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EENS0_6memberIS3_N6Crypto9PublicKeyEXadL_ZNS3_14spendPublicKeyEEEEES9_S9_EENSC_INS6_INS2_23TransfersContainerIndexES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EENSF_IS3_PNS2_19ITransfersContainerEXadL_ZNS3_9containerEEEEES9_S9_EES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EESaIS3_EE3getIS7_EERNSS_5indexIT_E4typeEv(ptr noundef nonnull align 8 dereferenceable(176) %22) #10
  %24 = call { ptr, i8 } @_ZN5boost11multi_index6detail19random_access_indexINS1_9nth_layerILi1EN7DynexCN12WalletRecordENS0_10indexed_byINS0_13random_accessINS0_3tagINS4_17RandomAccessIndexEN4mpl_2naESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EEEENS0_13hashed_uniqueINS8_INS4_9KeysIndexESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EENS0_6memberIS5_N6Crypto9PublicKeyEXadL_ZNS5_14spendPublicKeyEEEEESB_SB_EENSE_INS8_INS4_23TransfersContainerIndexESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EENSH_IS5_PNS4_19ITransfersContainerEXadL_ZNS5_9containerEEEEESB_SB_EESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EESaIS5_EEENS_3mpl6v_itemIS9_NSV_7vector0ISB_EELi0EEEE9push_backERKS5_(ptr noundef nonnull align 8 dereferenceable(152) %23, ptr noundef nonnull align 8 dereferenceable(96) %6)
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %3) #10
  ret void

25:                                               ; preds = %2
  %26 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt13runtime_error
  br label %29

27:                                               ; preds = %7
  %28 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt13runtime_error
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #10
  br label %29

29:                                               ; preds = %27, %25
  %.pn = phi { ptr, i32 } [ %28, %27 ], [ %26, %25 ]
  %.06 = extractvalue { ptr, i32 } %.pn, 1
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #10
  %30 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt13runtime_error) #10
  %31 = icmp eq i32 %.06, %30
  br i1 %31, label %32, label %44

32:                                               ; preds = %29
  %.0 = extractvalue { ptr, i32 } %.pn, 0
  %33 = call ptr @__cxa_begin_catch(ptr %.0) #10
  %34 = call ptr @__cxa_allocate_exception(i64 32) #10
  %35 = call { i32, ptr } @_Z15make_error_codeN7DynexCN5error16WalletErrorCodesE(i32 noundef 4)
  %36 = extractvalue { i32, ptr } %35, 0
  %37 = extractvalue { i32, ptr } %35, 1
  invoke void @_ZNSt12system_errorC2ESt10error_code(ptr noundef nonnull align 8 dereferenceable(32) %34, i32 %36, ptr %37)
          to label %38 unwind label %39

38:                                               ; preds = %32
  invoke void @__cxa_throw(ptr nonnull %34, ptr nonnull @_ZTISt12system_error, ptr nonnull @_ZNSt12system_errorD1Ev) #11
          to label %48 unwind label %41

39:                                               ; preds = %32
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %34) #10
  br label %43

41:                                               ; preds = %38
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %43

43:                                               ; preds = %41, %39
  %.pn10 = phi { ptr, i32 } [ %42, %41 ], [ %40, %39 ]
  invoke void @__cxa_end_catch()
          to label %44 unwind label %45

44:                                               ; preds = %43, %29
  %.merged = phi { ptr, i32 } [ %.pn, %29 ], [ %.pn10, %43 ]
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %3) #10
  resume { ptr, i32 } %.merged

45:                                               ; preds = %43
  %46 = landingpad { ptr, i32 }
          catch ptr null
  %47 = extractvalue { ptr, i32 } %46, 0
  call void @__clang_call_terminate(ptr %47) #12
  unreachable

48:                                               ; preds = %38
  unreachable
}

declare void @_ZN7DynexCN11KeysStorage9serializeERNS_11ISerializerERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #7

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #8

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZN5boost11multi_index6detail19random_access_indexINS1_9nth_layerILi1EN7DynexCN12WalletRecordENS0_10indexed_byINS0_13random_accessINS0_3tagINS4_17RandomAccessIndexEN4mpl_2naESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EEEENS0_13hashed_uniqueINS8_INS4_9KeysIndexESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EENS0_6memberIS5_N6Crypto9PublicKeyEXadL_ZNS5_14spendPublicKeyEEEEESB_SB_EENSE_INS8_INS4_23TransfersContainerIndexESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EENSH_IS5_PNS4_19ITransfersContainerEXadL_ZNS5_9containerEEEEESB_SB_EESB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_SB_EESaIS5_EEENS_3mpl6v_itemIS9_NSV_7vector0ISB_EELi0EEEE9push_backERKS5_(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #5 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #9

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noinline noreturn nounwind uwtable "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 = { 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 = { 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 #6 = { 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 #7 = { "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 #8 = { nofree nosync nounwind memory(none) }
attributes #9 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #10 = { nounwind }
attributes #11 = { noreturn }
attributes #12 = { noreturn 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, !7, i64 8}
!6 = !{!"_ZTSN7DynexCN18WalletSerializerV1E", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !10, i64 88}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{i64 0, i64 32, !12}
!12 = !{!8, !8, i64 0}
!13 = !{!6, !7, i64 16}
!14 = !{!15, !16, i64 0}
!15 = !{!"_ZTSN7DynexCN11KeysStorageE", !16, i64 0, !17, i64 8, !18, i64 40, !17, i64 72, !18, i64 104}
!16 = !{!"long", !8, i64 0}
!17 = !{!"_ZTSN6Crypto9PublicKeyE", !8, i64 0}
!18 = !{!"_ZTSN6Crypto9SecretKeyE", !8, i64 0}
!19 = !{!20, !16, i64 88}
!20 = !{!"_ZTSN7DynexCN12WalletRecordE", !17, i64 0, !18, i64 32, !7, i64 64, !16, i64 72, !16, i64 80, !16, i64 88}
!21 = !{!6, !7, i64 40}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass