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

; 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.23" = 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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN7UapkiNS9AttributeESt6vectorIS3_SaIS3_EEEppEv(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 zeroext i1 @_ZNK7UapkiNS5Pkcs716ArchiveTs3Helper9isEnabledEv(ptr noundef nonnull align 8 dereferenceable(128)) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS3Doc4Sign10SigningDoc21buildSignedAttributesEv(ptr noundef nonnull align 8 dereferenceable(464) %0) #4 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.23", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.23", align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %1
  %12 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 2
  %13 = load ptr, ptr %12, align 8, !tbaa !11
  %14 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 4
  %15 = call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo24addSignedAttrContentTypeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 8 dereferenceable(32) %14)
  store i32 %15, ptr %4, align 4, !tbaa !9
  %16 = load i32, ptr %4, align 4, !tbaa !9
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %20

18:                                               ; preds = %11
  %19 = load i32, ptr %4, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 277, i32 noundef %19)
  br label %156

20:                                               ; preds = %11
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22
  %24 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 2
  %25 = load ptr, ptr %24, align 8, !tbaa !11
  %26 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 7
  %27 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %26)
  %28 = call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo26addSignedAttrMessageDigestEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(80) %25, ptr noundef %27)
  store i32 %28, ptr %4, align 4, !tbaa !9
  %29 = load i32, ptr %4, align 4, !tbaa !9
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %33

31:                                               ; preds = %23
  %32 = load i32, ptr %4, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 278, i32 noundef %32)
  br label %156

33:                                               ; preds = %23
  br label %34

34:                                               ; preds = %33
  br label %35

35:                                               ; preds = %34
  %36 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !42
  %38 = getelementptr inbounds %"struct.UapkiNS::Doc::Sign::SigningDoc::SignParams", ptr %37, i32 0, i32 11
  %39 = load i8, ptr %38, align 2, !tbaa !43, !range !55, !noundef !56
  %40 = trunc i8 %39 to i1
  br i1 %40, label %41, label %54

41:                                               ; preds = %35
  br label %42

42:                                               ; preds = %41
  %43 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 2
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = call noundef i64 @_ZN8TimeUtil8mtimeNowEv()
  %46 = call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo24addSignedAttrSigningTimeEm(ptr noundef nonnull align 8 dereferenceable(80) %44, i64 noundef %45)
  store i32 %46, ptr %4, align 4, !tbaa !9
  %47 = load i32, ptr %4, align 4, !tbaa !9
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %51

49:                                               ; preds = %42
  %50 = load i32, ptr %4, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 280, i32 noundef %50)
  br label %156

51:                                               ; preds = %42
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53, %35
  %55 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !42
  %57 = getelementptr inbounds %"struct.UapkiNS::Doc::Sign::SigningDoc::SignParams", ptr %56, i32 0, i32 17
  %58 = call noundef zeroext i1 @_ZNK7UapkiNS9Attribute9isPresentEv(ptr noundef nonnull align 8 dereferenceable(40) %57)
  br i1 %58, label %59, label %74

59:                                               ; preds = %54
  br label %60

60:                                               ; preds = %59
  %61 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !11
  %63 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !42
  %65 = getelementptr inbounds %"struct.UapkiNS::Doc::Sign::SigningDoc::SignParams", ptr %64, i32 0, i32 17
  %66 = call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo13addSignedAttrERKNS_9AttributeE(ptr noundef nonnull align 8 dereferenceable(80) %62, ptr noundef nonnull align 8 dereferenceable(40) %65)
  store i32 %66, ptr %4, align 4, !tbaa !9
  %67 = load i32, ptr %4, align 4, !tbaa !9
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %71

69:                                               ; preds = %60
  %70 = load i32, ptr %4, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 285, i32 noundef %70)
  br label %156

71:                                               ; preds = %60
  br label %72

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72
  br label %74

74:                                               ; preds = %73, %54
  %75 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !42
  %77 = getelementptr inbounds %"struct.UapkiNS::Doc::Sign::SigningDoc::SignParams", ptr %76, i32 0, i32 18
  %78 = call noundef zeroext i1 @_ZNK7UapkiNS9Attribute9isPresentEv(ptr noundef nonnull align 8 dereferenceable(40) %77)
  br i1 %78, label %79, label %94

79:                                               ; preds = %74
  br label %80

80:                                               ; preds = %79
  %81 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 2
  %82 = load ptr, ptr %81, align 8, !tbaa !11
  %83 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !42
  %85 = getelementptr inbounds %"struct.UapkiNS::Doc::Sign::SigningDoc::SignParams", ptr %84, i32 0, i32 18
  %86 = call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo13addSignedAttrERKNS_9AttributeE(ptr noundef nonnull align 8 dereferenceable(80) %82, ptr noundef nonnull align 8 dereferenceable(40) %85)
  store i32 %86, ptr %4, align 4, !tbaa !9
  %87 = load i32, ptr %4, align 4, !tbaa !9
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %91

89:                                               ; preds = %80
  %90 = load i32, ptr %4, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 288, i32 noundef %90)
  br label %156

91:                                               ; preds = %80
  br label %92

92:                                               ; preds = %91
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93, %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %95 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 13
  store ptr %95, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = call ptr @_ZNSt6vectorIPN7UapkiNS9AttributeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %96) #5
  %98 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.23", ptr %6, i32 0, i32 0
  store ptr %97, ptr %98, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = call ptr @_ZNSt6vectorIPN7UapkiNS9AttributeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %99) #5
  %101 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.23", ptr %7, i32 0, i32 0
  store ptr %100, ptr %101, align 8
  br label %102

102:                                              ; preds = %123, %94
  %103 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN7UapkiNS9AttributeESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br i1 %103, label %105, label %104

104:                                              ; preds = %102
  store i32 13, ptr %8, align 4
  br label %125

105:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN7UapkiNS9AttributeESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  store ptr %106, ptr %9, align 8, !tbaa !5
  br label %107

107:                                              ; preds = %105
  %108 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 2
  %109 = load ptr, ptr %108, align 8, !tbaa !11
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = load ptr, ptr %110, align 8, !tbaa !5
  %112 = call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo13addSignedAttrERKNS_9AttributeE(ptr noundef nonnull align 8 dereferenceable(80) %109, ptr noundef nonnull align 8 dereferenceable(40) %111)
  store i32 %112, ptr %4, align 4, !tbaa !9
  %113 = load i32, ptr %4, align 4, !tbaa !9
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %117

115:                                              ; preds = %107
  %116 = load i32, ptr %4, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 293, i32 noundef %116)
  store i32 4, ptr %8, align 4
  br label %120

117:                                              ; preds = %107
  br label %118

118:                                              ; preds = %117
  br label %119

119:                                              ; preds = %118
  store i32 0, ptr %8, align 4
  br label %120

120:                                              ; preds = %119, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  %121 = load i32, ptr %8, align 4
  switch i32 %121, label %125 [
    i32 0, label %122
  ]

122:                                              ; preds = %120
  br label %123

123:                                              ; preds = %122
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN7UapkiNS9AttributeESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br label %102

125:                                              ; preds = %120, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  %126 = load i32, ptr %8, align 4
  switch i32 %126, label %158 [
    i32 13, label %127
    i32 4, label %156
  ]

127:                                              ; preds = %125
  br label %128

128:                                              ; preds = %127
  %129 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 2
  %130 = load ptr, ptr %129, align 8, !tbaa !11
  %131 = call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo17encodeSignedAttrsEv(ptr noundef nonnull align 8 dereferenceable(80) %130)
  store i32 %131, ptr %4, align 4, !tbaa !9
  %132 = load i32, ptr %4, align 4, !tbaa !9
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %136

134:                                              ; preds = %128
  %135 = load i32, ptr %4, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 296, i32 noundef %135)
  br label %156

136:                                              ; preds = %128
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137
  %139 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 11
  %140 = call noundef zeroext i1 @_ZNK7UapkiNS5Pkcs716ArchiveTs3Helper9isEnabledEv(ptr noundef nonnull align 8 dereferenceable(128) %139)
  br i1 %140, label %141, label %155

141:                                              ; preds = %138
  br label %142

142:                                              ; preds = %141
  %143 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 11
  %144 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 4
  %145 = getelementptr inbounds %"class.UapkiNS::Doc::Sign::SigningDoc", ptr %10, i32 0, i32 7
  %146 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %145)
  %147 = call noundef i32 @_ZN7UapkiNS5Pkcs716ArchiveTs3Helper14setHashContentERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(128) %143, ptr noundef nonnull align 8 dereferenceable(32) %144, ptr noundef %146)
  store i32 %147, ptr %4, align 4, !tbaa !9
  %148 = load i32, ptr %4, align 4, !tbaa !9
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %150, label %152

150:                                              ; preds = %142
  %151 = load i32, ptr %4, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 299, i32 noundef %151)
  br label %156

152:                                              ; preds = %142
  br label %153

153:                                              ; preds = %152
  br label %154

154:                                              ; preds = %153
  br label %155

155:                                              ; preds = %154, %138
  br label %156

156:                                              ; preds = %155, %150, %134, %125, %89, %69, %49, %31, %18
  %157 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %157, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %158

158:                                              ; preds = %156, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  %159 = load i32, ptr %2, align 4
  ret i32 %159
}

declare noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo24addSignedAttrContentTypeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(32)) #3

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

declare noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo24addSignedAttrSigningTimeEm(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) #3

declare noundef i64 @_ZN8TimeUtil8mtimeNowEv() #3

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

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

declare noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo17encodeSignedAttrsEv(ptr noundef nonnull align 8 dereferenceable(80)) #3

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

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


; 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.23" = type { ptr }

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN7UapkiNS9AttributeESt6vectorIS3_SaIS3_EEEppEv(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 zeroext i1 @_ZNK7UapkiNS5Pkcs716ArchiveTs3Helper9isEnabledEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS3Doc4Sign10SigningDoc21buildSignedAttributesEv(ptr noundef nonnull align 8 dereferenceable(464) %0) local_unnamed_addr #4 align 2 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator.23", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator.23", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 88
  %7 = tail call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo24addSignedAttrContentTypeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 8 dereferenceable(32) %6)
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %9, label %8

8:                                                ; preds = %1
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 277, i32 noundef %7)
  br label %68

9:                                                ; preds = %1
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 208
  %12 = tail call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
  %13 = tail call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo26addSignedAttrMessageDigestEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef %12)
  %.not40 = icmp eq i32 %13, 0
  br i1 %.not40, label %15, label %14

14:                                               ; preds = %9
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 278, i32 noundef %13)
  br label %68

15:                                               ; preds = %9
  %16 = load ptr, ptr %0, align 8, !tbaa !39
  %17 = getelementptr inbounds i8, ptr %16, i64 170
  %18 = load i8, ptr %17, align 2, !tbaa !40, !range !52, !noundef !53
  %19 = trunc nuw i8 %18 to i1
  br i1 %19, label %20, label %25

20:                                               ; preds = %15
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = tail call noundef i64 @_ZN8TimeUtil8mtimeNowEv()
  %23 = tail call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo24addSignedAttrSigningTimeEm(ptr noundef nonnull align 8 dereferenceable(80) %21, i64 noundef %22)
  %.not41 = icmp eq i32 %23, 0
  br i1 %.not41, label %._crit_edge53, label %24

._crit_edge53:                                    ; preds = %20
  %.pre = load ptr, ptr %0, align 8, !tbaa !39
  br label %25

24:                                               ; preds = %20
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 280, i32 noundef %23)
  br label %68

25:                                               ; preds = %._crit_edge53, %15
  %26 = phi ptr [ %.pre, %._crit_edge53 ], [ %16, %15 ]
  %27 = getelementptr inbounds i8, ptr %26, i64 256
  %28 = tail call noundef zeroext i1 @_ZNK7UapkiNS9Attribute9isPresentEv(ptr noundef nonnull align 8 dereferenceable(40) %27)
  br i1 %28, label %29, label %35

29:                                               ; preds = %25
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = load ptr, ptr %0, align 8, !tbaa !39
  %32 = getelementptr inbounds i8, ptr %31, i64 256
  %33 = tail call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo13addSignedAttrERKNS_9AttributeE(ptr noundef nonnull align 8 dereferenceable(80) %30, ptr noundef nonnull align 8 dereferenceable(40) %32)
  %.not42 = icmp eq i32 %33, 0
  br i1 %.not42, label %35, label %34

34:                                               ; preds = %29
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 285, i32 noundef %33)
  br label %68

35:                                               ; preds = %29, %25
  %36 = load ptr, ptr %0, align 8, !tbaa !39
  %37 = getelementptr inbounds i8, ptr %36, i64 296
  %38 = tail call noundef zeroext i1 @_ZNK7UapkiNS9Attribute9isPresentEv(ptr noundef nonnull align 8 dereferenceable(40) %37)
  br i1 %38, label %39, label %45

39:                                               ; preds = %35
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = load ptr, ptr %0, align 8, !tbaa !39
  %42 = getelementptr inbounds i8, ptr %41, i64 296
  %43 = tail call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo13addSignedAttrERKNS_9AttributeE(ptr noundef nonnull align 8 dereferenceable(80) %40, ptr noundef nonnull align 8 dereferenceable(40) %42)
  %.not43 = icmp eq i32 %43, 0
  br i1 %.not43, label %45, label %44

44:                                               ; preds = %39
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 288, i32 noundef %43)
  br label %68

45:                                               ; preds = %39, %35
  %46 = getelementptr inbounds i8, ptr %0, i64 416
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %47 = tail call ptr @_ZNSt6vectorIPN7UapkiNS9AttributeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #5
  store ptr %47, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %48 = tail call ptr @_ZNSt6vectorIPN7UapkiNS9AttributeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #5
  store ptr %48, ptr %3, align 8
  %49 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN7UapkiNS9AttributeESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  br i1 %49, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %45, %54
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN7UapkiNS9AttributeESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = load ptr, ptr %50, align 8, !tbaa !54
  %53 = call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo13addSignedAttrERKNS_9AttributeE(ptr noundef nonnull align 8 dereferenceable(80) %51, ptr noundef nonnull align 8 dereferenceable(40) %52)
  %.not44 = icmp eq i32 %53, 0
  br i1 %.not44, label %54, label %57

54:                                               ; preds = %.lr.ph
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN7UapkiNS9AttributeESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %56 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN7UapkiNS9AttributeESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  br i1 %56, label %.lr.ph, label %._crit_edge

57:                                               ; preds = %.lr.ph
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 293, i32 noundef %53)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  br label %68

._crit_edge:                                      ; preds = %54, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = call noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo17encodeSignedAttrsEv(ptr noundef nonnull align 8 dereferenceable(80) %58)
  %.not45 = icmp eq i32 %59, 0
  br i1 %.not45, label %61, label %60

60:                                               ; preds = %._crit_edge
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 296, i32 noundef %59)
  br label %68

61:                                               ; preds = %._crit_edge
  %62 = getelementptr inbounds i8, ptr %0, i64 264
  %63 = call noundef zeroext i1 @_ZNK7UapkiNS5Pkcs716ArchiveTs3Helper9isEnabledEv(ptr noundef nonnull align 8 dereferenceable(128) %62)
  br i1 %63, label %64, label %68

64:                                               ; preds = %61
  %65 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
  %66 = call noundef i32 @_ZN7UapkiNS5Pkcs716ArchiveTs3Helper14setHashContentERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(128) %62, ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef %65)
  %.not46 = icmp eq i32 %66, 0
  br i1 %.not46, label %68, label %67

67:                                               ; preds = %64
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 299, i32 noundef %66)
  br label %68

68:                                               ; preds = %57, %8, %14, %24, %34, %44, %60, %67, %64, %61
  %.0 = phi i32 [ %7, %8 ], [ %13, %14 ], [ %23, %24 ], [ %33, %34 ], [ %43, %44 ], [ %53, %57 ], [ %59, %60 ], [ %66, %67 ], [ 0, %64 ], [ 0, %61 ]
  ret i32 %.0
}

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

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

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

declare noundef i64 @_ZN8TimeUtil8mtimeNowEv() local_unnamed_addr #3

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

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

declare noundef i32 @_ZN7UapkiNS5Pkcs717SignedDataBuilder10SignerInfo17encodeSignedAttrsEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3

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

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 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 = { 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 48}
!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 = !{!6, !7, i64 0}
!40 = !{!41, !18, i64 170}
!41 = !{!"_ZTSN7UapkiNS3Doc4Sign10SigningDoc10SignParamsE", !42, i64 0, !18, i64 4, !18, i64 5, !21, i64 8, !21, i64 12, !43, i64 16, !43, i64 56, !44, i64 96, !22, i64 160, !18, i64 168, !18, i64 169, !18, i64 170, !18, i64 171, !18, i64 172, !18, i64 173, !45, i64 176, !46, i64 184, !51, i64 256, !51, i64 296, !31, i64 336}
!42 = !{!"_ZTSN7UapkiNS15SignatureFormatE", !8, i64 0}
!43 = !{!"_ZTSN7UapkiNS19AlgorithmIdentifierE", !15, i64 0, !7, i64 32}
!44 = !{!"_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}
!45 = !{!"_ZTSN7UapkiNS13LibraryConfig10OcspParamsE", !17, i64 0}
!46 = !{!"_ZTSN7UapkiNS13LibraryConfig9TspParamsE", !18, i64 0, !18, i64 1, !17, i64 8, !15, i64 16, !47, i64 48}
!47 = !{!"_ZTSSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !48, i64 0}
!48 = !{!"_ZTSSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !49, i64 0}
!49 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_Vector_implE", !50, i64 0}
!50 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!51 = !{!"_ZTSN7UapkiNS9AttributeE", !15, i64 0, !7, i64 32}
!52 = !{i8 0, i8 2}
!53 = !{}
!54 = !{!7, !7, i64 0}


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