; 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" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl" }
%"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ByteArray_st *, std::allocator<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 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

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

25:                                               ; preds = %5
  br i1 %24, label %31, label %26

26:                                               ; preds = %25
  store i32 4121, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %131

27:                                               ; preds = %5
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %13, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %14, align 4
  br label %133

31:                                               ; preds = %25
  %32 = getelementptr inbounds %class.CmStorageProxy, ptr %22, i32 0, i32 5
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = icmp ne ptr %33, null
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 4108, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %131

36:                                               ; preds = %31
  %37 = getelementptr inbounds %class.CmStorageProxy, ptr %22, i32 0, i32 5
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = getelementptr inbounds %struct.CM_KEY_API_ST, ptr %38, i32 0, i32 6
  %40 = load ptr, ptr %39, align 8, !tbaa !19
  %41 = icmp ne ptr %40, null
  br i1 %41, label %43, label %42

42:                                               ; preds = %36
  store i32 4118, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %131

43:                                               ; preds = %36
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %49

46:                                               ; preds = %43
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %50, label %49

49:                                               ; preds = %46, %43
  store i32 4101, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %131

50:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %51) #4
  %53 = invoke i32 @signature_from_oid(ptr noundef %52)
          to label %54 unwind label %58

54:                                               ; preds = %50
  store i32 %53, ptr %16, align 4, !tbaa !21
  %55 = load i32, ptr %16, align 4, !tbaa !21
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %62

57:                                               ; preds = %54
  store i32 4110, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %129

58:                                               ; preds = %50
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %13, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %14, align 4
  br label %130

62:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !23
  %63 = load i32, ptr %16, align 4, !tbaa !21
  %64 = icmp ne i32 %63, 8
  br i1 %64, label %65, label %74

65:                                               ; preds = %62
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %66) #4
  %68 = invoke i32 @hash_from_oid(ptr noundef %67)
          to label %69 unwind label %70

69:                                               ; preds = %65
  store i32 %68, ptr %17, align 4, !tbaa !23
  br label %75

70:                                               ; preds = %65
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %13, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %14, align 4
  br label %128

74:                                               ; preds = %62
  br label %75

75:                                               ; preds = %74, %69
  %76 = load i32, ptr %17, align 4, !tbaa !23
  %77 = icmp eq i32 %76, 0
  br i1 %77, label %78, label %79

78:                                               ; preds = %75
  store i32 4110, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %127

79:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store ptr null, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %80 = load i32, ptr %17, align 4, !tbaa !23
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = invoke i32 @hash(i32 noundef %80, ptr noundef %81, ptr noundef %18)
          to label %83 unwind label %88

83:                                               ; preds = %79
  store i32 %82, ptr %19, align 4, !tbaa !25
  %84 = load i32, ptr %19, align 4, !tbaa !25
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %92

86:                                               ; preds = %83
  %87 = load i32, ptr %19, align 4, !tbaa !25
  store i32 %87, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %125

88:                                               ; preds = %79
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %13, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %14, align 4
  br label %126

92:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  store ptr null, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #4
  call void @_ZNSt6vectorIP12ByteArray_stSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  invoke void @_ZNSt6vectorIP12ByteArray_stSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %93 unwind label %119

93:                                               ; preds = %92
  %94 = getelementptr inbounds %class.CmStorageProxy, ptr %22, i32 0, i32 5
  %95 = load ptr, ptr %94, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.CM_KEY_API_ST, ptr %95, i32 0, i32 6
  %97 = load ptr, ptr %96, align 8, !tbaa !19
  %98 = getelementptr inbounds %class.CmStorageProxy, ptr %22, i32 0, i32 4
  %99 = load ptr, ptr %98, align 8, !tbaa !26
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %100) #4
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = call noundef ptr @_ZNSt6vectorIP12ByteArray_stSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  %104 = invoke noundef i32 %97(ptr noundef %99, ptr noundef %101, ptr noundef %102, i32 noundef 1, ptr noundef %103, ptr noundef %20)
          to label %105 unwind label %119

105:                                              ; preds = %93
  store i32 %104, ptr %19, align 4, !tbaa !25
  %106 = load ptr, ptr %18, align 8, !tbaa !5
  invoke void @ba_free(ptr noundef %106)
          to label %107 unwind label %119

107:                                              ; preds = %105
  %108 = load i32, ptr %19, align 4, !tbaa !25
  %109 = icmp eq i32 %108, 0
  br i1 %109, label %110, label %123

110:                                              ; preds = %107
  %111 = load ptr, ptr %20, align 8, !tbaa !5
  %112 = getelementptr inbounds ptr, ptr %111, i64 0
  %113 = load ptr, ptr %112, align 8, !tbaa !5
  %114 = invoke ptr @ba_copy_with_alloc(ptr noundef %113, i64 noundef 0, i64 noundef 0)
          to label %115 unwind label %119

115:                                              ; preds = %110
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %114, ptr %116, align 8, !tbaa !5
  %117 = load ptr, ptr %20, align 8, !tbaa !5
  invoke void @_ZN14CmStorageProxy13arrayCmbaFreeEjPP12CM_BYTEARRAY(ptr noundef nonnull align 8 dereferenceable(168) %22, i32 noundef 1, ptr noundef %117)
          to label %118 unwind label %119

118:                                              ; preds = %115
  br label %123

119:                                              ; preds = %115, %110, %105, %93, %92
  %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
  call void @_ZNSt6vectorIP12ByteArray_stSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %126

123:                                              ; preds = %118, %107
  %124 = load i32, ptr %19, align 4, !tbaa !25
  store i32 %124, ptr %6, align 4
  store i32 1, ptr %15, align 4
  call void @_ZNSt6vectorIP12ByteArray_stSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %125

125:                                              ; preds = %123, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %127

126:                                              ; preds = %119, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %128

127:                                              ; preds = %125, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %129

128:                                              ; preds = %126, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %130

129:                                              ; preds = %127, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %131

130:                                              ; preds = %128, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %133

131:                                              ; preds = %129, %49, %42, %35, %26
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %132 = load i32, ptr %6, align 4
  ret i32 %132

133:                                              ; preds = %130, %27
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %134

134:                                              ; preds = %133
  %135 = load ptr, ptr %13, align 8
  %136 = load i32, ptr %14, align 4
  %137 = insertvalue { ptr, i32 } poison, ptr %135, 0
  %138 = insertvalue { ptr, i32 } %137, i32 %136, 1
  resume { ptr, i32 } %138
}

declare i32 @signature_from_oid(ptr noundef) #3

declare i32 @hash_from_oid(ptr noundef) #3

declare i32 @hash(i32 noundef, ptr noundef, ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP12ByteArray_stSaIS1_EE9push_backERKS1_(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 @_ZNSt6vectorIP12ByteArray_stSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

declare void @ba_free(ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIP12ByteArray_stSaIS1_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 48}
!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 = !{!22, !22, i64 0}
!22 = !{!"_ZTS7SignAlg", !7, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"_ZTS7HashAlg", !7, i64 0}
!25 = !{!13, !13, i64 0}
!26 = !{!10, !6, i64 152}


; 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" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl" }
%"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ByteArray_st *, std::allocator<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 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

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

12:                                               ; preds = %5
  %13 = getelementptr inbounds i8, ptr %0, i64 160
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  %.not = icmp eq ptr %14, null
  br i1 %.not, label %.thread, label %15

15:                                               ; preds = %12
  %16 = getelementptr inbounds i8, ptr %14, i64 48
  %17 = load ptr, ptr %16, align 8, !tbaa !18
  %.not32 = icmp eq ptr %17, null
  br i1 %.not32, label %.thread, label %18

18:                                               ; preds = %15
  %19 = icmp ne ptr %3, null
  %20 = icmp ne ptr %4, null
  %or.cond = and i1 %19, %20
  br i1 %or.cond, label %21, label %.thread

21:                                               ; preds = %18
  %22 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  %23 = invoke i32 @signature_from_oid(ptr noundef %22)
          to label %24 unwind label %25

24:                                               ; preds = %21
  switch i32 %23, label %27 [
    i32 0, label %.thread
    i32 8, label %.thread
  ]

25:                                               ; preds = %21
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %64

27:                                               ; preds = %24
  %28 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  %29 = invoke i32 @hash_from_oid(ptr noundef %28)
          to label %32 unwind label %30

30:                                               ; preds = %27
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %64

32:                                               ; preds = %27
  %33 = icmp eq i32 %29, 0
  br i1 %33, label %.thread, label %34

34:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  store ptr null, ptr %7, align 8, !tbaa !20
  %35 = invoke i32 @hash(i32 noundef %29, ptr noundef nonnull %3, ptr noundef nonnull %7)
          to label %36 unwind label %37

36:                                               ; preds = %34
  %.not34 = icmp eq i32 %35, 0
  br i1 %.not34, label %39, label %62

37:                                               ; preds = %34
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %63

39:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  store ptr null, ptr %8, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #4
  call void @_ZNSt6vectorIP12ByteArray_stSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  invoke void @_ZNSt6vectorIP12ByteArray_stSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %40 unwind label %59

40:                                               ; preds = %39
  %41 = load ptr, ptr %13, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %41, i64 48
  %43 = load ptr, ptr %42, align 8, !tbaa !18
  %44 = getelementptr inbounds i8, ptr %0, i64 152
  %45 = load ptr, ptr %44, align 8, !tbaa !21
  %46 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  %47 = call noundef ptr @_ZNSt6vectorIP12ByteArray_stSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  %48 = invoke noundef i32 %43(ptr noundef %45, ptr noundef %46, ptr noundef %2, i32 noundef 1, ptr noundef %47, ptr noundef nonnull %8)
          to label %49 unwind label %59

49:                                               ; preds = %40
  %50 = load ptr, ptr %7, align 8, !tbaa !20
  invoke void @ba_free(ptr noundef %50)
          to label %51 unwind label %59

51:                                               ; preds = %49
  %52 = icmp eq i32 %48, 0
  br i1 %52, label %53, label %61

53:                                               ; preds = %51
  %54 = load ptr, ptr %8, align 8, !tbaa !20
  %55 = load ptr, ptr %54, align 8, !tbaa !20
  %56 = invoke ptr @ba_copy_with_alloc(ptr noundef %55, i64 noundef 0, i64 noundef 0)
          to label %57 unwind label %59

57:                                               ; preds = %53
  store ptr %56, ptr %4, align 8, !tbaa !20
  %58 = load ptr, ptr %8, align 8, !tbaa !20
  invoke void @_ZN14CmStorageProxy13arrayCmbaFreeEjPP12CM_BYTEARRAY(ptr noundef nonnull align 8 dereferenceable(168) %0, i32 noundef 1, ptr noundef %58)
          to label %61 unwind label %59

59:                                               ; preds = %57, %53, %49, %40, %39
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIP12ByteArray_stSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  br label %63

61:                                               ; preds = %57, %51
  call void @_ZNSt6vectorIP12ByteArray_stSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  br label %62

62:                                               ; preds = %36, %61
  %.020 = phi i32 [ %48, %61 ], [ %35, %36 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br label %.thread

63:                                               ; preds = %59, %37
  %.pn = phi { ptr, i32 } [ %60, %59 ], [ %38, %37 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br label %64

64:                                               ; preds = %30, %63, %25
  %.pn.pn.pn = phi { ptr, i32 } [ %26, %25 ], [ %.pn, %63 ], [ %31, %30 ]
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  resume { ptr, i32 } %.pn.pn.pn

.thread:                                          ; preds = %24, %24, %32, %62, %18, %15, %12, %5
  %.3 = phi i32 [ 4121, %5 ], [ 4108, %12 ], [ 4118, %15 ], [ 4101, %18 ], [ 4110, %24 ], [ %.020, %62 ], [ 4110, %32 ], [ 4110, %24 ]
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  ret i32 %.3
}

declare i32 @signature_from_oid(ptr noundef) local_unnamed_addr #3

declare i32 @hash_from_oid(ptr noundef) local_unnamed_addr #3

declare i32 @hash(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP12ByteArray_stSaIS1_EE9push_backERKS1_(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 @_ZNSt6vectorIP12ByteArray_stSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

declare void @ba_free(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIP12ByteArray_stSaIS1_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, !12, i64 160}
!6 = !{!"_ZTS14CmStorageProxy", !7, i64 0, !13, i64 104, !13, i64 105, !16, i64 112, !12, i64 152, !12, i64 160}
!7 = !{!"_ZTS8CmLoader", !8, i64 0}
!8 = !{!"_ZTS15CM_PROVIDER_API", !9, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"any pointer", !10, i64 0}
!13 = !{!"_ZTSSt6atomicIbE", !14, i64 0}
!14 = !{!"_ZTSSt13__atomic_baseIbE", !15, i64 0}
!15 = !{!"bool", !10, i64 0}
!16 = !{!"_ZTSSt5mutex", !17, i64 0}
!17 = !{!"_ZTSSt12__mutex_base", !10, i64 0}
!18 = !{!19, !12, i64 48}
!19 = !{!"_ZTS13CM_KEY_API_ST", !9, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152}
!20 = !{!12, !12, i64 0}
!21 = !{!6, !12, i64 152}


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