; LLVM IR from specinfo-ua/UAPKI :: library/uapki/src/doc-sign.ll (ZN7UapkiNS3Doc4Sign10SigningDoc4initEPKNS2_10SignParamsE)

; 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.__gnu_cxx::__normal_iterator.24" = type { ptr }
%"class.UapkiNS::Doc::Sign::SigningDoc" = type { ptr, %"class.UapkiNS::Pkcs7::SignedDataBuilder", ptr, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i8, %"class.UapkiNS::ContentHasher", %"class.UapkiNS::SmartBA", %"class.UapkiNS::SmartBA", %"class.UapkiNS::SmartBA", %"class.std::__cxx11::basic_string", %"class.UapkiNS::Pkcs7::ArchiveTs3Helper", %"class.std::vector.3", %"class.std::vector.18", %"class.std::vector.18" }
%"class.UapkiNS::Pkcs7::SignedDataBuilder" = type { ptr, %"class.std::vector.8", ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<UapkiNS::Pkcs7::SignedDataBuilder::SignerInfo *, std::allocator<UapkiNS::Pkcs7::SignedDataBuilder::SignerInfo *>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::Pkcs7::SignedDataBuilder::SignerInfo *, std::allocator<UapkiNS::Pkcs7::SignedDataBuilder::SignerInfo *>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::Pkcs7::SignedDataBuilder::SignerInfo *, std::allocator<UapkiNS::Pkcs7::SignedDataBuilder::SignerInfo *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::Pkcs7::SignedDataBuilder::SignerInfo *, std::allocator<UapkiNS::Pkcs7::SignedDataBuilder::SignerInfo *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.UapkiNS::ContentHasher" = type { i32, i32, ptr, i8, %"class.std::__cxx11::basic_string", ptr, i64, %"class.UapkiNS::SmartBA" }
%"class.UapkiNS::SmartBA" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.UapkiNS::Pkcs7::ArchiveTs3Helper" = type { ptr, i32, %"struct.UapkiNS::Pkcs7::ArchiveTs3Helper::ATSHashIndex", %struct.anon, %"class.UapkiNS::SmartBA" }
%"struct.UapkiNS::Pkcs7::ArchiveTs3Helper::ATSHashIndex" = type { %"class.UapkiNS::VectorBA", %"class.UapkiNS::VectorBA", %"class.UapkiNS::VectorBA" }
%"class.UapkiNS::VectorBA" = type { %"class.std::vector.13" }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = 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 }
%struct.anon = type { %"class.UapkiNS::SmartBA", %"class.UapkiNS::SmartBA", %"class.UapkiNS::SmartBA", %"class.UapkiNS::SmartBA" }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<UapkiNS::Doc::Sign::SigningDoc::CerDataItem *, std::allocator<UapkiNS::Doc::Sign::SigningDoc::CerDataItem *>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::Doc::Sign::SigningDoc::CerDataItem *, std::allocator<UapkiNS::Doc::Sign::SigningDoc::CerDataItem *>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::Doc::Sign::SigningDoc::CerDataItem *, std::allocator<UapkiNS::Doc::Sign::SigningDoc::CerDataItem *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::Doc::Sign::SigningDoc::CerDataItem *, std::allocator<UapkiNS::Doc::Sign::SigningDoc::CerDataItem *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.18" = type { %"struct.std::_Vector_base.19" }
%"struct.std::_Vector_base.19" = type { %"struct.std::_Vector_base<UapkiNS::Attribute *, std::allocator<UapkiNS::Attribute *>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::Attribute *, std::allocator<UapkiNS::Attribute *>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::Attribute *, std::allocator<UapkiNS::Attribute *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::Attribute *, std::allocator<UapkiNS::Attribute *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.UapkiNS::Doc::Sign::SigningDoc::SignParams" = type { i32, i8, i8, i32, i32, %"struct.UapkiNS::AlgorithmIdentifier", %"struct.UapkiNS::AlgorithmIdentifier", %"struct.UapkiNS::Doc::Sign::SigningDoc::CerDataItem", %"class.UapkiNS::SmartBA", i8, i8, i8, i8, i8, i8, %"struct.UapkiNS::LibraryConfig::OcspParams", %"struct.UapkiNS::LibraryConfig::TspParams", %"struct.UapkiNS::Attribute", %"struct.UapkiNS::Attribute", %"class.std::vector.3" }
%"struct.UapkiNS::AlgorithmIdentifier" = type { %"class.std::__cxx11::basic_string", ptr }
%"struct.UapkiNS::Doc::Sign::SigningDoc::CerDataItem" = type { ptr, ptr, i8, %"class.UapkiNS::SmartBA", %"class.UapkiNS::SmartBA", %"class.UapkiNS::SmartBA", ptr, ptr }
%"struct.UapkiNS::LibraryConfig::OcspParams" = type { i64 }
%"struct.UapkiNS::LibraryConfig::TspParams" = type { i8, i8, i64, %"class.std::__cxx11::basic_string", %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.UapkiNS::Attribute" = type { %"class.std::__cxx11::basic_string", ptr }

@.str = external hidden unnamed_addr constant [19 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7UapkiNS3Doc4Sign10SigningDoc11CerDataItem3setERKS3_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) #0 align 2

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS3Doc4Sign10SigningDoc4initEPKNS2_10SignParamsE(ptr noundef nonnull align 8 dereferenceable(464) %0, ptr noundef %1) #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.24", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.24", align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 0
  store ptr %18, ptr %19, align 8, !tbaa !9
  %20 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = icmp ne ptr %21, null
  br i1 %22, label %24, label %23

23:                                               ; preds = %2
  store i32 4101, ptr %3, align 4
  br label %172

24:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !40
  %25 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = getelementptr inbounds %"struct.UapkiNS::Doc::Sign::SigningDoc::SignParams", ptr %26, i32 0, i32 0
  %28 = load i32, ptr %27, align 8, !tbaa !42
  %29 = icmp ne i32 %28, 1
  br i1 %29, label %30, label %168

30:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %31 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 1
  %32 = call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder4initEv(ptr noundef nonnull align 8 dereferenceable(40) %31)
  store i32 %32, ptr %7, align 4, !tbaa !40
  %33 = load i32, ptr %7, align 4, !tbaa !40
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %37

35:                                               ; preds = %30
  %36 = load i32, ptr %7, align 4, !tbaa !40
  store i32 %36, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %165

37:                                               ; preds = %30
  %38 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 1
  %39 = call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder13addSignerInfoEv(ptr noundef nonnull align 8 dereferenceable(40) %38)
  store i32 %39, ptr %7, align 4, !tbaa !40
  %40 = load i32, ptr %7, align 4, !tbaa !40
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %44

42:                                               ; preds = %37
  %43 = load i32, ptr %7, align 4, !tbaa !40
  store i32 %43, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %165

44:                                               ; preds = %37
  %45 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 1
  %46 = call noundef ptr @_ZNK7UapkiNS5Pkcs717SignedDataBuilder13getSignerInfoEm(ptr noundef nonnull align 8 dereferenceable(40) %45, i64 noundef 0)
  %47 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 2
  store ptr %46, ptr %47, align 8, !tbaa !54
  %48 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 2
  %49 = load ptr, ptr %48, align 8, !tbaa !54
  %50 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  %52 = getelementptr inbounds %"struct.UapkiNS::Doc::Sign::SigningDoc::SignParams", ptr %51, i32 0, i32 5
  %53 = call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo18setDigestAlgorithmERKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(80) %49, ptr noundef nonnull align 8 dereferenceable(40) %52)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.UapkiNS::Doc::Sign::SigningDoc::SignParams", ptr %54, i32 0, i32 19
  store ptr %55, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = call ptr @_ZNKSt6vectorIPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESaIS5_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %56) #7
  %58 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.24", ptr %10, i32 0, i32 0
  store ptr %57, ptr %58, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = call ptr @_ZNKSt6vectorIPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESaIS5_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %59) #7
  %61 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.24", ptr %11, i32 0, i32 0
  store ptr %60, ptr %61, align 8
  br label %62

62:                                               ; preds = %96, %44
  %63 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESt6vectorIS6_SaIS6_EEEEbRKNS_17__normal_iteratorIT_T0_EESH_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br i1 %63, label %65, label %64

64:                                               ; preds = %62
  store i32 2, ptr %8, align 4
  br label %98

65:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESt6vectorIS6_SaIS6_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  store ptr %66, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %67 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 64) #8
  invoke void @_ZN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemC1Ev(ptr noundef nonnull align 8 dereferenceable(64) %67)
          to label %68 unwind label %72

68:                                               ; preds = %65
  store ptr %67, ptr %13, align 8, !tbaa !5
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = icmp ne ptr %69, null
  br i1 %70, label %76, label %71

71:                                               ; preds = %68
  store i32 4097, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %90

72:                                               ; preds = %65
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %14, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %15, align 4
  call void @_ZdlPvm(ptr noundef %67, i64 noundef 64) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %174

76:                                               ; preds = %68
  %77 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 12
  call void @_ZNSt6vectorIPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESaIS5_EE9push_backERKS5_(ptr noundef nonnull align 8 dereferenceable(24) %77, ptr noundef nonnull align 8 dereferenceable(8) %13)
  br label %78

78:                                               ; preds = %76
  %79 = load ptr, ptr %13, align 8, !tbaa !5
  %80 = load ptr, ptr %12, align 8, !tbaa !5
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = call noundef i32 @_ZN7UapkiNS3Doc4Sign10SigningDoc11CerDataItem3setERKS3_(ptr noundef nonnull align 8 dereferenceable(64) %79, ptr noundef nonnull align 8 dereferenceable(64) %81)
  store i32 %82, ptr %7, align 4, !tbaa !40
  %83 = load i32, ptr %7, align 4, !tbaa !40
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %87

85:                                               ; preds = %78
  %86 = load i32, ptr %7, align 4, !tbaa !40
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 211, i32 noundef %86)
  store i32 6, ptr %8, align 4
  br label %90

87:                                               ; preds = %78
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88
  store i32 0, ptr %8, align 4
  br label %90

90:                                               ; preds = %89, %85, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  %91 = load i32, ptr %8, align 4
  switch i32 %91, label %93 [
    i32 0, label %92
  ]

92:                                               ; preds = %90
  store i32 0, ptr %8, align 4
  br label %93

93:                                               ; preds = %92, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %94 = load i32, ptr %8, align 4
  switch i32 %94, label %98 [
    i32 0, label %95
  ]

95:                                               ; preds = %93
  br label %96

96:                                               ; preds = %95
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESt6vectorIS6_SaIS6_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br label %62

98:                                               ; preds = %93, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  %99 = load i32, ptr %8, align 4
  switch i32 %99, label %165 [
    i32 2, label %100
  ]

100:                                              ; preds = %98
  br label %101

101:                                              ; preds = %100
  %102 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 11
  %103 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8, !tbaa !9
  %105 = getelementptr inbounds %"struct.UapkiNS::Doc::Sign::SigningDoc::SignParams", ptr %104, i32 0, i32 0
  %106 = load i32, ptr %105, align 8, !tbaa !42
  %107 = icmp eq i32 %106, 7
  br i1 %107, label %108, label %112

108:                                              ; preds = %101
  %109 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !9
  %111 = getelementptr inbounds %"struct.UapkiNS::Doc::Sign::SigningDoc::SignParams", ptr %110, i32 0, i32 5
  br label %113

112:                                              ; preds = %101
  br label %113

113:                                              ; preds = %112, %108
  %114 = phi ptr [ %111, %108 ], [ null, %112 ]
  %115 = call noundef i32 @_ZN7UapkiNS5Pkcs716ArchiveTs3Helper4initEPKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(128) %102, ptr noundef %114)
  store i32 %115, ptr %7, align 4, !tbaa !40
  %116 = load i32, ptr %7, align 4, !tbaa !40
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %120

118:                                              ; preds = %113
  %119 = load i32, ptr %7, align 4, !tbaa !40
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 217, i32 noundef %119)
  store i32 6, ptr %8, align 4
  br label %165

120:                                              ; preds = %113
  br label %121

121:                                              ; preds = %120
  br label %122

122:                                              ; preds = %121
  %123 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !9
  %125 = getelementptr inbounds %"struct.UapkiNS::Doc::Sign::SigningDoc::SignParams", ptr %124, i32 0, i32 10
  %126 = load i8, ptr %125, align 1, !tbaa !55, !range !56, !noundef !57
  %127 = trunc i8 %126 to i1
  br i1 %127, label %128, label %164

128:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %129 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !9
  %131 = getelementptr inbounds %"struct.UapkiNS::Doc::Sign::SigningDoc::SignParams", ptr %130, i32 0, i32 7
  %132 = getelementptr inbounds %"struct.UapkiNS::Doc::Sign::SigningDoc::CerDataItem", ptr %131, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !58
  %134 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem10getEncodedEv(ptr noundef nonnull align 8 dereferenceable(401) %133)
  store ptr %134, ptr %16, align 8, !tbaa !5
  br label %135

135:                                              ; preds = %128
  %136 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 1
  %137 = load ptr, ptr %16, align 8, !tbaa !5
  %138 = call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder14addCertificateEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(40) %136, ptr noundef %137)
  store i32 %138, ptr %7, align 4, !tbaa !40
  %139 = load i32, ptr %7, align 4, !tbaa !40
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %141, label %143

141:                                              ; preds = %135
  %142 = load i32, ptr %7, align 4, !tbaa !40
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 221, i32 noundef %142)
  store i32 6, ptr %8, align 4
  br label %161

143:                                              ; preds = %135
  br label %144

144:                                              ; preds = %143
  br label %145

145:                                              ; preds = %144
  %146 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 11
  %147 = call noundef zeroext i1 @_ZNK7UapkiNS5Pkcs716ArchiveTs3Helper9isEnabledEv(ptr noundef nonnull align 8 dereferenceable(128) %146)
  br i1 %147, label %148, label %160

148:                                              ; preds = %145
  br label %149

149:                                              ; preds = %148
  %150 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %17, i32 0, i32 11
  %151 = load ptr, ptr %16, align 8, !tbaa !5
  %152 = call noundef i32 @_ZN7UapkiNS5Pkcs716ArchiveTs3Helper14addCertificateEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(128) %150, ptr noundef %151)
  store i32 %152, ptr %7, align 4, !tbaa !40
  %153 = load i32, ptr %7, align 4, !tbaa !40
  %154 = icmp ne i32 %153, 0
  br i1 %154, label %155, label %157

155:                                              ; preds = %149
  %156 = load i32, ptr %7, align 4, !tbaa !40
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 223, i32 noundef %156)
  store i32 6, ptr %8, align 4
  br label %161

157:                                              ; preds = %149
  br label %158

158:                                              ; preds = %157
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159, %145
  store i32 0, ptr %8, align 4
  br label %161

161:                                              ; preds = %160, %155, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  %162 = load i32, ptr %8, align 4
  switch i32 %162, label %165 [
    i32 0, label %163
  ]

163:                                              ; preds = %161
  br label %164

164:                                              ; preds = %163, %122
  store i32 0, ptr %8, align 4
  br label %165

165:                                              ; preds = %164, %161, %118, %98, %42, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  %166 = load i32, ptr %8, align 4
  switch i32 %166, label %171 [
    i32 0, label %167
    i32 6, label %169
  ]

167:                                              ; preds = %165
  br label %168

168:                                              ; preds = %167, %24
  br label %169

169:                                              ; preds = %168, %165
  %170 = load i32, ptr %6, align 4, !tbaa !40
  store i32 %170, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %171

171:                                              ; preds = %169, %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %172

172:                                              ; preds = %171, %23
  %173 = load i32, ptr %3, align 4
  ret i32 %173

174:                                              ; preds = %72
  %175 = load ptr, ptr %14, align 8
  %176 = load i32, ptr %15, align 4
  %177 = insertvalue { ptr, i32 } poison, ptr %175, 0
  %178 = insertvalue { ptr, i32 } %177, i32 %176, 1
  resume { ptr, i32 } %178
}

declare noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder4initEv(ptr noundef nonnull align 8 dereferenceable(40)) #3

declare noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder13addSignerInfoEv(ptr noundef nonnull align 8 dereferenceable(40)) #3

declare noundef ptr @_ZNK7UapkiNS5Pkcs717SignedDataBuilder13getSignerInfoEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #3

declare noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo18setDigestAlgorithmERKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(40)) #3

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESt6vectorIS6_SaIS6_EEEEbRKNS_17__normal_iteratorIT_T0_EESH_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #6

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

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) #3

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

declare noundef i32 @_ZN7UapkiNS5Pkcs716ArchiveTs3Helper4initEPKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7UapkiNS4Cert7CerItem10getEncodedEv(ptr noundef nonnull align 8 dereferenceable(401)) #4 align 2

declare noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder14addCertificateEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7UapkiNS5Pkcs716ArchiveTs3Helper9isEnabledEv(ptr noundef nonnull align 8 dereferenceable(128)) #4 align 2

declare noundef i32 @_ZN7UapkiNS5Pkcs716ArchiveTs3Helper14addCertificateEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef) #3

declare void @_ZN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemC1Ev(ptr)

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { 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 #5 = { inlinehint 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 #6 = { nobuiltin allocsize(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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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 0}
!10 = !{!"_ZTSN7UapkiNS3Doc4Sign10SigningDocE", !6, i64 0, !11, i64 8, !6, i64 48, !16, i64 56, !16, i64 88, !19, i64 120, !20, i64 128, !23, i64 208, !23, i64 216, !23, i64 224, !16, i64 232, !24, i64 264, !32, i64 392, !36, i64 416, !36, i64 440}
!11 = !{!"_ZTSN7UapkiNS5Pkcs717SignedDataBuilderE", !6, i64 0, !12, i64 8, !6, i64 32}
!12 = !{!"_ZTSSt6vectorIPN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfoESaIS4_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIPN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfoESaIS4_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfoESaIS4_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfoESaIS4_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !17, i64 0, !18, i64 8, !7, i64 16}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTSN7UapkiNS13ContentHasherE", !21, i64 0, !22, i64 4, !6, i64 8, !19, i64 16, !16, i64 24, !6, i64 56, !18, i64 64, !23, i64 72}
!21 = !{!"_ZTSN7UapkiNS13ContentHasher10SourceTypeE", !7, i64 0}
!22 = !{!"_ZTS7HashAlg", !7, i64 0}
!23 = !{!"_ZTSN7UapkiNS7SmartBAE", !6, i64 0}
!24 = !{!"_ZTSN7UapkiNS5Pkcs716ArchiveTs3HelperE", !6, i64 0, !22, i64 8, !25, i64 16, !31, i64 88, !23, i64 120}
!25 = !{!"_ZTSN7UapkiNS5Pkcs716ArchiveTs3Helper12ATSHashIndexE", !26, i64 0, !26, i64 24, !26, i64 48}
!26 = !{!"_ZTSN7UapkiNS8VectorBAE", !27, i64 0}
!27 = !{!"_ZTSSt6vectorIP12ByteArray_stSaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIP12ByteArray_stSaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIP12ByteArray_stSaIS1_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIP12ByteArray_stSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!"_ZTSN7UapkiNS5Pkcs716ArchiveTs3HelperUt_E", !23, i64 0, !23, i64 8, !23, i64 16, !23, i64 24}
!32 = !{!"_ZTSSt6vectorIPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESaIS5_EE", !33, i64 0}
!33 = !{!"_ZTSSt12_Vector_baseIPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESaIS5_EE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESaIS5_EE12_Vector_implE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!36 = !{!"_ZTSSt6vectorIPN7UapkiNS9AttributeESaIS2_EE", !37, i64 0}
!37 = !{!"_ZTSSt12_Vector_baseIPN7UapkiNS9AttributeESaIS2_EE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS9AttributeESaIS2_EE12_Vector_implE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS9AttributeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!40 = !{!41, !41, i64 0}
!41 = !{!"int", !7, i64 0}
!42 = !{!43, !44, i64 0}
!43 = !{!"_ZTSN7UapkiNS3Doc4Sign10SigningDoc10SignParamsE", !44, i64 0, !19, i64 4, !19, i64 5, !22, i64 8, !22, i64 12, !45, i64 16, !45, i64 56, !46, i64 96, !23, i64 160, !19, i64 168, !19, i64 169, !19, i64 170, !19, i64 171, !19, i64 172, !19, i64 173, !47, i64 176, !48, i64 184, !53, i64 256, !53, i64 296, !32, i64 336}
!44 = !{!"_ZTSN7UapkiNS15SignatureFormatE", !7, i64 0}
!45 = !{!"_ZTSN7UapkiNS19AlgorithmIdentifierE", !16, i64 0, !6, i64 32}
!46 = !{!"_ZTSN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemE", !6, i64 0, !6, i64 8, !19, i64 16, !23, i64 24, !23, i64 32, !23, i64 40, !6, i64 48, !6, i64 56}
!47 = !{!"_ZTSN7UapkiNS13LibraryConfig10OcspParamsE", !18, i64 0}
!48 = !{!"_ZTSN7UapkiNS13LibraryConfig9TspParamsE", !19, i64 0, !19, i64 1, !18, i64 8, !16, i64 16, !49, i64 48}
!49 = !{!"_ZTSSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !50, i64 0}
!50 = !{!"_ZTSSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !51, i64 0}
!51 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_Vector_implE", !52, i64 0}
!52 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!53 = !{!"_ZTSN7UapkiNS9AttributeE", !16, i64 0, !6, i64 32}
!54 = !{!10, !6, i64 48}
!55 = !{!43, !19, i64 169}
!56 = !{i8 0, i8 2}
!57 = !{}
!58 = !{!43, !6, i64 96}


; 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.__gnu_cxx::__normal_iterator.24" = type { ptr }

@.str = external hidden unnamed_addr constant [19 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7UapkiNS3Doc4Sign10SigningDoc11CerDataItem3setERKS3_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS3Doc4Sign10SigningDoc4initEPKNS2_10SignParamsE(ptr noundef nonnull align 8 dereferenceable(464) %0, ptr noundef %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator.24", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.24", align 8
  %5 = alloca ptr, align 8
  store ptr %1, ptr %0, align 8, !tbaa !5
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %.thread57, label %6

6:                                                ; preds = %2
  %7 = load i32, ptr %1, align 8, !tbaa !39
  %.not42 = icmp eq i32 %7, 1
  br i1 %.not42, label %.thread57, label %8

8:                                                ; preds = %6
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = tail call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder4initEv(ptr noundef nonnull align 8 dereferenceable(40) %9)
  %.not43 = icmp eq i32 %10, 0
  br i1 %.not43, label %11, label %.thread57

11:                                               ; preds = %8
  %12 = tail call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder13addSignerInfoEv(ptr noundef nonnull align 8 dereferenceable(40) %9)
  %.not44 = icmp eq i32 %12, 0
  br i1 %.not44, label %13, label %.thread57

13:                                               ; preds = %11
  %14 = tail call noundef ptr @_ZNK7UapkiNS5Pkcs717SignedDataBuilder13getSignerInfoEm(ptr noundef nonnull align 8 dereferenceable(40) %9, i64 noundef 0)
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %14, ptr %15, align 8, !tbaa !51
  %16 = load ptr, ptr %0, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  %18 = tail call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo18setDigestAlgorithmERKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(80) %14, ptr noundef nonnull align 8 dereferenceable(40) %17)
  %19 = getelementptr inbounds i8, ptr %1, i64 336
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %20 = tail call ptr @_ZNKSt6vectorIPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESaIS5_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #7
  store ptr %20, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %21 = tail call ptr @_ZNKSt6vectorIPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESaIS5_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #7
  store ptr %21, ptr %4, align 8
  %22 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESt6vectorIS6_SaIS6_EEEEbRKNS_17__normal_iteratorIT_T0_EESH_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %13
  %23 = getelementptr inbounds i8, ptr %0, i64 392
  br label %24

24:                                               ; preds = %.lr.ph, %33
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESt6vectorIS6_SaIS6_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %26 = call noalias noundef nonnull dereferenceable(64) ptr @_Znwm(i64 noundef 64) #8
  invoke void @_ZN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemC1Ev(ptr noundef nonnull align 8 dereferenceable(64) %26)
          to label %27 unwind label %31

27:                                               ; preds = %24
  store ptr %26, ptr %5, align 8, !tbaa !52
  call void @_ZNSt6vectorIPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESaIS5_EE9push_backERKS5_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %28 = load ptr, ptr %5, align 8, !tbaa !52
  %29 = load ptr, ptr %25, align 8, !tbaa !52
  %30 = call noundef i32 @_ZN7UapkiNS3Doc4Sign10SigningDoc11CerDataItem3setERKS3_(ptr noundef nonnull align 8 dereferenceable(64) %28, ptr noundef nonnull align 8 dereferenceable(64) %29)
  %.not45 = icmp eq i32 %30, 0
  br i1 %.not45, label %33, label %36

31:                                               ; preds = %24
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %26, i64 noundef 64) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  resume { ptr, i32 } %32

33:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESt6vectorIS6_SaIS6_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %35 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESt6vectorIS6_SaIS6_EEEEbRKNS_17__normal_iteratorIT_T0_EESH_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br i1 %35, label %24, label %._crit_edge

36:                                               ; preds = %27
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 211, i32 noundef %30)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %.thread57

._crit_edge:                                      ; preds = %33, %13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %37 = getelementptr inbounds i8, ptr %0, i64 264
  %38 = load ptr, ptr %0, align 8, !tbaa !5
  %39 = load i32, ptr %38, align 8, !tbaa !39
  %40 = icmp eq i32 %39, 7
  %41 = getelementptr inbounds i8, ptr %38, i64 16
  %spec.select = select i1 %40, ptr %41, ptr null
  %42 = call noundef i32 @_ZN7UapkiNS5Pkcs716ArchiveTs3Helper4initEPKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(128) %37, ptr noundef %spec.select)
  %.not46 = icmp eq i32 %42, 0
  br i1 %.not46, label %44, label %43

43:                                               ; preds = %._crit_edge
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 217, i32 noundef %42)
  br label %.thread57

44:                                               ; preds = %._crit_edge
  %45 = load ptr, ptr %0, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 169
  %47 = load i8, ptr %46, align 1, !tbaa !53, !range !54, !noundef !55
  %48 = trunc nuw i8 %47 to i1
  br i1 %48, label %49, label %.thread57

49:                                               ; preds = %44
  %50 = getelementptr inbounds i8, ptr %45, i64 96
  %51 = load ptr, ptr %50, align 8, !tbaa !56
  %52 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem10getEncodedEv(ptr noundef nonnull align 8 dereferenceable(401) %51)
  %53 = call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder14addCertificateEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef %52)
  %.not47 = icmp eq i32 %53, 0
  br i1 %.not47, label %55, label %54

54:                                               ; preds = %49
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 221, i32 noundef %53)
  br label %.thread57

55:                                               ; preds = %49
  %56 = call noundef zeroext i1 @_ZNK7UapkiNS5Pkcs716ArchiveTs3Helper9isEnabledEv(ptr noundef nonnull align 8 dereferenceable(128) %37)
  br i1 %56, label %57, label %.thread57

57:                                               ; preds = %55
  %58 = call noundef i32 @_ZN7UapkiNS5Pkcs716ArchiveTs3Helper14addCertificateEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(128) %37, ptr noundef %52)
  %.not48 = icmp eq i32 %58, 0
  br i1 %.not48, label %.thread57, label %59

59:                                               ; preds = %57
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 223, i32 noundef %58)
  br label %.thread57

.thread57:                                        ; preds = %55, %57, %44, %59, %54, %36, %43, %6, %8, %11, %2
  %.5 = phi i32 [ 4101, %2 ], [ %10, %8 ], [ %12, %11 ], [ 0, %6 ], [ 0, %43 ], [ 0, %36 ], [ 0, %54 ], [ 0, %59 ], [ 0, %44 ], [ 0, %57 ], [ 0, %55 ]
  ret i32 %.5
}

declare noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder4initEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3

declare noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder13addSignerInfoEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3

declare noundef ptr @_ZNK7UapkiNS5Pkcs717SignedDataBuilder13getSignerInfoEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #3

declare noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo18setDigestAlgorithmERKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESt6vectorIS6_SaIS6_EEEEbRKNS_17__normal_iteratorIT_T0_EESH_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #6

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

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #3

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

declare noundef i32 @_ZN7UapkiNS5Pkcs716ArchiveTs3Helper4initEPKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7UapkiNS4Cert7CerItem10getEncodedEv(ptr noundef nonnull align 8 dereferenceable(401)) local_unnamed_addr #4 align 2

declare noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder14addCertificateEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7UapkiNS5Pkcs716ArchiveTs3Helper9isEnabledEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #4 align 2

declare noundef i32 @_ZN7UapkiNS5Pkcs716ArchiveTs3Helper14addCertificateEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef) local_unnamed_addr #3

declare void @_ZN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemC1Ev(ptr) local_unnamed_addr

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { 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 #5 = { inlinehint 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 #6 = { nobuiltin allocsize(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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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, !7, i64 0}
!6 = !{!"_ZTSN7UapkiNS3Doc4Sign10SigningDocE", !7, i64 0, !10, i64 8, !7, i64 48, !15, i64 56, !15, i64 88, !18, i64 120, !19, i64 128, !22, i64 208, !22, i64 216, !22, i64 224, !15, i64 232, !23, i64 264, !31, i64 392, !35, i64 416, !35, i64 440}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN7UapkiNS5Pkcs717SignedDataBuilderE", !7, i64 0, !11, i64 8, !7, i64 32}
!11 = !{!"_ZTSSt6vectorIPN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfoESaIS4_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIPN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfoESaIS4_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfoESaIS4_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfoESaIS4_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !17, i64 8, !8, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!17 = !{!"long", !8, i64 0}
!18 = !{!"bool", !8, i64 0}
!19 = !{!"_ZTSN7UapkiNS13ContentHasherE", !20, i64 0, !21, i64 4, !7, i64 8, !18, i64 16, !15, i64 24, !7, i64 56, !17, i64 64, !22, i64 72}
!20 = !{!"_ZTSN7UapkiNS13ContentHasher10SourceTypeE", !8, i64 0}
!21 = !{!"_ZTS7HashAlg", !8, i64 0}
!22 = !{!"_ZTSN7UapkiNS7SmartBAE", !7, i64 0}
!23 = !{!"_ZTSN7UapkiNS5Pkcs716ArchiveTs3HelperE", !7, i64 0, !21, i64 8, !24, i64 16, !30, i64 88, !22, i64 120}
!24 = !{!"_ZTSN7UapkiNS5Pkcs716ArchiveTs3Helper12ATSHashIndexE", !25, i64 0, !25, i64 24, !25, i64 48}
!25 = !{!"_ZTSN7UapkiNS8VectorBAE", !26, i64 0}
!26 = !{!"_ZTSSt6vectorIP12ByteArray_stSaIS1_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIP12ByteArray_stSaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIP12ByteArray_stSaIS1_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIP12ByteArray_stSaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!30 = !{!"_ZTSN7UapkiNS5Pkcs716ArchiveTs3HelperUt_E", !22, i64 0, !22, i64 8, !22, i64 16, !22, i64 24}
!31 = !{!"_ZTSSt6vectorIPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESaIS5_EE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseIPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESaIS5_EE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESaIS5_EE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemESaIS5_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!35 = !{!"_ZTSSt6vectorIPN7UapkiNS9AttributeESaIS2_EE", !36, i64 0}
!36 = !{!"_ZTSSt12_Vector_baseIPN7UapkiNS9AttributeESaIS2_EE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS9AttributeESaIS2_EE12_Vector_implE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS9AttributeESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!39 = !{!40, !41, i64 0}
!40 = !{!"_ZTSN7UapkiNS3Doc4Sign10SigningDoc10SignParamsE", !41, i64 0, !18, i64 4, !18, i64 5, !21, i64 8, !21, i64 12, !42, i64 16, !42, i64 56, !43, i64 96, !22, i64 160, !18, i64 168, !18, i64 169, !18, i64 170, !18, i64 171, !18, i64 172, !18, i64 173, !44, i64 176, !45, i64 184, !50, i64 256, !50, i64 296, !31, i64 336}
!41 = !{!"_ZTSN7UapkiNS15SignatureFormatE", !8, i64 0}
!42 = !{!"_ZTSN7UapkiNS19AlgorithmIdentifierE", !15, i64 0, !7, i64 32}
!43 = !{!"_ZTSN7UapkiNS3Doc4Sign10SigningDoc11CerDataItemE", !7, i64 0, !7, i64 8, !18, i64 16, !22, i64 24, !22, i64 32, !22, i64 40, !7, i64 48, !7, i64 56}
!44 = !{!"_ZTSN7UapkiNS13LibraryConfig10OcspParamsE", !17, i64 0}
!45 = !{!"_ZTSN7UapkiNS13LibraryConfig9TspParamsE", !18, i64 0, !18, i64 1, !17, i64 8, !15, i64 16, !46, i64 48}
!46 = !{!"_ZTSSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !47, i64 0}
!47 = !{!"_ZTSSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !48, i64 0}
!48 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_Vector_implE", !49, i64 0}
!49 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!50 = !{!"_ZTSN7UapkiNS9AttributeE", !15, i64 0, !7, i64 32}
!51 = !{!6, !7, i64 48}
!52 = !{!7, !7, i64 0}
!53 = !{!40, !18, i64 169}
!54 = !{i8 0, i8 2}
!55 = !{}
!56 = !{!40, !7, i64 96}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass