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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14CmStorageProxy7keySignERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPK12ByteArray_stRKSt6vectorIPS8_SaISC_EERSE_(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %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 ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i64, 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
  %19 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %20 = getelementptr inbounds %class.CmStorageProxy, ptr %19, i32 0, i32 3
  call void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(40) %20)
  %21 = invoke noundef zeroext i1 @_ZNK14CmStorageProxy15isOpenedStorageEv(ptr noundef nonnull align 8 dereferenceable(168) %19)
          to label %22 unwind label %24

22:                                               ; preds = %5
  br i1 %21, label %28, label %23

23:                                               ; preds = %22
  store i32 4121, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %104

24:                                               ; preds = %5
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %13, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %14, align 4
  br label %106

28:                                               ; preds = %22
  %29 = getelementptr inbounds %class.CmStorageProxy, ptr %19, i32 0, i32 5
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = icmp ne ptr %30, null
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 4108, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %104

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

39:                                               ; preds = %33
  store i32 4118, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %104

40:                                               ; preds = %33
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = call noundef zeroext i1 @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #4
  br i1 %42, label %43, label %44

43:                                               ; preds = %40
  store i32 4101, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %104

44:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %45 = getelementptr inbounds %class.CmStorageProxy, ptr %19, i32 0, i32 5
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = getelementptr inbounds %struct.CM_KEY_API_ST, ptr %46, i32 0, i32 6
  %48 = load ptr, ptr %47, align 8, !tbaa !19
  %49 = getelementptr inbounds %class.CmStorageProxy, ptr %19, i32 0, i32 4
  %50 = load ptr, ptr %49, align 8, !tbaa !21
  %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 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = call noundef i64 @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #4
  %56 = trunc i64 %55 to i32
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = call noundef ptr @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %57) #4
  %59 = invoke noundef i32 %48(ptr noundef %50, ptr noundef %52, ptr noundef %53, i32 noundef %56, ptr noundef %58, ptr noundef %16)
          to label %60 unwind label %74

60:                                               ; preds = %44
  store i32 %59, ptr %17, align 4, !tbaa !22
  %61 = load i32, ptr %17, align 4, !tbaa !22
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %101

63:                                               ; preds = %60
  %64 = load ptr, ptr %11, align 8, !tbaa !5
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = call noundef i64 @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %65) #4
  invoke void @_ZNSt6vectorIP12ByteArray_stSaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %64, i64 noundef %66)
          to label %67 unwind label %74

67:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store i64 0, ptr %18, align 8, !tbaa !23
  br label %68

68:                                               ; preds = %88, %67
  %69 = load i64, ptr %18, align 8, !tbaa !23
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = call noundef i64 @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %70) #4
  %72 = icmp ult i64 %69, %71
  br i1 %72, label %78, label %73

73:                                               ; preds = %68
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %95

74:                                               ; preds = %95, %63, %44
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %13, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %14, align 4
  br label %103

78:                                               ; preds = %68
  %79 = load ptr, ptr %16, align 8, !tbaa !5
  %80 = load i64, ptr %18, align 8, !tbaa !23
  %81 = getelementptr inbounds ptr, ptr %79, i64 %80
  %82 = load ptr, ptr %81, align 8, !tbaa !5
  %83 = invoke ptr @ba_copy_with_alloc(ptr noundef %82, i64 noundef 0, i64 noundef 0)
          to label %84 unwind label %91

84:                                               ; preds = %78
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = load i64, ptr %18, align 8, !tbaa !23
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP12ByteArray_stSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %85, i64 noundef %86) #4
  store ptr %83, ptr %87, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %84
  %89 = load i64, ptr %18, align 8, !tbaa !23
  %90 = add i64 %89, 1
  store i64 %90, ptr %18, align 8, !tbaa !23
  br label %68, !llvm.loop !25

91:                                               ; preds = %78
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %13, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %103

95:                                               ; preds = %73
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = call noundef i64 @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %96) #4
  %98 = trunc i64 %97 to i32
  %99 = load ptr, ptr %16, align 8, !tbaa !5
  invoke void @_ZN14CmStorageProxy13arrayCmbaFreeEjPP12CM_BYTEARRAY(ptr noundef nonnull align 8 dereferenceable(168) %19, i32 noundef %98, ptr noundef %99)
          to label %100 unwind label %74

100:                                              ; preds = %95
  br label %101

101:                                              ; preds = %100, %60
  %102 = load i32, ptr %17, align 4, !tbaa !22
  store i32 %102, ptr %6, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %104

103:                                              ; preds = %91, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %106

104:                                              ; preds = %101, %43, %39, %32, %23
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %105 = load i32, ptr %6, align 4
  ret i32 %105

106:                                              ; preds = %103, %24
  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 %107

107:                                              ; preds = %106
  %108 = load ptr, ptr %13, align 8
  %109 = load i32, ptr %14, align 4
  %110 = insertvalue { ptr, i32 } poison, ptr %108, 0
  %111 = insertvalue { ptr, i32 } %110, i32 %109, 1
  resume { ptr, i32 } %111
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) #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 = !{!10, !6, i64 152}
!22 = !{!13, !13, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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

; 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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14CmStorageProxy7keySignERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPK12ByteArray_stRKSt6vectorIPS8_SaISC_EERSE_(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %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
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %8 = 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) %8)
  %9 = call noundef zeroext i1 @_ZNK14CmStorageProxy15isOpenedStorageEv(ptr noundef nonnull align 8 dereferenceable(168) %0)
  br i1 %9, label %10, label %52

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

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

16:                                               ; preds = %13
  %17 = call noundef zeroext i1 @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  br i1 %17, label %52, label %18

18:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  store ptr null, ptr %7, align 8, !tbaa !20
  %19 = load ptr, ptr %11, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 48
  %21 = load ptr, ptr %20, align 8, !tbaa !18
  %22 = getelementptr inbounds i8, ptr %0, i64 152
  %23 = load ptr, ptr %22, align 8, !tbaa !21
  %24 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  %25 = call noundef i64 @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %26 = trunc i64 %25 to i32
  %27 = call noundef ptr @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %28 = invoke noundef i32 %21(ptr noundef %23, ptr noundef %24, ptr noundef %2, i32 noundef %26, ptr noundef %27, ptr noundef nonnull %7)
          to label %29 unwind label %37

29:                                               ; preds = %18
  %30 = icmp eq i32 %28, 0
  br i1 %30, label %31, label %50

31:                                               ; preds = %29
  %32 = call noundef i64 @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  invoke void @_ZNSt6vectorIP12ByteArray_stSaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %32)
          to label %.preheader unwind label %37

.preheader:                                       ; preds = %31
  %33 = call noundef i64 @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %.not26 = icmp eq i64 %33, 0
  br i1 %.not26, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %43, %.preheader
  %34 = call noundef i64 @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %35 = trunc i64 %34 to i32
  %36 = load ptr, ptr %7, align 8, !tbaa !20
  invoke void @_ZN14CmStorageProxy13arrayCmbaFreeEjPP12CM_BYTEARRAY(ptr noundef nonnull align 8 dereferenceable(168) %0, i32 noundef %35, ptr noundef %36)
          to label %50 unwind label %37

37:                                               ; preds = %._crit_edge, %31, %18
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %51

.lr.ph:                                           ; preds = %.preheader, %43
  %.025 = phi i64 [ %45, %43 ], [ 0, %.preheader ]
  %39 = load ptr, ptr %7, align 8, !tbaa !20
  %40 = getelementptr inbounds ptr, ptr %39, i64 %.025
  %41 = load ptr, ptr %40, align 8, !tbaa !20
  %42 = invoke ptr @ba_copy_with_alloc(ptr noundef %41, i64 noundef 0, i64 noundef 0)
          to label %43 unwind label %48

43:                                               ; preds = %.lr.ph
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP12ByteArray_stSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.025) #4
  store ptr %42, ptr %44, align 8, !tbaa !20
  %45 = add nuw i64 %.025, 1
  %46 = call noundef i64 @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %47 = icmp ult i64 %45, %46
  br i1 %47, label %.lr.ph, label %._crit_edge, !llvm.loop !22

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

50:                                               ; preds = %._crit_edge, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br label %52

51:                                               ; preds = %48, %37
  %.pn = phi { ptr, i32 } [ %49, %48 ], [ %38, %37 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  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

52:                                               ; preds = %16, %13, %10, %5, %50
  %.019 = phi i32 [ %28, %50 ], [ 4121, %5 ], [ 4108, %10 ], [ 4118, %13 ], [ 4101, %16 ]
  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 %.019
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) local_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}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


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