; 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.88" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.57" = type { ptr }
%"struct.UapkiNS::Doc::Verify::VerifySignedDoc" = type { ptr, ptr, ptr, i64, ptr, %"class.UapkiNS::Pkcs7::SignedDataParser", ptr, %"class.std::vector.24", %"class.std::vector.65", %"class.std::vector.83" }
%"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.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::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.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 }
%"class.std::vector.65" = type { %"struct.std::_Vector_base.66" }
%"struct.std::_Vector_base.66" = type { %"struct.std::_Vector_base<UapkiNS::Crl::CrlItem *, std::allocator<UapkiNS::Crl::CrlItem *>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::Crl::CrlItem *, std::allocator<UapkiNS::Crl::CrlItem *>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::Crl::CrlItem *, std::allocator<UapkiNS::Crl::CrlItem *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::Crl::CrlItem *, std::allocator<UapkiNS::Crl::CrlItem *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.83" = type { %"struct.std::_Vector_base.84" }
%"struct.std::_Vector_base.84" = type { %"struct.std::_Vector_base<UapkiNS::Doc::Verify::VerifiedSignerInfo, std::allocator<UapkiNS::Doc::Verify::VerifiedSignerInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::Doc::Verify::VerifiedSignerInfo, std::allocator<UapkiNS::Doc::Verify::VerifiedSignerInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::Doc::Verify::VerifiedSignerInfo, std::allocator<UapkiNS::Doc::Verify::VerifiedSignerInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::Doc::Verify::VerifiedSignerInfo, std::allocator<UapkiNS::Doc::Verify::VerifiedSignerInfo>>::_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" }

; 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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(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_iteratorIPKPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7UapkiNS3Doc6Verify15VerifySignedDoc17detectCertSourcesEv(ptr noundef nonnull align 8 dereferenceable(256) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.88", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.88", align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.57", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.57", align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i8, align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %14 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %15 = getelementptr inbounds %"struct.UapkiNS::Doc::Verify::VerifySignedDoc", ptr %14, i32 0, i32 9
  store ptr %15, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = call ptr @_ZNSt6vectorIN7UapkiNS3Doc6Verify18VerifiedSignerInfoESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  %18 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.88", ptr %4, i32 0, i32 0
  store ptr %17, ptr %18, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = call ptr @_ZNSt6vectorIN7UapkiNS3Doc6Verify18VerifiedSignerInfoESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  %21 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.88", ptr %5, i32 0, i32 0
  store ptr %20, ptr %21, align 8
  br label %22

22:                                               ; preds = %66, %1
  %23 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN7UapkiNS3Doc6Verify18VerifiedSignerInfoESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %23, label %25, label %24

24:                                               ; preds = %22
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %68

25:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %26 = call noundef nonnull align 8 dereferenceable(2568) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7UapkiNS3Doc6Verify18VerifiedSignerInfoESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  store ptr %26, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7UapkiNS3Doc6Verify18VerifiedSignerInfo17getCertChainItemsEv(ptr noundef nonnull align 8 dereferenceable(2568) %27)
  store ptr %28, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = call ptr @_ZNKSt6vectorIPN7UapkiNS13CertValidator13CertChainItemESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #5
  %31 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.57", ptr %9, i32 0, i32 0
  store ptr %30, ptr %31, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = call ptr @_ZNKSt6vectorIPN7UapkiNS13CertValidator13CertChainItemESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #5
  %34 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.57", ptr %10, i32 0, i32 0
  store ptr %33, ptr %34, align 8
  br label %35

35:                                               ; preds = %63, %25
  %36 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  br i1 %36, label %38, label %37

37:                                               ; preds = %35
  store i32 4, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %65

38:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  store ptr %39, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  %42 = call noundef ptr @_ZNK7UapkiNS13CertValidator13CertChainItem16getSubjectCertIdEv(ptr noundef nonnull align 8 dereferenceable(280) %41)
  store ptr %42, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  %43 = getelementptr inbounds %"struct.UapkiNS::Doc::Verify::VerifySignedDoc", ptr %14, i32 0, i32 7
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = call noundef ptr @_ZN7UapkiNS4Cert16findCertByCertIdERKSt6vectorIPNS0_7CerItemESaIS3_EEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(24) %43, ptr noundef %44)
  %46 = icmp ne ptr %45, null
  br i1 %46, label %54, label %47

47:                                               ; preds = %38
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZN7UapkiNS3Doc6Verify18VerifiedSignerInfo17getListAddedCertsEv(ptr noundef nonnull align 8 dereferenceable(2568) %48)
  %50 = getelementptr inbounds %"struct.UapkiNS::Doc::Verify::VerifiedSignerInfo::ListAddedCerts", ptr %49, i32 0, i32 2
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = call noundef ptr @_ZN7UapkiNS4Cert16findCertByCertIdERKSt6vectorIPNS0_7CerItemESaIS3_EEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef %51)
  %53 = icmp ne ptr %52, null
  br label %54

54:                                               ; preds = %47, %38
  %55 = phi i1 [ true, %38 ], [ %53, %47 ]
  %56 = zext i1 %55 to i8
  store i8 %56, ptr %13, align 1, !tbaa !9
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = load i8, ptr %13, align 1, !tbaa !9, !range !11, !noundef !12
  %60 = trunc i8 %59 to i1
  %61 = zext i1 %60 to i64
  %62 = select i1 %60, i32 1, i32 2
  call void @_ZN7UapkiNS13CertValidator13CertChainItem13setDataSourceENS0_10DataSourceE(ptr noundef nonnull align 8 dereferenceable(280) %58, i32 noundef %62)
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %63

63:                                               ; preds = %54
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br label %35

65:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %66

66:                                               ; preds = %65
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN7UapkiNS3Doc6Verify18VerifiedSignerInfoESt6vectorIS4_SaIS4_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  br label %22

68:                                               ; preds = %24
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPN7UapkiNS3Doc6Verify18VerifiedSignerInfoESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(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(2568) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7UapkiNS3Doc6Verify18VerifiedSignerInfoESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

declare noundef ptr @_ZN7UapkiNS4Cert16findCertByCertIdERKSt6vectorIPNS0_7CerItemESaIS3_EEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) #4

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

declare void @_ZN7UapkiNS13CertValidator13CertChainItem13setDataSourceENS0_10DataSourceE(ptr noundef nonnull align 8 dereferenceable(280), i32 noundef) #4

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { "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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}


; 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.88" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.57" = type { ptr }

; 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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(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_iteratorIPKPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7UapkiNS3Doc6Verify15VerifySignedDoc17detectCertSourcesEv(ptr noundef nonnull align 8 dereferenceable(256) %0) local_unnamed_addr #3 align 2 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator.88", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator.88", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.57", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.57", align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 232
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %7 = tail call ptr @_ZNSt6vectorIN7UapkiNS3Doc6Verify18VerifiedSignerInfoESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  store ptr %7, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %8 = tail call ptr @_ZNSt6vectorIN7UapkiNS3Doc6Verify18VerifiedSignerInfoESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  store ptr %8, ptr %3, align 8
  %9 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN7UapkiNS3Doc6Verify18VerifiedSignerInfoESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  br i1 %9, label %.lr.ph13, label %._crit_edge14

.lr.ph13:                                         ; preds = %1
  %10 = getelementptr inbounds i8, ptr %0, i64 184
  br label %11

._crit_edge14:                                    ; preds = %._crit_edge, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  ret void

11:                                               ; preds = %.lr.ph13, %._crit_edge
  %12 = call noundef nonnull align 8 dereferenceable(2568) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7UapkiNS3Doc6Verify18VerifiedSignerInfoESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %13 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7UapkiNS3Doc6Verify18VerifiedSignerInfo17getCertChainItemsEv(ptr noundef nonnull align 8 dereferenceable(2568) %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %14 = call ptr @_ZNKSt6vectorIPN7UapkiNS13CertValidator13CertChainItemESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  store ptr %14, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %15 = call ptr @_ZNKSt6vectorIPN7UapkiNS13CertValidator13CertChainItemESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  store ptr %15, ptr %5, align 8
  %16 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %16, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.thread, %11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN7UapkiNS3Doc6Verify18VerifiedSignerInfoESt6vectorIS4_SaIS4_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %18 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN7UapkiNS3Doc6Verify18VerifiedSignerInfoESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  br i1 %18, label %11, label %._crit_edge14

.lr.ph:                                           ; preds = %11, %.thread
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = call noundef ptr @_ZNK7UapkiNS13CertValidator13CertChainItem16getSubjectCertIdEv(ptr noundef nonnull align 8 dereferenceable(280) %20)
  %22 = call noundef ptr @_ZN7UapkiNS4Cert16findCertByCertIdERKSt6vectorIPNS0_7CerItemESaIS3_EEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef %21)
  %.not = icmp eq ptr %22, null
  br i1 %.not, label %23, label %.thread

23:                                               ; preds = %.lr.ph
  %24 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZN7UapkiNS3Doc6Verify18VerifiedSignerInfo17getListAddedCertsEv(ptr noundef nonnull align 8 dereferenceable(2568) %12)
  %25 = getelementptr inbounds i8, ptr %24, i64 48
  %26 = call noundef ptr @_ZN7UapkiNS4Cert16findCertByCertIdERKSt6vectorIPNS0_7CerItemESaIS3_EEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef %21)
  %.not11 = icmp eq ptr %26, null
  %spec.select = select i1 %.not11, i32 2, i32 1
  br label %.thread

.thread:                                          ; preds = %.lr.ph, %23
  %27 = phi i32 [ %spec.select, %23 ], [ 1, %.lr.ph ]
  %28 = load ptr, ptr %19, align 8, !tbaa !5
  call void @_ZN7UapkiNS13CertValidator13CertChainItem13setDataSourceENS0_10DataSourceE(ptr noundef nonnull align 8 dereferenceable(280) %28, i32 noundef %27)
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %30 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN7UapkiNS13CertValidator13CertChainItemESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %30, label %.lr.ph, label %._crit_edge
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPN7UapkiNS3Doc6Verify18VerifiedSignerInfoESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(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(2568) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7UapkiNS3Doc6Verify18VerifiedSignerInfoESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

declare noundef ptr @_ZN7UapkiNS4Cert16findCertByCertIdERKSt6vectorIPNS0_7CerItemESaIS3_EEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) local_unnamed_addr #4

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

declare void @_ZN7UapkiNS13CertValidator13CertChainItem13setDataSourceENS0_10DataSourceE(ptr noundef nonnull align 8 dereferenceable(280), i32 noundef) local_unnamed_addr #4

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { "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"}


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