; LLVM IR from specinfo-ua/UAPKI :: library/uapki/src (doc-verify)

; 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.49" = type { ptr }
%"class.UapkiNS::Doc::Verify::VerifiedSignerInfo" = type { %"class.UapkiNS::CertValidator::CertValidator", i8, i32, %"class.UapkiNS::Pkcs7::SignedDataParser::SignerInfo", ptr, i32, i32, i32, i64, %"class.std::vector.13", i32, %"class.std::__cxx11::basic_string", %"struct.UapkiNS::Doc::Verify::AttrTimeStamp", %"struct.UapkiNS::Doc::Verify::AttrTimeStamp", %"struct.UapkiNS::Doc::Verify::CadesXlInfo", %"struct.UapkiNS::Doc::Verify::AttrTimeStamp", %"class.UapkiNS::Pkcs7::ArchiveTs3Helper", i32, i8, i8, i64, %"class.std::vector.44", %"struct.UapkiNS::Doc::Verify::VerifiedSignerInfo::ListAddedCerts" }
%"class.UapkiNS::CertValidator::CertValidator" = type { ptr, ptr, ptr, %"class.std::vector.34", %"class.std::vector.39", %"class.UapkiNS::SmartBA", %"class.UapkiNS::SmartBA" }
%"class.std::vector.34" = type { %"struct.std::_Vector_base.35" }
%"struct.std::_Vector_base.35" = type { %"struct.std::_Vector_base<UapkiNS::CertValidator::ExpectedCertItem *, std::allocator<UapkiNS::CertValidator::ExpectedCertItem *>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::CertValidator::ExpectedCertItem *, std::allocator<UapkiNS::CertValidator::ExpectedCertItem *>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::CertValidator::ExpectedCertItem *, std::allocator<UapkiNS::CertValidator::ExpectedCertItem *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::CertValidator::ExpectedCertItem *, std::allocator<UapkiNS::CertValidator::ExpectedCertItem *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.39" = type { %"struct.std::_Vector_base.40" }
%"struct.std::_Vector_base.40" = type { %"struct.std::_Vector_base<UapkiNS::CertValidator::ExpectedCrlItem *, std::allocator<UapkiNS::CertValidator::ExpectedCrlItem *>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::CertValidator::ExpectedCrlItem *, std::allocator<UapkiNS::CertValidator::ExpectedCrlItem *>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::CertValidator::ExpectedCrlItem *, std::allocator<UapkiNS::CertValidator::ExpectedCrlItem *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::CertValidator::ExpectedCrlItem *, std::allocator<UapkiNS::CertValidator::ExpectedCrlItem *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.UapkiNS::SmartBA" = type { ptr }
%"class.UapkiNS::Pkcs7::SignedDataParser::SignerInfo" = type { ptr, i32, i64, %"class.UapkiNS::SmartBA", %"struct.UapkiNS::AlgorithmIdentifier", %"class.std::vector.8", %"struct.UapkiNS::AlgorithmIdentifier", %"class.UapkiNS::SmartBA", %"class.std::vector.8", %"class.UapkiNS::SmartBA", %"struct.UapkiNS::Pkcs7::SignedDataParser::SignerInfo::MandatoryAttrs" }
%"struct.UapkiNS::AlgorithmIdentifier" = type { %"class.std::__cxx11::basic_string", ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = 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::Pkcs7::SignedDataParser::SignerInfo::MandatoryAttrs" = type { %"class.std::__cxx11::basic_string", %"class.UapkiNS::SmartBA" }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<UapkiNS::AttrCertId, std::allocator<UapkiNS::AttrCertId>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::AttrCertId, std::allocator<UapkiNS::AttrCertId>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::AttrCertId, std::allocator<UapkiNS::AttrCertId>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::AttrCertId, std::allocator<UapkiNS::AttrCertId>>::_Vector_impl_data" = type { ptr, ptr, 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] }
%"struct.UapkiNS::Doc::Verify::CadesXlInfo" = type { i8, i8, i8, i8, %"class.std::vector.13", %"class.UapkiNS::VectorBA", %"class.UapkiNS::AttributeHelper::RevocationRefsParser", %"class.UapkiNS::AttributeHelper::RevocationValuesParser", %"class.UapkiNS::VectorBA", i32, %"class.std::vector.18" }
%"class.UapkiNS::AttributeHelper::RevocationRefsParser" = type { ptr, i64 }
%"class.UapkiNS::AttributeHelper::RevocationValuesParser" = type { %"class.UapkiNS::VectorBA", %"class.UapkiNS::VectorBA", %"struct.UapkiNS::Attribute" }
%"struct.UapkiNS::Attribute" = type { %"class.std::__cxx11::basic_string", ptr }
%"class.UapkiNS::VectorBA" = type { %"class.std::vector.3" }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl" }
%"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.18" = type { %"struct.std::_Vector_base.19" }
%"struct.std::_Vector_base.19" = type { %"struct.std::_Vector_base<UapkiNS::VerifyStatus, std::allocator<UapkiNS::VerifyStatus>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::VerifyStatus, std::allocator<UapkiNS::VerifyStatus>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::VerifyStatus, std::allocator<UapkiNS::VerifyStatus>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::VerifyStatus, std::allocator<UapkiNS::VerifyStatus>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.UapkiNS::Doc::Verify::AttrTimeStamp" = type { %"class.UapkiNS::Tsp::TsTokenParser", %"class.UapkiNS::Pkcs7::SignedDataParser::SignerInfo", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.UapkiNS::SmartBA", i64, ptr, i32, i32 }
%"class.UapkiNS::Tsp::TsTokenParser" = type { %"class.UapkiNS::Pkcs7::SignedDataParser", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", ptr, ptr, i64, i8, i8, ptr }
%"class.UapkiNS::Pkcs7::SignedDataParser" = type { ptr, i32, %"class.std::vector", %"struct.UapkiNS::Pkcs7::EncapsulatedContentInfo", %"class.UapkiNS::VectorBA", %"class.UapkiNS::VectorBA", i64 }
%"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::Pkcs7::EncapsulatedContentInfo" = type { %"class.std::__cxx11::basic_string", ptr }
%"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" }
%struct.anon = type { %"class.UapkiNS::SmartBA", %"class.UapkiNS::SmartBA", %"class.UapkiNS::SmartBA", %"class.UapkiNS::SmartBA" }
%"class.std::vector.44" = type { %"struct.std::_Vector_base.45" }
%"struct.std::_Vector_base.45" = type { %"struct.std::_Vector_base<UapkiNS::CertValidator::CertChainItem *, std::allocator<UapkiNS::CertValidator::CertChainItem *>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::CertValidator::CertChainItem *, std::allocator<UapkiNS::CertValidator::CertChainItem *>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::CertValidator::CertChainItem *, std::allocator<UapkiNS::CertValidator::CertChainItem *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::CertValidator::CertChainItem *, std::allocator<UapkiNS::CertValidator::CertChainItem *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.UapkiNS::Doc::Verify::VerifiedSignerInfo::ListAddedCerts" = type { %"class.std::vector.24", %"class.std::vector.24", %"class.std::vector.24", %"class.std::vector.24", %"class.std::vector.24" }
%"class.std::vector.24" = type { %"struct.std::_Vector_base.25" }
%"struct.std::_Vector_base.25" = type { %"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

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

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

declare i32 @ba_cmp(ptr noundef, ptr noundef) #1

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS3Doc6Verify18VerifiedSignerInfo16addCertChainItemENS_13CertValidator10CertEntityEPNS_4Cert7CerItemEPPNS3_13CertChainItemERb(ptr noundef nonnull align 8 dereferenceable(2568) %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef nonnull align 1 dereferenceable(1) %4) #5 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.49", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator.49", align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %20 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %21 = getelementptr inbounds %"class.UapkiNS::Doc::Verify::VerifiedSignerInfo", ptr %20, i32 0, i32 21
  store ptr %21, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %22 = load ptr, ptr %12, align 8, !tbaa !5
  %23 = call ptr @_ZNSt6vectorIPN7UapkiNS13CertValidator13CertChainItemESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  %24 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.49", ptr %13, i32 0, i32 0
  store ptr %23, ptr %24, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %25 = load ptr, ptr %12, align 8, !tbaa !5
  %26 = call ptr @_ZNSt6vectorIPN7UapkiNS13CertValidator13CertChainItemESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  %27 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.49", ptr %14, i32 0, i32 0
  store ptr %26, ptr %27, align 8
  br label %28

28:                                               ; preds = %49, %5
  %29 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  br i1 %29, label %31, label %30

30:                                               ; preds = %28
  store i32 2, ptr %15, align 4
  br label %51

31:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  store ptr %32, ptr %16, align 8, !tbaa !5
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem9getCertIdEv(ptr noundef nonnull align 8 dereferenceable(401) %33)
  %35 = load ptr, ptr %16, align 8, !tbaa !5
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  %37 = call noundef ptr @_ZNK7UapkiNS13CertValidator13CertChainItem16getSubjectCertIdEv(ptr noundef nonnull align 8 dereferenceable(280) %36)
  %38 = call i32 @ba_cmp(ptr noundef %34, ptr noundef %37)
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %45

40:                                               ; preds = %31
  %41 = load ptr, ptr %16, align 8, !tbaa !5
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %42, ptr %43, align 8, !tbaa !5
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  store i8 0, ptr %44, align 1, !tbaa !11
  store i32 0, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %46

45:                                               ; preds = %31
  store i32 0, ptr %15, align 4
  br label %46

46:                                               ; preds = %45, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  %47 = load i32, ptr %15, align 4
  switch i32 %47, label %51 [
    i32 0, label %48
  ]

48:                                               ; preds = %46
  br label %49

49:                                               ; preds = %48
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br label %28

51:                                               ; preds = %46, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %52 = load i32, ptr %15, align 4
  switch i32 %52, label %80 [
    i32 2, label %53
    i32 1, label %73
  ]

53:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %54 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 280) #8
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @_ZN7UapkiNS13CertValidator13CertChainItemC1ENS0_10CertEntityEPNS_4Cert7CerItemE(ptr noundef nonnull align 8 dereferenceable(280) %54, i32 noundef %55, ptr noundef %56)
          to label %57 unwind label %63

57:                                               ; preds = %53
  store ptr %54, ptr %17, align 8, !tbaa !5
  %58 = load ptr, ptr %17, align 8, !tbaa !5
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %58, ptr %59, align 8, !tbaa !5
  %60 = load ptr, ptr %17, align 8, !tbaa !5
  %61 = icmp ne ptr %60, null
  br i1 %61, label %67, label %62

62:                                               ; preds = %57
  store i32 4097, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %72

63:                                               ; preds = %53
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %18, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %19, align 4
  call void @_ZdlPvm(ptr noundef %54, i64 noundef 280) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %75

67:                                               ; preds = %57
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  store i8 1, ptr %68, align 1, !tbaa !11
  %69 = getelementptr inbounds %"class.UapkiNS::Doc::Verify::VerifiedSignerInfo", ptr %20, i32 0, i32 21
  call void @_ZNSt6vectorIPN7UapkiNS13CertValidator13CertChainItemESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %69, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %70 = load ptr, ptr %17, align 8, !tbaa !5
  %71 = call noundef i32 @_ZN7UapkiNS13CertValidator13CertChainItem10decodeNameEv(ptr noundef nonnull align 8 dereferenceable(280) %70)
  store i32 %71, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %72

72:                                               ; preds = %67, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %73

73:                                               ; preds = %72, %51
  %74 = load i32, ptr %6, align 4
  ret i32 %74

75:                                               ; preds = %63
  %76 = load ptr, ptr %18, align 8
  %77 = load i32, ptr %19, align 4
  %78 = insertvalue { ptr, i32 } poison, ptr %76, 0
  %79 = insertvalue { ptr, i32 } %78, i32 %77, 1
  resume { ptr, i32 } %79

80:                                               ; preds = %51
  unreachable
}

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

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

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

declare void @_ZN7UapkiNS13CertValidator13CertChainItemC1ENS0_10CertEntityEPNS_4Cert7CerItemE(ptr noundef nonnull align 8 dereferenceable(280), i32 noundef, ptr noundef) unnamed_addr #1

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

declare noundef i32 @_ZN7UapkiNS13CertValidator13CertChainItem10decodeNameEv(ptr noundef nonnull align 8 dereferenceable(280)) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 = { 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 #4 = { 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 #5 = { 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 #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, !10, i64 0}
!10 = !{!"_ZTSN7UapkiNS13CertValidator10CertEntityE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.__gnu_cxx::__normal_iterator.49" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

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

declare i32 @ba_cmp(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS3Doc6Verify18VerifiedSignerInfo16addCertChainItemENS_13CertValidator10CertEntityEPNS_4Cert7CerItemEPPNS3_13CertChainItemERb(ptr noundef nonnull align 8 dereferenceable(2568) %0, i32 noundef %1, ptr noundef %2, ptr nocapture noundef writeonly %3, ptr nocapture noundef nonnull writeonly align 1 dereferenceable(1) %4) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.49", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.49", align 8
  %8 = alloca ptr, align 8
  %9 = getelementptr inbounds i8, ptr %0, i64 2424
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %10 = tail call ptr @_ZNSt6vectorIPN7UapkiNS13CertValidator13CertChainItemESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  store ptr %10, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %11 = tail call ptr @_ZNSt6vectorIPN7UapkiNS13CertValidator13CertChainItemESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  store ptr %11, ptr %7, align 8
  %12 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %5, %.critedge
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %14 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem9getCertIdEv(ptr noundef nonnull align 8 dereferenceable(401) %2)
  %15 = load ptr, ptr %13, align 8, !tbaa !5
  %16 = call noundef ptr @_ZNK7UapkiNS13CertValidator13CertChainItem16getSubjectCertIdEv(ptr noundef nonnull align 8 dereferenceable(280) %15)
  %17 = call i32 @ba_cmp(ptr noundef %14, ptr noundef %16)
  %.not = icmp eq i32 %17, 0
  br i1 %.not, label %20, label %.critedge

.critedge:                                        ; preds = %.lr.ph
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %19 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  br i1 %19, label %.lr.ph, label %._crit_edge

20:                                               ; preds = %.lr.ph
  %21 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %21, ptr %3, align 8, !tbaa !5
  store i8 0, ptr %4, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %28

._crit_edge:                                      ; preds = %.critedge, %5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %22 = call noalias noundef nonnull dereferenceable(280) ptr @_Znwm(i64 noundef 280) #8
  invoke void @_ZN7UapkiNS13CertValidator13CertChainItemC1ENS0_10CertEntityEPNS_4Cert7CerItemE(ptr noundef nonnull align 8 dereferenceable(280) %22, i32 noundef %1, ptr noundef %2)
          to label %23 unwind label %26

23:                                               ; preds = %._crit_edge
  store ptr %22, ptr %8, align 8, !tbaa !5
  store ptr %22, ptr %3, align 8, !tbaa !5
  store i8 1, ptr %4, align 1, !tbaa !9
  call void @_ZNSt6vectorIPN7UapkiNS13CertValidator13CertChainItemESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = call noundef i32 @_ZN7UapkiNS13CertValidator13CertChainItem10decodeNameEv(ptr noundef nonnull align 8 dereferenceable(280) %24)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %28

26:                                               ; preds = %._crit_edge
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %22, i64 noundef 280) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  resume { ptr, i32 } %27

28:                                               ; preds = %20, %23
  %.4 = phi i32 [ 0, %20 ], [ %25, %23 ]
  ret i32 %.4
}

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

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

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

declare void @_ZN7UapkiNS13CertValidator13CertChainItemC1ENS0_10CertEntityEPNS_4Cert7CerItemE(ptr noundef nonnull align 8 dereferenceable(280), i32 noundef, ptr noundef) unnamed_addr #1

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

declare noundef i32 @_ZN7UapkiNS13CertValidator13CertChainItem10decodeNameEv(ptr noundef nonnull align 8 dereferenceable(280)) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 = { 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 #4 = { 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 #5 = { 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 #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, !10, i64 0}
!10 = !{!"bool", !7, i64 0}


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