; LLVM IR from dynexcoin/Dynex :: src/WalletLegacy (WalletLegacySerializer)

; 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"

%"class.std::__cxx11::basic_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.Common::StdOutputStream" = type { %"class.Common::IOutputStream", ptr }
%"class.Common::IOutputStream" = type { ptr }
%"class.DynexCN::BinaryOutputStreamSerializer" = type { %"class.DynexCN::ISerializer", ptr }
%"class.DynexCN::ISerializer" = type { ptr }
%"class.Common::StringView" = type { ptr, i64 }
%"struct.Crypto::chacha8_iv" = type { [8 x i8] }
%"class.DynexCN::WalletLegacySerializer" = type <{ ptr, ptr, i32, [4 x i8] }>

@_ZN7DynexCN35WALLET_LEGACY_SERIALIZATION_VERSIONE = external dso_local global i32, align 4
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1

; 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7DynexCN22WalletLegacySerializer9serializeERSoRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbS9_(ptr noundef nonnull align 8 dereferenceable(20) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, i1 noundef zeroext %3, ptr noundef nonnull align 8 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 i8, align 1
  %10 = alloca ptr, align 8
  %11 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %12 = alloca %"class.Common::StdOutputStream", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.DynexCN::BinaryOutputStreamSerializer", align 8
  %16 = alloca %"class.Common::StringView", align 8
  %17 = alloca %"class.Common::StringView", align 8
  %18 = alloca %"class.Common::StringView", align 8
  %19 = alloca %"class.std::__cxx11::basic_string", align 8
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca %"struct.Crypto::chacha8_iv", align 1
  %22 = alloca i32, align 4
  %23 = alloca %"class.Common::StdOutputStream", align 8
  %24 = alloca %"class.DynexCN::BinaryOutputStreamSerializer", align 8
  %25 = alloca %"class.Common::StringView", align 8
  %26 = alloca %"class.Common::StringView", align 8
  %27 = alloca %"class.Common::StringView", align 8
  %28 = alloca %"class.Common::StringView", align 8
  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
  %29 = zext i1 %3 to i8
  store i8 %29, ptr %9, align 1, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  %30 = load ptr, ptr %6, align 8
  %31 = getelementptr inbounds %"class.DynexCN::WalletLegacySerializer", ptr %30, i32 0, i32 2
  %32 = load i32, ptr %31, align 8, !tbaa !11
  store i32 %32, ptr @_ZN7DynexCN35WALLET_LEGACY_SERIALIZATION_VERSIONE, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 392, ptr %11) #5
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %11)
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  %33 = getelementptr inbounds i8, ptr %11, i64 16
  invoke void @_ZN6Common15StdOutputStreamC1ERSo(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) %33)
          to label %34 unwind label %48

34:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  invoke void @_ZN7DynexCN28BinaryOutputStreamSerializerC2ERN6Common13IOutputStreamE(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %35 unwind label %52

35:                                               ; preds = %34
  invoke void @_ZN7DynexCN22WalletLegacySerializer8saveKeysERNS_11ISerializerE(ptr noundef nonnull align 8 dereferenceable(20) %30, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %36 unwind label %56

36:                                               ; preds = %35
  invoke void @_ZN6Common10StringViewC2ILm12EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 1 dereferenceable(12) @.str.7)
          to label %37 unwind label %56

37:                                               ; preds = %36
  %38 = invoke noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclERbN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 1 dereferenceable(1) %9, ptr noundef %16)
          to label %39 unwind label %60

39:                                               ; preds = %37
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #5
  %40 = load i8, ptr %9, align 1, !tbaa !9, !range !15, !noundef !16
  %41 = trunc i8 %40 to i1
  br i1 %41, label %42, label %68

42:                                               ; preds = %39
  %43 = getelementptr inbounds %"class.DynexCN::WalletLegacySerializer", ptr %30, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !17
  invoke void @_ZN6Common10StringViewC2ILm8EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 1 dereferenceable(8) @.str.8)
          to label %45 unwind label %56

45:                                               ; preds = %42
  %46 = invoke noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclINS_27WalletUserTransactionsCacheEEEbRT_N6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(224) %44, ptr noundef %17)
          to label %47 unwind label %64

47:                                               ; preds = %45
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #5
  br label %68

48:                                               ; preds = %5
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %13, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %14, align 4
  br label %146

52:                                               ; preds = %34
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %13, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %14, align 4
  br label %145

56:                                               ; preds = %68, %42, %36, %35
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %13, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %14, align 4
  br label %144

60:                                               ; preds = %37
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %13, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %14, align 4
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #5
  br label %144

64:                                               ; preds = %45
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %13, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %14, align 4
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #5
  br label %144

68:                                               ; preds = %47, %39
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN6Common10StringViewC2ILm6EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 1 dereferenceable(6) @.str.9)
          to label %70 unwind label %56

70:                                               ; preds = %68
  %71 = invoke noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializer6binaryERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(32) %69, ptr noundef %18)
          to label %72 unwind label %99

72:                                               ; preds = %70
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #5
  invoke void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %19, ptr noundef nonnull align 8 dereferenceable(128) %11)
          to label %73 unwind label %103

73:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = invoke i64 @_ZN7DynexCN22WalletLegacySerializer7encryptERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_RS6_(ptr noundef nonnull align 8 dereferenceable(20) %30, ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(32) %74, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %76 unwind label %107

76:                                               ; preds = %73
  %77 = getelementptr inbounds %"struct.Crypto::chacha8_iv", ptr %21, i32 0, i32 0
  store i64 %75, ptr %77, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %78 = getelementptr inbounds %"class.DynexCN::WalletLegacySerializer", ptr %30, i32 0, i32 2
  %79 = load i32, ptr %78, align 8, !tbaa !11
  store i32 %79, ptr %22, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #5
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZN6Common15StdOutputStreamC1ERSo(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) %80)
          to label %81 unwind label %111

81:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #5
  invoke void @_ZN7DynexCN28BinaryOutputStreamSerializerC2ERN6Common13IOutputStreamE(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %82 unwind label %115

82:                                               ; preds = %81
  invoke void @_ZN6Common10StringViewC2ILm7EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 1 dereferenceable(7) @.str.10)
          to label %83 unwind label %119

83:                                               ; preds = %82
  %84 = invoke noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializer11beginObjectEN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef %25)
          to label %85 unwind label %123

85:                                               ; preds = %83
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %25) #5
  invoke void @_ZN6Common10StringViewC2ILm8EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 1 dereferenceable(8) @.str.11)
          to label %86 unwind label %119

86:                                               ; preds = %85
  %87 = invoke noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclERjN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef %26)
          to label %88 unwind label %127

88:                                               ; preds = %86
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %26) #5
  invoke void @_ZN6Common10StringViewC2ILm3EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 1 dereferenceable(3) @.str.12)
          to label %89 unwind label %119

89:                                               ; preds = %88
  %90 = invoke noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclIN6Crypto10chacha8_ivEEEbRT_N6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 1 dereferenceable(8) %21, ptr noundef %27)
          to label %91 unwind label %131

91:                                               ; preds = %89
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %27) #5
  invoke void @_ZN6Common10StringViewC2ILm5EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 1 dereferenceable(5) @.str.13)
          to label %92 unwind label %119

92:                                               ; preds = %91
  %93 = invoke noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef %28)
          to label %94 unwind label %135

94:                                               ; preds = %92
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %28) #5
  invoke void @_ZN7DynexCN28BinaryOutputStreamSerializer9endObjectEv(ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %95 unwind label %119

95:                                               ; preds = %94
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8) %96)
          to label %98 unwind label %119

98:                                               ; preds = %95
  call void @_ZN7DynexCN11ISerializerD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #5
  call void @_ZN6Common13IOutputStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %23) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  call void @_ZN7DynexCN11ISerializerD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  call void @_ZN6Common13IOutputStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %11) #5
  call void @llvm.lifetime.end.p0(i64 392, ptr %11) #5
  ret void

99:                                               ; preds = %70
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %13, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %14, align 4
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #5
  br label %144

103:                                              ; preds = %72
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %13, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %14, align 4
  br label %143

107:                                              ; preds = %73
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %13, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %14, align 4
  br label %142

111:                                              ; preds = %76
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %13, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %14, align 4
  br label %141

115:                                              ; preds = %81
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %13, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %14, align 4
  br label %140

119:                                              ; preds = %95, %94, %91, %88, %85, %82
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %13, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %14, align 4
  br label %139

123:                                              ; preds = %83
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %13, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %14, align 4
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %25) #5
  br label %139

127:                                              ; preds = %86
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %13, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %14, align 4
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %26) #5
  br label %139

131:                                              ; preds = %89
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %13, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %14, align 4
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %27) #5
  br label %139

135:                                              ; preds = %92
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %13, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %14, align 4
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %28) #5
  br label %139

139:                                              ; preds = %135, %131, %127, %123, %119
  call void @_ZN7DynexCN11ISerializerD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #5
  br label %140

140:                                              ; preds = %139, %115
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #5
  call void @_ZN6Common13IOutputStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %23) #5
  br label %141

141:                                              ; preds = %140, %111
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %142

142:                                              ; preds = %141, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  br label %143

143:                                              ; preds = %142, %103
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  br label %144

144:                                              ; preds = %143, %99, %64, %60, %56
  call void @_ZN7DynexCN11ISerializerD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #5
  br label %145

145:                                              ; preds = %144, %52
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  call void @_ZN6Common13IOutputStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #5
  br label %146

146:                                              ; preds = %145, %48
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %11) #5
  call void @llvm.lifetime.end.p0(i64 392, ptr %11) #5
  br label %147

147:                                              ; preds = %146
  %148 = load ptr, ptr %13, align 8
  %149 = load i32, ptr %14, align 4
  %150 = insertvalue { ptr, i32 } poison, ptr %148, 0
  %151 = insertvalue { ptr, i32 } %150, i32 %149, 1
  resume { ptr, i32 } %151
}

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #2 align 2

declare void @_ZN6Common15StdOutputStreamC1ERSo(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7DynexCN28BinaryOutputStreamSerializerC2ERN6Common13IOutputStreamE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

declare noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclERbN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Common10StringViewC2ILm12EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(12)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Common10StringViewC2ILm8EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(8)) unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializer6binaryERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Common10StringViewC2ILm6EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(6)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(128)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN7DynexCN22WalletLegacySerializer7encryptERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_RS6_(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

declare noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializer11beginObjectEN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Common10StringViewC2ILm7EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(7)) unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclERjN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef) unnamed_addr #3

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

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

declare noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #3

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

declare void @_ZN7DynexCN28BinaryOutputStreamSerializer9endObjectEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = { "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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !13, i64 16}
!12 = !{!"_ZTSN7DynexCN22WalletLegacySerializerE", !6, i64 0, !6, i64 8, !13, i64 16}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!12, !6, i64 8}


; 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"

%"class.std::__cxx11::basic_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.Common::StdOutputStream" = type { %"class.Common::IOutputStream", ptr }
%"class.Common::IOutputStream" = type { ptr }
%"class.DynexCN::BinaryOutputStreamSerializer" = type { %"class.DynexCN::ISerializer", ptr }
%"class.DynexCN::ISerializer" = type { ptr }
%"class.Common::StringView" = type { ptr, i64 }
%"struct.Crypto::chacha8_iv" = type { [8 x i8] }

@_ZN7DynexCN35WALLET_LEGACY_SERIALIZATION_VERSIONE = external dso_local local_unnamed_addr global i32, align 4
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1

; 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7DynexCN22WalletLegacySerializer9serializeERSoRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbS9_(ptr noundef nonnull align 8 dereferenceable(20) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, i1 noundef zeroext %3, ptr noundef nonnull align 8 dereferenceable(32) %4) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i8, align 1
  %7 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %8 = alloca %"class.Common::StdOutputStream", align 8
  %9 = alloca %"class.DynexCN::BinaryOutputStreamSerializer", align 8
  %10 = alloca %"class.Common::StringView", align 8
  %11 = alloca %"class.Common::StringView", align 8
  %12 = alloca %"class.Common::StringView", align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"struct.Crypto::chacha8_iv", align 8
  %16 = alloca i32, align 4
  %17 = alloca %"class.Common::StdOutputStream", align 8
  %18 = alloca %"class.DynexCN::BinaryOutputStreamSerializer", align 8
  %19 = alloca %"class.Common::StringView", align 8
  %20 = alloca %"class.Common::StringView", align 8
  %21 = alloca %"class.Common::StringView", align 8
  %22 = alloca %"class.Common::StringView", align 8
  %23 = zext i1 %3 to i8
  store i8 %23, ptr %6, align 1, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %0, i64 16
  %25 = load i32, ptr %24, align 8, !tbaa !9
  store i32 %25, ptr @_ZN7DynexCN35WALLET_LEGACY_SERIALIZATION_VERSIONE, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 392, ptr nonnull %7) #5
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #5
  %26 = getelementptr inbounds i8, ptr %7, i64 16
  invoke void @_ZN6Common15StdOutputStreamC1ERSo(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %27 unwind label %38

27:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #5
  call void @_ZN7DynexCN28BinaryOutputStreamSerializerC2ERN6Common13IOutputStreamE(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) %8)
  invoke void @_ZN7DynexCN22WalletLegacySerializer8saveKeysERNS_11ISerializerE(ptr noundef nonnull align 8 dereferenceable(20) %0, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %28 unwind label %40

28:                                               ; preds = %27
  call void @_ZN6Common10StringViewC2ILm12EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 1 dereferenceable(12) @.str.7)
  %29 = invoke noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclERbN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 1 dereferenceable(1) %6, ptr noundef nonnull %10)
          to label %30 unwind label %42

30:                                               ; preds = %28
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #5
  %31 = load i8, ptr %6, align 1, !tbaa !5, !range !14, !noundef !15
  %32 = trunc nuw i8 %31 to i1
  br i1 %32, label %33, label %46

33:                                               ; preds = %30
  %34 = getelementptr inbounds i8, ptr %0, i64 8
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  call void @_ZN6Common10StringViewC2ILm8EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 1 dereferenceable(8) @.str.8)
  %36 = invoke noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclINS_27WalletUserTransactionsCacheEEEbRT_N6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(224) %35, ptr noundef nonnull %11)
          to label %37 unwind label %44

37:                                               ; preds = %33
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #5
  br label %46

38:                                               ; preds = %5
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %88

40:                                               ; preds = %27
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %87

42:                                               ; preds = %28
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #5
  br label %87

44:                                               ; preds = %33
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #5
  br label %87

46:                                               ; preds = %37, %30
  call void @_ZN6Common10StringViewC2ILm6EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 1 dereferenceable(6) @.str.9)
  %47 = invoke noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializer6binaryERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull %12)
          to label %48 unwind label %65

48:                                               ; preds = %46
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #5
  invoke void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %13, ptr noundef nonnull align 8 dereferenceable(128) %7)
          to label %49 unwind label %67

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %50 = invoke i64 @_ZN7DynexCN22WalletLegacySerializer7encryptERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_RS6_(ptr noundef nonnull align 8 dereferenceable(20) %0, ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %51 unwind label %69

51:                                               ; preds = %49
  store i64 %50, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #5
  %52 = load i32, ptr %24, align 8, !tbaa !9
  store i32 %52, ptr %16, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #5
  invoke void @_ZN6Common15StdOutputStreamC1ERSo(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %53 unwind label %71

53:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %18) #5
  call void @_ZN7DynexCN28BinaryOutputStreamSerializerC2ERN6Common13IOutputStreamE(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) %17)
  call void @_ZN6Common10StringViewC2ILm7EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 1 dereferenceable(7) @.str.10)
  %54 = invoke noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializer11beginObjectEN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull %19)
          to label %55 unwind label %75

55:                                               ; preds = %53
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #5
  call void @_ZN6Common10StringViewC2ILm8EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 1 dereferenceable(8) @.str.11)
  %56 = invoke noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclERjN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull %20)
          to label %57 unwind label %77

57:                                               ; preds = %55
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #5
  call void @_ZN6Common10StringViewC2ILm3EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 1 dereferenceable(3) @.str.12)
  %58 = invoke noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclIN6Crypto10chacha8_ivEEEbRT_N6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 1 dereferenceable(8) %15, ptr noundef nonnull %21)
          to label %59 unwind label %79

59:                                               ; preds = %57
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #5
  call void @_ZN6Common10StringViewC2ILm5EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 1 dereferenceable(5) @.str.13)
  %60 = invoke noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull %22)
          to label %61 unwind label %81

61:                                               ; preds = %59
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #5
  invoke void @_ZN7DynexCN28BinaryOutputStreamSerializer9endObjectEv(ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %62 unwind label %73

62:                                               ; preds = %61
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %64 unwind label %73

64:                                               ; preds = %62
  call void @_ZN7DynexCN11ISerializerD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #5
  call void @_ZN6Common13IOutputStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #5
  call void @_ZN7DynexCN11ISerializerD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  call void @_ZN6Common13IOutputStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %7) #5
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %7) #5
  ret void

65:                                               ; preds = %46
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #5
  br label %87

67:                                               ; preds = %48
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %86

69:                                               ; preds = %49
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %85

71:                                               ; preds = %51
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %84

73:                                               ; preds = %62, %61
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %83

75:                                               ; preds = %53
  %76 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #5
  br label %83

77:                                               ; preds = %55
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #5
  br label %83

79:                                               ; preds = %57
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #5
  br label %83

81:                                               ; preds = %59
  %82 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6Common10StringViewD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #5
  br label %83

83:                                               ; preds = %81, %79, %77, %75, %73
  %.pn = phi { ptr, i32 } [ %74, %73 ], [ %82, %81 ], [ %80, %79 ], [ %78, %77 ], [ %76, %75 ]
  call void @_ZN7DynexCN11ISerializerD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #5
  call void @_ZN6Common13IOutputStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #5
  br label %84

84:                                               ; preds = %83, %71
  %.pn.pn = phi { ptr, i32 } [ %.pn, %83 ], [ %72, %71 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #5
  br label %85

85:                                               ; preds = %84, %69
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %84 ], [ %70, %69 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  br label %86

86:                                               ; preds = %85, %67
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %85 ], [ %68, %67 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #5
  br label %87

87:                                               ; preds = %86, %65, %44, %42, %40
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %86 ], [ %66, %65 ], [ %45, %44 ], [ %43, %42 ], [ %41, %40 ]
  call void @_ZN7DynexCN11ISerializerD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  call void @_ZN6Common13IOutputStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  br label %88

88:                                               ; preds = %87, %38
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn, %87 ], [ %39, %38 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %7) #5
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %7) #5
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #2 align 2

declare void @_ZN6Common15StdOutputStreamC1ERSo(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7DynexCN28BinaryOutputStreamSerializerC2ERN6Common13IOutputStreamE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7DynexCN22WalletLegacySerializer8saveKeysERNS_11ISerializerE(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

declare noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclERbN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Common10StringViewC2ILm12EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(12)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Common10StringViewC2ILm8EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(8)) unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializer6binaryERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Common10StringViewC2ILm6EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(6)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN7DynexCN22WalletLegacySerializer7encryptERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_RS6_(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

declare noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializer11beginObjectEN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Common10StringViewC2ILm7EEERAT__Kc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(7)) unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclERjN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef) unnamed_addr #3

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

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

declare noundef zeroext i1 @_ZN7DynexCN28BinaryOutputStreamSerializerclERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN6Common10StringViewE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #3

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

declare void @_ZN7DynexCN28BinaryOutputStreamSerializer9endObjectEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = { "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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 16}
!10 = !{!"_ZTSN7DynexCN22WalletLegacySerializerE", !11, i64 0, !11, i64 8, !12, i64 16}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!10, !11, i64 8}


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