; 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

; 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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14CmStorageProxy14keyDhUnwrapKeyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_PK12ByteArray_stSA_SA_PPS8_(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 %"class.std::vector.3", align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  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
  %25 = load ptr, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %26 = getelementptr inbounds %class.CmStorageProxy, ptr %25, i32 0, i32 3
  call void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(40) %26)
  %27 = invoke noundef zeroext i1 @_ZNK14CmStorageProxy15isOpenedStorageEv(ptr noundef nonnull align 8 dereferenceable(168) %25)
          to label %28 unwind label %30

28:                                               ; preds = %7
  br i1 %27, label %34, label %29

29:                                               ; preds = %28
  store i32 4121, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %113

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

34:                                               ; preds = %28
  %35 = getelementptr inbounds %class.CmStorageProxy, ptr %25, i32 0, i32 5
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = icmp ne ptr %36, null
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 4108, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %113

39:                                               ; preds = %34
  %40 = getelementptr inbounds %class.CmStorageProxy, ptr %25, i32 0, i32 5
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  %42 = getelementptr inbounds %struct.CM_KEY_API_ST, ptr %41, i32 0, i32 15
  %43 = load ptr, ptr %42, align 8, !tbaa !19
  %44 = icmp ne ptr %43, null
  br i1 %44, label %46, label %45

45:                                               ; preds = %39
  store i32 4118, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %113

46:                                               ; preds = %39
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %47) #4
  br i1 %48, label %61, label %49

49:                                               ; preds = %46
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %50) #4
  br i1 %51, label %61, label %52

52:                                               ; preds = %49
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %61

55:                                               ; preds = %52
  %56 = load ptr, ptr %14, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %61

58:                                               ; preds = %55
  %59 = load ptr, ptr %15, align 8, !tbaa !5
  %60 = icmp ne ptr %59, null
  br i1 %60, label %62, label %61

61:                                               ; preds = %58, %55, %52, %49, %46
  store i32 4101, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %113

62:                                               ; preds = %58
  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
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #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 %63 unwind label %68

63:                                               ; preds = %62
  %64 = load ptr, ptr %13, align 8, !tbaa !5
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %72

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

67:                                               ; preds = %66
  br label %72

68:                                               ; preds = %72, %66, %62
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %17, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %18, align 4
  br label %112

72:                                               ; preds = %67, %63
  invoke void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %73 unwind label %68

73:                                               ; preds = %72
  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
  %74 = getelementptr inbounds %class.CmStorageProxy, ptr %25, i32 0, i32 5
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = getelementptr inbounds %struct.CM_KEY_API_ST, ptr %75, i32 0, i32 15
  %77 = load ptr, ptr %76, align 8, !tbaa !19
  %78 = getelementptr inbounds %class.CmStorageProxy, ptr %25, i32 0, i32 4
  %79 = load ptr, ptr %78, align 8, !tbaa !21
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %80) #4
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %82) #4
  %84 = call noundef ptr @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  %85 = load ptr, ptr %13, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %89

87:                                               ; preds = %73
  %88 = call noundef ptr @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  br label %90

89:                                               ; preds = %73
  br label %90

90:                                               ; preds = %89, %87
  %91 = phi ptr [ %88, %87 ], [ null, %89 ]
  %92 = call noundef ptr @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #4
  %93 = invoke noundef i32 %77(ptr noundef %79, ptr noundef %81, ptr noundef %83, i32 noundef 1, ptr noundef %84, ptr noundef %91, ptr noundef %92, ptr noundef %23)
          to label %94 unwind label %106

94:                                               ; preds = %90
  store i32 %93, ptr %24, align 4, !tbaa !22
  %95 = load i32, ptr %24, align 4, !tbaa !22
  %96 = icmp eq i32 %95, 0
  br i1 %96, label %97, label %110

97:                                               ; preds = %94
  %98 = load ptr, ptr %23, align 8, !tbaa !5
  %99 = getelementptr inbounds ptr, ptr %98, i64 0
  %100 = load ptr, ptr %99, align 8, !tbaa !5
  %101 = invoke ptr @ba_copy_with_alloc(ptr noundef %100, i64 noundef 0, i64 noundef 0)
          to label %102 unwind label %106

102:                                              ; preds = %97
  %103 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %101, ptr %103, align 8, !tbaa !5
  %104 = load ptr, ptr %23, align 8, !tbaa !5
  invoke void @_ZN14CmStorageProxy13arrayCmbaFreeEjPP12CM_BYTEARRAY(ptr noundef nonnull align 8 dereferenceable(168) %25, i32 noundef 1, ptr noundef %104)
          to label %105 unwind label %106

105:                                              ; preds = %102
  br label %110

106:                                              ; preds = %102, %97, %90
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %17, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  br label %112

110:                                              ; preds = %105, %94
  %111 = load i32, ptr %24, align 4, !tbaa !22
  store i32 %111, 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 @_ZNSt6vectorIPK12ByteArray_stSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #4
  call void @llvm.lifetime.end.p0(i64 24, 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 %113

112:                                              ; preds = %106, %68
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #4
  call void @llvm.lifetime.end.p0(i64 24, 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 %115

113:                                              ; preds = %110, %61, %45, %38, %29
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %114 = load i32, ptr %8, align 4
  ret i32 %114

115:                                              ; preds = %112, %30
  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 %116

116:                                              ; preds = %115
  %117 = load ptr, ptr %17, align 8
  %118 = load i32, ptr %18, align 4
  %119 = insertvalue { ptr, i32 } poison, ptr %117, 0
  %120 = insertvalue { ptr, i32 } %119, i32 %118, 1
  resume { ptr, i32 } %120
}

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 120}
!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

; 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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14CmStorageProxy14keyDhUnwrapKeyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_PK12ByteArray_stSA_SA_PPS8_(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 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 ptr, align 8
  %11 = alloca %"class.std::lock_guard", align 8
  %12 = alloca %"class.std::vector.3", align 8
  %13 = alloca %"class.std::vector.3", align 8
  %14 = alloca %"class.std::vector.3", align 8
  %15 = alloca ptr, align 8
  store ptr %3, ptr %8, align 8, !tbaa !5
  store ptr %4, ptr %9, align 8, !tbaa !5
  store ptr %5, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %16 = getelementptr inbounds i8, ptr %0, i64 112
  call void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(40) %16)
  %17 = call noundef zeroext i1 @_ZNK14CmStorageProxy15isOpenedStorageEv(ptr noundef nonnull align 8 dereferenceable(168) %0)
  br i1 %17, label %18, label %65

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

21:                                               ; preds = %18
  %22 = getelementptr inbounds i8, ptr %20, i64 120
  %23 = load ptr, ptr %22, align 8, !tbaa !19
  %.not21 = icmp eq ptr %23, null
  br i1 %.not21, label %65, label %24

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

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

31:                                               ; preds = %26
  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
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  invoke void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %32 unwind label %34

32:                                               ; preds = %31
  %.not22 = icmp eq ptr %4, null
  br i1 %.not22, label %36, label %33

33:                                               ; preds = %32
  invoke void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %36 unwind label %34

34:                                               ; preds = %36, %33, %31
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %64

36:                                               ; preds = %33, %32
  invoke void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %37 unwind label %34

37:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #4
  store ptr null, ptr %15, align 8, !tbaa !5
  %38 = load ptr, ptr %19, align 8, !tbaa !9
  %39 = getelementptr inbounds i8, ptr %38, i64 120
  %40 = load ptr, ptr %39, align 8, !tbaa !19
  %41 = getelementptr inbounds i8, ptr %0, i64 152
  %42 = load ptr, ptr %41, align 8, !tbaa !21
  %43 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  %44 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  %45 = call noundef ptr @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %.not23 = icmp eq ptr %46, null
  br i1 %.not23, label %49, label %47

47:                                               ; preds = %37
  %48 = call noundef ptr @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  br label %49

49:                                               ; preds = %37, %47
  %50 = phi ptr [ %48, %47 ], [ null, %37 ]
  %51 = call noundef ptr @_ZNSt6vectorIPK12ByteArray_stSaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %52 = invoke noundef i32 %40(ptr noundef %42, ptr noundef %43, ptr noundef %44, i32 noundef 1, ptr noundef %45, ptr noundef %50, ptr noundef %51, ptr noundef nonnull %15)
          to label %53 unwind label %61

53:                                               ; preds = %49
  %54 = icmp eq i32 %52, 0
  br i1 %54, label %55, label %63

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

59:                                               ; preds = %55
  store ptr %58, ptr %6, align 8, !tbaa !5
  %60 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void @_ZN14CmStorageProxy13arrayCmbaFreeEjPP12CM_BYTEARRAY(ptr noundef nonnull align 8 dereferenceable(168) %0, i32 noundef 1, ptr noundef %60)
          to label %63 unwind label %61

61:                                               ; preds = %59, %55, %49
  %62 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #4
  br label %64

63:                                               ; preds = %59, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  call void @llvm.lifetime.end.p0(i64 24, 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
  br label %65

64:                                               ; preds = %61, %34
  %.pn = phi { ptr, i32 } [ %62, %61 ], [ %35, %34 ]
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #4
  call void @_ZNSt6vectorIPK12ByteArray_stSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  call void @llvm.lifetime.end.p0(i64 24, 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 @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  resume { ptr, i32 } %.pn

65:                                               ; preds = %24, %26, %21, %18, %7, %63
  %.0 = phi i32 [ %52, %63 ], [ 4121, %7 ], [ 4108, %18 ], [ 4118, %21 ], [ 4101, %26 ], [ 4101, %24 ]
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  ret i32 %.0
}

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 120}
!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,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass