; LLVM IR from specinfo-ua/UAPKI :: library/uapki/src (cm-storage-proxy)

; 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::lock_guard" = type { ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<const ByteArray_st *, std::allocator<const ByteArray_st *>>::_Vector_impl" }
%"struct.std::_Vector_base<const ByteArray_st *, std::allocator<const ByteArray_st *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const ByteArray_st *, std::allocator<const ByteArray_st *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const ByteArray_st *, std::allocator<const ByteArray_st *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.CmStorageProxy = type { %class.CmLoader, %"struct.std::atomic", %"struct.std::atomic", %"class.std::mutex", ptr, ptr }
%class.CmLoader = type { %struct.CM_PROVIDER_API }
%struct.CM_PROVIDER_API = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.CM_KEY_API_ST = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK14CmStorageProxy15isOpenedStorageEv(ptr noundef nonnull align 8 dereferenceable(168)) #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14CmStorageProxy13arrayCmbaFreeEjPP12CM_BYTEARRAY(ptr noundef nonnull align 8 dereferenceable(168), i32 noundef, ptr noundef) #1 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

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

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

declare ptr @ba_copy_with_alloc(ptr noundef, i64 noundef, i64 noundef) #3

declare void @ba_free(ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14CmStorageProxy12keyDhWrapKeyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_PK12ByteArray_stSA_PPS8_SC_(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #1 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %"class.std::lock_guard", align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"class.std::vector.3", align 8
  %21 = alloca %"class.std::vector.3", align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  %27 = load ptr, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %28 = getelementptr inbounds %class.CmStorageProxy, ptr %27, i32 0, i32 3
  call void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(40) %28)
  %29 = invoke noundef zeroext i1 @_ZNK14CmStorageProxy15isOpenedStorageEv(ptr noundef nonnull align 8 dereferenceable(168) %27)
          to label %30 unwind label %32

30:                                               ; preds = %7
  br i1 %29, label %36, label %31

31:                                               ; preds = %30
  store i32 4121, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %147

32:                                               ; preds = %7
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %17, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %18, align 4
  br label %149

36:                                               ; preds = %30
  %37 = getelementptr inbounds %class.CmStorageProxy, ptr %27, i32 0, i32 5
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = icmp ne ptr %38, null
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 4108, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %147

41:                                               ; preds = %36
  %42 = getelementptr inbounds %class.CmStorageProxy, ptr %27, i32 0, i32 5
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.CM_KEY_API_ST, ptr %43, i32 0, i32 14
  %45 = load ptr, ptr %44, align 8, !tbaa !19
  %46 = icmp ne ptr %45, null
  br i1 %46, label %48, label %47

47:                                               ; preds = %41
  store i32 4118, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %147

48:                                               ; preds = %41
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %49) #4
  br i1 %50, label %63, label %51

51:                                               ; preds = %48
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %52) #4
  br i1 %53, label %63, label %54

54:                                               ; preds = %51
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = icmp ne ptr %55, null
  br i1 %56, label %57, label %63

57:                                               ; preds = %54
  %58 = load ptr, ptr %13, align 8, !tbaa !5
  %59 = icmp ne ptr %58, null
  br i1 %59, label %60, label %63

60:                                               ; preds = %57
  %61 = load ptr, ptr %15, align 8, !tbaa !5
  %62 = icmp ne ptr %61, null
  br i1 %62, label %64, label %63

63:                                               ; preds = %60, %57, %54, %51, %48
  store i32 4101, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %147

64:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  invoke void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %65 unwind label %100

65:                                               ; preds = %64
  invoke void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %66 unwind label %100

66:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  store ptr null, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  store ptr null, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  %67 = getelementptr inbounds %class.CmStorageProxy, ptr %27, i32 0, i32 5
  %68 = load ptr, ptr %67, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct.CM_KEY_API_ST, ptr %68, i32 0, i32 14
  %70 = load ptr, ptr %69, align 8, !tbaa !19
  %71 = getelementptr inbounds %class.CmStorageProxy, ptr %27, i32 0, i32 4
  %72 = load ptr, ptr %71, align 8, !tbaa !21
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %73) #4
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  %76 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %75) #4
  %77 = call noundef ptr @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  %78 = call noundef ptr @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  %79 = load ptr, ptr %14, align 8, !tbaa !5
  %80 = icmp ne ptr %79, null
  br i1 %80, label %81, label %82

81:                                               ; preds = %66
  br label %83

82:                                               ; preds = %66
  br label %83

83:                                               ; preds = %82, %81
  %84 = phi ptr [ %22, %81 ], [ null, %82 ]
  %85 = invoke noundef i32 %70(ptr noundef %72, ptr noundef %74, ptr noundef %76, i32 noundef 1, ptr noundef %77, ptr noundef %78, ptr noundef %84, ptr noundef %23)
          to label %86 unwind label %104

86:                                               ; preds = %83
  store i32 %85, ptr %24, align 4, !tbaa !22
  %87 = load i32, ptr %24, align 4, !tbaa !22
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %89, label %143

89:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  store ptr null, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  store ptr null, ptr %26, align 8, !tbaa !5
  %90 = load ptr, ptr %22, align 8, !tbaa !5
  %91 = icmp ne ptr %90, null
  br i1 %91, label %92, label %112

92:                                               ; preds = %89
  %93 = load ptr, ptr %22, align 8, !tbaa !5
  %94 = getelementptr inbounds ptr, ptr %93, i64 0
  %95 = load ptr, ptr %94, align 8, !tbaa !5
  %96 = invoke ptr @ba_copy_with_alloc(ptr noundef %95, i64 noundef 0, i64 noundef 0)
          to label %97 unwind label %108

97:                                               ; preds = %92
  store ptr %96, ptr %25, align 8, !tbaa !5
  %98 = load ptr, ptr %22, align 8, !tbaa !5
  invoke void @_ZN14CmStorageProxy13arrayCmbaFreeEjPP12CM_BYTEARRAY(ptr noundef nonnull align 8 dereferenceable(168) %27, i32 noundef 1, ptr noundef %98)
          to label %99 unwind label %108

99:                                               ; preds = %97
  br label %112

100:                                              ; preds = %65, %64
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %17, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %18, align 4
  br label %146

104:                                              ; preds = %83
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %17, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %18, align 4
  br label %145

108:                                              ; preds = %140, %138, %117, %112, %97, %92
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %17, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  br label %145

112:                                              ; preds = %99, %89
  %113 = load ptr, ptr %23, align 8, !tbaa !5
  %114 = getelementptr inbounds ptr, ptr %113, i64 0
  %115 = load ptr, ptr %114, align 8, !tbaa !5
  %116 = invoke ptr @ba_copy_with_alloc(ptr noundef %115, i64 noundef 0, i64 noundef 0)
          to label %117 unwind label %108

117:                                              ; preds = %112
  store ptr %116, ptr %26, align 8, !tbaa !5
  %118 = load ptr, ptr %23, align 8, !tbaa !5
  invoke void @_ZN14CmStorageProxy13arrayCmbaFreeEjPP12CM_BYTEARRAY(ptr noundef nonnull align 8 dereferenceable(168) %27, i32 noundef 1, ptr noundef %118)
          to label %119 unwind label %108

119:                                              ; preds = %117
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  %121 = icmp ne ptr %120, null
  br i1 %121, label %122, label %125

122:                                              ; preds = %119
  %123 = load ptr, ptr %25, align 8, !tbaa !5
  %124 = icmp ne ptr %123, null
  br i1 %124, label %125, label %128

125:                                              ; preds = %122, %119
  %126 = load ptr, ptr %26, align 8, !tbaa !5
  %127 = icmp ne ptr %126, null
  br i1 %127, label %129, label %128

128:                                              ; preds = %125, %122
  store i32 4097, ptr %24, align 4, !tbaa !22
  br label %138

129:                                              ; preds = %125
  %130 = load ptr, ptr %14, align 8, !tbaa !5
  %131 = icmp ne ptr %130, null
  br i1 %131, label %132, label %135

132:                                              ; preds = %129
  %133 = load ptr, ptr %25, align 8, !tbaa !5
  %134 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %133, ptr %134, align 8, !tbaa !5
  br label %135

135:                                              ; preds = %132, %129
  store ptr null, ptr %25, align 8, !tbaa !5
  %136 = load ptr, ptr %26, align 8, !tbaa !5
  %137 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %136, ptr %137, align 8, !tbaa !5
  store ptr null, ptr %26, align 8, !tbaa !5
  br label %138

138:                                              ; preds = %135, %128
  %139 = load ptr, ptr %25, align 8, !tbaa !5
  invoke void @ba_free(ptr noundef %139)
          to label %140 unwind label %108

140:                                              ; preds = %138
  %141 = load ptr, ptr %26, align 8, !tbaa !5
  invoke void @ba_free(ptr noundef %141)
          to label %142 unwind label %108

142:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  br label %143

143:                                              ; preds = %142, %86
  %144 = load i32, ptr %24, align 4, !tbaa !22
  store i32 %144, ptr %8, align 4
  store i32 1, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  br label %147

145:                                              ; preds = %108, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  br label %146

146:                                              ; preds = %145, %100
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  br label %149

147:                                              ; preds = %143, %63, %47, %40, %31
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %148 = load i32, ptr %8, align 4
  ret i32 %148

149:                                              ; preds = %146, %32
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %150

150:                                              ; preds = %149
  %151 = load ptr, ptr %17, align 8
  %152 = load i32, ptr %18, align 4
  %153 = insertvalue { ptr, i32 } poison, ptr %151, 0
  %154 = insertvalue { ptr, i32 } %153, i32 %152, 1
  resume { ptr, i32 } %154
}

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

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

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

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

attributes #0 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 160}
!10 = !{!"_ZTS14CmStorageProxy", !11, i64 0, !14, i64 104, !14, i64 105, !17, i64 112, !6, i64 152, !6, i64 160}
!11 = !{!"_ZTS8CmLoader", !12, i64 0}
!12 = !{!"_ZTS15CM_PROVIDER_API", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSSt6atomicIbE", !15, i64 0}
!15 = !{!"_ZTSSt13__atomic_baseIbE", !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSSt5mutex", !18, i64 0}
!18 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!19 = !{!20, !6, i64 112}
!20 = !{!"_ZTS13CM_KEY_API_ST", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152}
!21 = !{!10, !6, i64 152}
!22 = !{!13, !13, 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"

%"class.std::lock_guard" = type { ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<const ByteArray_st *, std::allocator<const ByteArray_st *>>::_Vector_impl" }
%"struct.std::_Vector_base<const ByteArray_st *, std::allocator<const ByteArray_st *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const ByteArray_st *, std::allocator<const ByteArray_st *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const ByteArray_st *, std::allocator<const ByteArray_st *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK14CmStorageProxy15isOpenedStorageEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14CmStorageProxy13arrayCmbaFreeEjPP12CM_BYTEARRAY(ptr noundef nonnull align 8 dereferenceable(168), i32 noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

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

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

declare ptr @ba_copy_with_alloc(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

declare void @ba_free(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14CmStorageProxy12keyDhWrapKeyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_PK12ByteArray_stSA_PPS8_SC_(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef %3, ptr noundef %4, ptr noundef writeonly %5, ptr noundef writeonly %6) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"class.std::lock_guard", align 8
  %11 = alloca %"class.std::vector.3", align 8
  %12 = alloca %"class.std::vector.3", align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  store ptr %3, ptr %8, align 8, !tbaa !5
  store ptr %4, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %15 = getelementptr inbounds i8, ptr %0, i64 112
  call void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(40) %15)
  %16 = call noundef zeroext i1 @_ZNK14CmStorageProxy15isOpenedStorageEv(ptr noundef nonnull align 8 dereferenceable(168) %0)
  br i1 %16, label %17, label %75

17:                                               ; preds = %7
  %18 = getelementptr inbounds i8, ptr %0, i64 160
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %.not45 = icmp eq ptr %19, null
  br i1 %.not45, label %75, label %20

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %19, i64 112
  %22 = load ptr, ptr %21, align 8, !tbaa !19
  %.not46 = icmp eq ptr %22, null
  br i1 %.not46, label %75, label %23

23:                                               ; preds = %20
  %24 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  br i1 %24, label %75, label %25

25:                                               ; preds = %23
  %26 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  %.not = xor i1 %26, true
  %27 = icmp ne ptr %3, null
  %or.cond = and i1 %27, %.not
  %28 = icmp ne ptr %4, null
  %or.cond3 = and i1 %or.cond, %28
  %29 = icmp ne ptr %6, null
  %or.cond5 = and i1 %29, %or.cond3
  br i1 %or.cond5, label %30, label %75

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  invoke void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %31 unwind label %52

31:                                               ; preds = %30
  invoke void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %32 unwind label %52

32:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #4
  store ptr null, ptr %14, align 8, !tbaa !5
  %33 = load ptr, ptr %18, align 8, !tbaa !9
  %34 = getelementptr inbounds i8, ptr %33, i64 112
  %35 = load ptr, ptr %34, align 8, !tbaa !19
  %36 = getelementptr inbounds i8, ptr %0, i64 152
  %37 = load ptr, ptr %36, align 8, !tbaa !21
  %38 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  %39 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  %40 = call noundef ptr @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  %41 = call noundef ptr @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  %.not47 = icmp eq ptr %5, null
  %. = select i1 %.not47, ptr null, ptr %13
  %42 = invoke noundef i32 %35(ptr noundef %37, ptr noundef %38, ptr noundef %39, i32 noundef 1, ptr noundef %40, ptr noundef %41, ptr noundef %., ptr noundef nonnull %14)
          to label %43 unwind label %54

43:                                               ; preds = %32
  %44 = icmp eq i32 %42, 0
  br i1 %44, label %45, label %72

45:                                               ; preds = %43
  %46 = load ptr, ptr %13, align 8, !tbaa !5
  %.not48 = icmp eq ptr %46, null
  br i1 %.not48, label %58, label %47

47:                                               ; preds = %45
  %48 = load ptr, ptr %46, align 8, !tbaa !5
  %49 = invoke ptr @ba_copy_with_alloc(ptr noundef %48, i64 noundef 0, i64 noundef 0)
          to label %50 unwind label %56

50:                                               ; preds = %47
  %51 = load ptr, ptr %13, align 8, !tbaa !5
  invoke void @_ZN14CmStorageProxy13arrayCmbaFreeEjPP12CM_BYTEARRAY(ptr noundef nonnull align 8 dereferenceable(168) %0, i32 noundef 1, ptr noundef %51)
          to label %58 unwind label %56

52:                                               ; preds = %31, %30
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %74

54:                                               ; preds = %32
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %73

56:                                               ; preds = %71, %70, %62, %58, %50, %47
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %73

58:                                               ; preds = %50, %45
  %.030 = phi ptr [ %49, %50 ], [ null, %45 ]
  %59 = load ptr, ptr %14, align 8, !tbaa !5
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = invoke ptr @ba_copy_with_alloc(ptr noundef %60, i64 noundef 0, i64 noundef 0)
          to label %62 unwind label %56

62:                                               ; preds = %58
  %63 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void @_ZN14CmStorageProxy13arrayCmbaFreeEjPP12CM_BYTEARRAY(ptr noundef nonnull align 8 dereferenceable(168) %0, i32 noundef 1, ptr noundef %63)
          to label %64 unwind label %56

64:                                               ; preds = %62
  %65 = icmp ne ptr %.030, null
  %or.cond7 = select i1 %.not47, i1 true, i1 %65
  %66 = icmp ne ptr %61, null
  %or.cond9 = select i1 %or.cond7, i1 %66, i1 false
  br i1 %or.cond9, label %67, label %70

67:                                               ; preds = %64
  br i1 %.not47, label %69, label %68

68:                                               ; preds = %67
  store ptr %.030, ptr %5, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %68, %67
  store ptr %61, ptr %6, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %64, %69
  %.031 = phi i32 [ 0, %69 ], [ 4097, %64 ]
  %.1 = phi ptr [ null, %69 ], [ %.030, %64 ]
  %.0 = phi ptr [ null, %69 ], [ %61, %64 ]
  invoke void @ba_free(ptr noundef %.1)
          to label %71 unwind label %56

71:                                               ; preds = %70
  invoke void @ba_free(ptr noundef %.0)
          to label %72 unwind label %56

72:                                               ; preds = %71, %43
  %.132 = phi i32 [ %42, %43 ], [ %.031, %71 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #4
  br label %75

73:                                               ; preds = %56, %54
  %.pn = phi { ptr, i32 } [ %57, %56 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  br label %74

74:                                               ; preds = %73, %52
  %.pn.pn = phi { ptr, i32 } [ %.pn, %73 ], [ %53, %52 ]
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #4
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  resume { ptr, i32 } %.pn.pn

75:                                               ; preds = %23, %25, %20, %17, %7, %72
  %.037 = phi i32 [ %.132, %72 ], [ 4121, %7 ], [ 4108, %17 ], [ 4118, %20 ], [ 4101, %25 ], [ 4101, %23 ]
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  ret i32 %.037
}

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

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

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

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

attributes #0 = { 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 160}
!10 = !{!"_ZTS14CmStorageProxy", !11, i64 0, !14, i64 104, !14, i64 105, !17, i64 112, !6, i64 152, !6, i64 160}
!11 = !{!"_ZTS8CmLoader", !12, i64 0}
!12 = !{!"_ZTS15CM_PROVIDER_API", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSSt6atomicIbE", !15, i64 0}
!15 = !{!"_ZTSSt13__atomic_baseIbE", !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSSt5mutex", !18, i64 0}
!18 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!19 = !{!20, !6, i64 112}
!20 = !{!"_ZTS13CM_KEY_API_ST", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152}
!21 = !{!10, !6, i64 152}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass