; 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::EncryptedWalletRecord" = type { %"struct.Crypto::chacha8_iv", [72 x i8] }
%"struct.Crypto::chacha8_iv" = type { [8 x i8] }
%"class.Tools::ScopeExit" = type <{ %"class.std::function", i8, [7 x i8] }>
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.217 = type { ptr }
%"class.Common::FileMappedVector<DynexCN::EncryptedWalletRecord>::iterator" = type { %"class.Common::FileMappedVector<DynexCN::EncryptedWalletRecord>::const_iterator" }
%"class.Common::FileMappedVector<DynexCN::EncryptedWalletRecord>::const_iterator" = type { ptr, i64 }
%"struct.Crypto::PublicKey" = type { [32 x i8] }
%"struct.Crypto::SecretKey" = type { [32 x i8] }
%"struct.DynexCN::WalletGreen::ContainerStoragePrefix" = type { i8, %"struct.Crypto::chacha8_iv", %"struct.DynexCN::EncryptedWalletRecord" }

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: 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 uwtable
declare dso_local void @_ZN7DynexCN11WalletGreen14decryptKeyPairERKNS_21EncryptedWalletRecordERN6Crypto9PublicKeyERNS4_9SecretKeyERmRKNS4_11chacha8_keyE(ptr noundef nonnull align 1 dereferenceable(80), ptr noundef nonnull align 1 dereferenceable(32), ptr noundef nonnull align 1 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(32)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7DynexCN11WalletGreen14encryptKeyPairERKN6Crypto9PublicKeyERKNS1_9SecretKeyEmRKNS1_11chacha8_keyERKNS1_10chacha8_ivE(ptr dead_on_unwind noalias writable sret(%"struct.DynexCN::EncryptedWalletRecord") align 1, ptr noundef nonnull align 1 dereferenceable(32), ptr noundef nonnull align 1 dereferenceable(32), i64 noundef, ptr noundef nonnull align 1 dereferenceable(32), ptr noundef nonnull align 1 dereferenceable(8)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE6prefixEv(ptr noundef nonnull align 8 dereferenceable(105)) #2 align 2

declare void @_ZN5Tools9ScopeExitC1EOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7DynexCN11WalletGreen24copyContainerStorageKeysERN6Common16FileMappedVectorINS_21EncryptedWalletRecordEEERKN6Crypto11chacha8_keyES5_S9_(ptr noundef nonnull align 8 dereferenceable(1872) %0, ptr noundef nonnull align 8 dereferenceable(105) %1, ptr noundef nonnull align 1 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(105) %3, ptr noundef nonnull align 1 dereferenceable(32) %4) #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"class.Tools::ScopeExit", align 8
  %12 = alloca %"class.std::function", align 8
  %13 = alloca %class.anon.217, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"class.Common::FileMappedVector<DynexCN::EncryptedWalletRecord>::iterator", align 8
  %19 = alloca %"class.Common::FileMappedVector<DynexCN::EncryptedWalletRecord>::iterator", align 8
  %20 = alloca ptr, align 8
  %21 = alloca %"struct.Crypto::PublicKey", align 1
  %22 = alloca %"struct.Crypto::SecretKey", align 1
  %23 = alloca i64, align 8
  %24 = alloca ptr, align 8
  %25 = alloca %"struct.Crypto::chacha8_iv", align 1
  %26 = alloca %"struct.DynexCN::EncryptedWalletRecord", align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %27 = load ptr, ptr %6, align 8
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = call noundef i64 @_ZNK6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(105) %29)
  call void @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(105) %28, i64 noundef %30)
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE12setAutoFlushEb(ptr noundef nonnull align 8 dereferenceable(105) %31, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 40, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %32 = getelementptr inbounds %class.anon.217, ptr %13, i32 0, i32 0
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %33, ptr %32, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvvEEC2IZN7DynexCN11WalletGreen24copyContainerStorageKeysERN6Common16FileMappedVectorINS3_21EncryptedWalletRecordEEERKN6Crypto11chacha8_keyES9_SD_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  invoke void @_ZN5Tools9ScopeExitC1EOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(33) %11, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %34 unwind label %56

34:                                               ; preds = %5
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %35, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %36 = load ptr, ptr %17, align 8, !tbaa !5
  %37 = invoke { ptr, i64 } @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE5beginEv(ptr noundef nonnull align 8 dereferenceable(105) %36)
          to label %38 unwind label %60

38:                                               ; preds = %34
  %39 = getelementptr inbounds %"class.Common::FileMappedVector<DynexCN::EncryptedWalletRecord>::iterator", ptr %18, i32 0, i32 0
  %40 = getelementptr inbounds { ptr, i64 }, ptr %39, i32 0, i32 0
  %41 = extractvalue { ptr, i64 } %37, 0
  store ptr %41, ptr %40, align 8
  %42 = getelementptr inbounds { ptr, i64 }, ptr %39, i32 0, i32 1
  %43 = extractvalue { ptr, i64 } %37, 1
  store i64 %43, ptr %42, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  %44 = load ptr, ptr %17, align 8, !tbaa !5
  %45 = invoke { ptr, i64 } @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE3endEv(ptr noundef nonnull align 8 dereferenceable(105) %44)
          to label %46 unwind label %64

46:                                               ; preds = %38
  %47 = getelementptr inbounds %"class.Common::FileMappedVector<DynexCN::EncryptedWalletRecord>::iterator", ptr %19, i32 0, i32 0
  %48 = getelementptr inbounds { ptr, i64 }, ptr %47, i32 0, i32 0
  %49 = extractvalue { ptr, i64 } %45, 0
  store ptr %49, ptr %48, align 8
  %50 = getelementptr inbounds { ptr, i64 }, ptr %47, i32 0, i32 1
  %51 = extractvalue { ptr, i64 } %45, 1
  store i64 %51, ptr %50, align 8
  br label %52

52:                                               ; preds = %88, %46
  %53 = invoke noundef zeroext i1 @_ZNK6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE14const_iteratorneERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %54 unwind label %64

54:                                               ; preds = %52
  br i1 %53, label %68, label %55

55:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %110

56:                                               ; preds = %5
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %14, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %15, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  br label %111

60:                                               ; preds = %34
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %14, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %15, align 4
  br label %109

64:                                               ; preds = %86, %52, %38
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %14, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %15, align 4
  br label %108

68:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %69 = invoke noundef nonnull align 1 dereferenceable(80) ptr @_ZNK6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %70 unwind label %89

70:                                               ; preds = %68
  store ptr %69, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %71 = load ptr, ptr %20, align 8, !tbaa !5
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN7DynexCN11WalletGreen14decryptKeyPairERKNS_21EncryptedWalletRecordERN6Crypto9PublicKeyERNS4_9SecretKeyERmRKNS4_11chacha8_keyE(ptr noundef nonnull align 1 dereferenceable(80) %71, ptr noundef nonnull align 1 dereferenceable(32) %21, ptr noundef nonnull align 1 dereferenceable(32) %22, ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 1 dereferenceable(32) %72)
          to label %73 unwind label %93

73:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = invoke noundef ptr @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE6prefixEv(ptr noundef nonnull align 8 dereferenceable(105) %74)
          to label %76 unwind label %97

76:                                               ; preds = %73
  store ptr %75, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %77 = load ptr, ptr %24, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.DynexCN::WalletGreen::ContainerStoragePrefix", ptr %77, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %25, ptr align 1 %78, i64 8, i1 false), !tbaa.struct !11
  %79 = load ptr, ptr %24, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.DynexCN::WalletGreen::ContainerStoragePrefix", ptr %79, i32 0, i32 1
  call void @_ZN7DynexCN11WalletGreen5incIvERN6Crypto10chacha8_ivE(ptr noundef nonnull align 1 dereferenceable(8) %80)
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %26) #6
  %82 = load i64, ptr %23, align 8, !tbaa !9
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN7DynexCN11WalletGreen14encryptKeyPairERKN6Crypto9PublicKeyERKNS1_9SecretKeyEmRKNS1_11chacha8_keyERKNS1_10chacha8_ivE(ptr dead_on_unwind writable sret(%"struct.DynexCN::EncryptedWalletRecord") align 1 %26, ptr noundef nonnull align 1 dereferenceable(32) %21, ptr noundef nonnull align 1 dereferenceable(32) %22, i64 noundef %82, ptr noundef nonnull align 1 dereferenceable(32) %83, ptr noundef nonnull align 1 dereferenceable(8) %25)
          to label %84 unwind label %101

84:                                               ; preds = %76
  invoke void @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(105) %81, ptr noundef nonnull align 1 dereferenceable(80) %26)
          to label %85 unwind label %101

85:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 80, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %86

86:                                               ; preds = %85
  %87 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE8iteratorppEv(ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %88 unwind label %64

88:                                               ; preds = %86
  br label %52

89:                                               ; preds = %68
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %14, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %15, align 4
  br label %107

93:                                               ; preds = %70
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %14, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %15, align 4
  br label %106

97:                                               ; preds = %73
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %14, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %15, align 4
  br label %105

101:                                              ; preds = %84, %76
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %14, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 80, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %105

105:                                              ; preds = %101, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %106

106:                                              ; preds = %105, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #6
  br label %107

107:                                              ; preds = %106, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %108

108:                                              ; preds = %107, %64
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br label %109

109:                                              ; preds = %108, %60
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @_ZN5Tools9ScopeExitD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %11) #6
  br label %111

110:                                              ; preds = %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @_ZN5Tools9ScopeExitD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %11) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #6
  ret void

111:                                              ; preds = %109, %56
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #6
  br label %112

112:                                              ; preds = %111
  %113 = load ptr, ptr %14, align 8
  %114 = load i32, ptr %15, align 4
  %115 = insertvalue { ptr, i32 } poison, ptr %113, 0
  %116 = insertvalue { ptr, i32 } %115, i32 %114, 1
  resume { ptr, i32 } %116
}

; Function Attrs: nounwind
declare void @_ZN5Tools9ScopeExitD1Ev(ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(105), i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(105)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN7DynexCN11WalletGreen24copyContainerStorageKeysERN6Common16FileMappedVectorINS3_21EncryptedWalletRecordEEERKN6Crypto11chacha8_keyES9_SD_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE5beginEv(ptr noundef nonnull align 8 dereferenceable(105)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE3endEv(ptr noundef nonnull align 8 dereferenceable(105)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(80) ptr @_ZNK6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(105), ptr noundef nonnull align 1 dereferenceable(80)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 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 = { "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 = { 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 #6 = { 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 = !{!"long", !7, i64 0}
!11 = !{i64 0, i64 8, !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.DynexCN::EncryptedWalletRecord" = type { %"struct.Crypto::chacha8_iv", [72 x i8] }
%"struct.Crypto::chacha8_iv" = type { [8 x i8] }
%"class.Tools::ScopeExit" = type <{ %"class.std::function", i8, [7 x i8] }>
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.217 = type { ptr }
%"class.Common::FileMappedVector<DynexCN::EncryptedWalletRecord>::iterator" = type { %"class.Common::FileMappedVector<DynexCN::EncryptedWalletRecord>::const_iterator" }
%"class.Common::FileMappedVector<DynexCN::EncryptedWalletRecord>::const_iterator" = type { ptr, i64 }
%"struct.Crypto::PublicKey" = type { [32 x i8] }
%"struct.Crypto::SecretKey" = type { [32 x i8] }

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7DynexCN11WalletGreen14encryptKeyPairERKN6Crypto9PublicKeyERKNS1_9SecretKeyEmRKNS1_11chacha8_keyERKNS1_10chacha8_ivE(ptr dead_on_unwind noalias writable sret(%"struct.DynexCN::EncryptedWalletRecord") align 1, ptr noundef nonnull align 1 dereferenceable(32), ptr noundef nonnull align 1 dereferenceable(32), i64 noundef, ptr noundef nonnull align 1 dereferenceable(32), ptr noundef nonnull align 1 dereferenceable(8)) local_unnamed_addr #1 align 2

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

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

declare void @_ZN5Tools9ScopeExitC1EOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7DynexCN11WalletGreen24copyContainerStorageKeysERN6Common16FileMappedVectorINS_21EncryptedWalletRecordEEERKN6Crypto11chacha8_keyES5_S9_(ptr nocapture noundef nonnull readnone align 8 dereferenceable(1872) %0, ptr noundef nonnull align 8 dereferenceable(105) %1, ptr noundef nonnull align 1 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(105) %3, ptr noundef nonnull align 1 dereferenceable(32) %4) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.Tools::ScopeExit", align 8
  %7 = alloca %"class.std::function", align 8
  %8 = alloca %class.anon.217, align 8
  %9 = alloca %"class.Common::FileMappedVector<DynexCN::EncryptedWalletRecord>::iterator", align 8
  %10 = alloca %"class.Common::FileMappedVector<DynexCN::EncryptedWalletRecord>::iterator", align 8
  %11 = alloca %"struct.Crypto::PublicKey", align 1
  %12 = alloca %"struct.Crypto::SecretKey", align 1
  %13 = alloca i64, align 8
  %14 = alloca %"struct.Crypto::chacha8_iv", align 8
  %15 = alloca %"struct.DynexCN::EncryptedWalletRecord", align 1
  %16 = tail call noundef i64 @_ZNK6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(105) %1)
  tail call void @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(105) %3, i64 noundef %16)
  tail call void @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE12setAutoFlushEb(ptr noundef nonnull align 8 dereferenceable(105) %3, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvvEEC2IZN7DynexCN11WalletGreen24copyContainerStorageKeysERN6Common16FileMappedVectorINS3_21EncryptedWalletRecordEEERKN6Crypto11chacha8_keyES9_SD_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  invoke void @_ZN5Tools9ScopeExitC1EOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(33) %6, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %17 unwind label %29

17:                                               ; preds = %5
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #5
  %18 = invoke { ptr, i64 } @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE5beginEv(ptr noundef nonnull align 8 dereferenceable(105) %1)
          to label %19 unwind label %31

19:                                               ; preds = %17
  %20 = extractvalue { ptr, i64 } %18, 0
  store ptr %20, ptr %9, align 8
  %21 = getelementptr inbounds i8, ptr %9, i64 8
  %22 = extractvalue { ptr, i64 } %18, 1
  store i64 %22, ptr %21, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #5
  %23 = invoke { ptr, i64 } @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE3endEv(ptr noundef nonnull align 8 dereferenceable(105) %1)
          to label %24 unwind label %33

24:                                               ; preds = %19
  %25 = extractvalue { ptr, i64 } %23, 0
  store ptr %25, ptr %10, align 8
  %26 = getelementptr inbounds i8, ptr %10, i64 8
  %27 = extractvalue { ptr, i64 } %23, 1
  store i64 %27, ptr %26, align 8
  %28 = call noundef zeroext i1 @_ZNK6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE14const_iteratorneERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %10)
  br i1 %28, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %44, %24
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  call void @_ZN5Tools9ScopeExitD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %6) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #5
  ret void

29:                                               ; preds = %5
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  br label %58

31:                                               ; preds = %17
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %57

33:                                               ; preds = %19
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %56

.lr.ph:                                           ; preds = %24, %44
  %35 = invoke noundef nonnull align 1 dereferenceable(80) ptr @_ZNK6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %36 unwind label %47

36:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  invoke void @_ZN7DynexCN11WalletGreen14decryptKeyPairERKNS_21EncryptedWalletRecordERN6Crypto9PublicKeyERNS4_9SecretKeyERmRKNS4_11chacha8_keyE(ptr noundef nonnull align 1 dereferenceable(80) %35, ptr noundef nonnull align 1 dereferenceable(32) %11, ptr noundef nonnull align 1 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 1 dereferenceable(32) %2)
          to label %37 unwind label %49

37:                                               ; preds = %36
  %38 = invoke noundef ptr @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE6prefixEv(ptr noundef nonnull align 8 dereferenceable(105) %3)
          to label %39 unwind label %51

39:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %40 = getelementptr inbounds i8, ptr %38, i64 1
  %41 = load i64, ptr %40, align 1, !tbaa !9
  store i64 %41, ptr %14, align 8, !tbaa !9
  call void @_ZN7DynexCN11WalletGreen5incIvERN6Crypto10chacha8_ivE(ptr noundef nonnull align 1 dereferenceable(8) %40)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %15) #5
  %42 = load i64, ptr %13, align 8, !tbaa !10
  invoke void @_ZN7DynexCN11WalletGreen14encryptKeyPairERKN6Crypto9PublicKeyERKNS1_9SecretKeyEmRKNS1_11chacha8_keyERKNS1_10chacha8_ivE(ptr dead_on_unwind nonnull writable sret(%"struct.DynexCN::EncryptedWalletRecord") align 1 %15, ptr noundef nonnull align 1 dereferenceable(32) %11, ptr noundef nonnull align 1 dereferenceable(32) %12, i64 noundef %42, ptr noundef nonnull align 1 dereferenceable(32) %4, ptr noundef nonnull align 1 dereferenceable(8) %14)
          to label %43 unwind label %53

43:                                               ; preds = %39
  invoke void @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(105) %3, ptr noundef nonnull align 1 dereferenceable(80) %15)
          to label %44 unwind label %53

44:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE8iteratorppEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %46 = call noundef zeroext i1 @_ZNK6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE14const_iteratorneERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %10)
  br i1 %46, label %.lr.ph, label %._crit_edge

47:                                               ; preds = %.lr.ph
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %56

49:                                               ; preds = %36
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %55

51:                                               ; preds = %37
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %55

53:                                               ; preds = %43, %39
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %55

55:                                               ; preds = %51, %53, %49
  %.pn.pn = phi { ptr, i32 } [ %50, %49 ], [ %54, %53 ], [ %52, %51 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  br label %56

56:                                               ; preds = %47, %55, %33
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %34, %33 ], [ %.pn.pn, %55 ], [ %48, %47 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  br label %57

57:                                               ; preds = %56, %31
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %56 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  call void @_ZN5Tools9ScopeExitD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %6) #5
  br label %58

58:                                               ; preds = %57, %29
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn, %57 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #5
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn
}

; Function Attrs: nounwind
declare void @_ZN5Tools9ScopeExitD1Ev(ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(105), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(105)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN7DynexCN11WalletGreen24copyContainerStorageKeysERN6Common16FileMappedVectorINS3_21EncryptedWalletRecordEEERKN6Crypto11chacha8_keyES9_SD_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE5beginEv(ptr noundef nonnull align 8 dereferenceable(105)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE3endEv(ptr noundef nonnull align 8 dereferenceable(105)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(80) ptr @_ZNK6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Common16FileMappedVectorIN7DynexCN21EncryptedWalletRecordEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(105), ptr noundef nonnull align 1 dereferenceable(80)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { "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 "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 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass