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

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

%"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::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.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::__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::SmartBA" = type { ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7UapkiNS3Doc6Verify13AttrTimeStampC2Ev(ptr noundef nonnull align 8 dereferenceable(552) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  %6 = getelementptr inbounds %"struct.UapkiNS::Doc::Verify::AttrTimeStamp", ptr %5, i32 0, i32 0
  call void @_ZN7UapkiNS3Tsp13TsTokenParserC1Ev(ptr noundef nonnull align 8 dereferenceable(240) %6)
  %7 = getelementptr inbounds %"struct.UapkiNS::Doc::Verify::AttrTimeStamp", ptr %5, i32 0, i32 1
  invoke void @_ZN7UapkiNS5Pkcs716SignedDataParser10SignerInfoC1Ev(ptr noundef nonnull align 8 dereferenceable(216) %7)
          to label %8 unwind label %17

8:                                                ; preds = %1
  %9 = getelementptr inbounds %"struct.UapkiNS::Doc::Verify::AttrTimeStamp", ptr %5, i32 0, i32 2
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  %10 = getelementptr inbounds %"struct.UapkiNS::Doc::Verify::AttrTimeStamp", ptr %5, i32 0, i32 3
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  %11 = getelementptr inbounds %"struct.UapkiNS::Doc::Verify::AttrTimeStamp", ptr %5, i32 0, i32 4
  invoke void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %12 unwind label %21

12:                                               ; preds = %8
  %13 = getelementptr inbounds %"struct.UapkiNS::Doc::Verify::AttrTimeStamp", ptr %5, i32 0, i32 5
  store i64 0, ptr %13, align 8, !tbaa !9
  %14 = getelementptr inbounds %"struct.UapkiNS::Doc::Verify::AttrTimeStamp", ptr %5, i32 0, i32 6
  store ptr null, ptr %14, align 8, !tbaa !38
  %15 = getelementptr inbounds %"struct.UapkiNS::Doc::Verify::AttrTimeStamp", ptr %5, i32 0, i32 7
  store i32 0, ptr %15, align 8, !tbaa !39
  %16 = getelementptr inbounds %"struct.UapkiNS::Doc::Verify::AttrTimeStamp", ptr %5, i32 0, i32 8
  store i32 0, ptr %16, align 4, !tbaa !40
  ret void

17:                                               ; preds = %1
  %18 = landingpad { ptr, i32 }
          cleanup
  %19 = extractvalue { ptr, i32 } %18, 0
  store ptr %19, ptr %3, align 8
  %20 = extractvalue { ptr, i32 } %18, 1
  store i32 %20, ptr %4, align 4
  br label %25

21:                                               ; preds = %8
  %22 = landingpad { ptr, i32 }
          cleanup
  %23 = extractvalue { ptr, i32 } %22, 0
  store ptr %23, ptr %3, align 8
  %24 = extractvalue { ptr, i32 } %22, 1
  store i32 %24, ptr %4, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  call void @_ZN7UapkiNS5Pkcs716SignedDataParser10SignerInfoD1Ev(ptr noundef nonnull align 8 dereferenceable(216) %7) #4
  br label %25

25:                                               ; preds = %21, %17
  call void @_ZN7UapkiNS3Tsp13TsTokenParserD1Ev(ptr noundef nonnull align 8 dereferenceable(240) %6) #4
  br label %26

26:                                               ; preds = %25
  %27 = load ptr, ptr %3, align 8
  %28 = load i32, ptr %4, align 4
  %29 = insertvalue { ptr, i32 } poison, ptr %27, 0
  %30 = insertvalue { ptr, i32 } %29, i32 %28, 1
  resume { ptr, i32 } %30
}

declare void @_ZN7UapkiNS3Tsp13TsTokenParserC1Ev(ptr noundef nonnull align 8 dereferenceable(240)) unnamed_addr #1

declare void @_ZN7UapkiNS5Pkcs716SignedDataParser10SignerInfoC1Ev(ptr noundef nonnull align 8 dereferenceable(216)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @_ZN7UapkiNS5Pkcs716SignedDataParser10SignerInfoD1Ev(ptr noundef nonnull align 8 dereferenceable(216)) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN7UapkiNS3Tsp13TsTokenParserD1Ev(ptr noundef nonnull align 8 dereferenceable(240)) unnamed_addr #3

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { 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 #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !21, i64 528}
!10 = !{!"_ZTSN7UapkiNS3Doc6Verify13AttrTimeStampE", !11, i64 0, !28, i64 240, !19, i64 456, !19, i64 488, !30, i64 520, !21, i64 528, !6, i64 536, !37, i64 544, !37, i64 548}
!11 = !{!"_ZTSN7UapkiNS3Tsp13TsTokenParserE", !12, i64 0, !19, i64 136, !19, i64 168, !6, i64 200, !6, i64 208, !21, i64 216, !27, i64 224, !27, i64 225, !6, i64 232}
!12 = !{!"_ZTSN7UapkiNS5Pkcs716SignedDataParserE", !6, i64 0, !13, i64 8, !14, i64 16, !18, i64 40, !22, i64 80, !22, i64 104, !21, i64 128}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"_ZTSN7UapkiNS5Pkcs723EncapsulatedContentInfoE", !19, i64 0, !6, i64 32}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !21, i64 8, !7, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSN7UapkiNS8VectorBAE", !23, i64 0}
!23 = !{!"_ZTSSt6vectorIP12ByteArray_stSaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIP12ByteArray_stSaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIP12ByteArray_stSaIS1_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIP12ByteArray_stSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!"bool", !7, i64 0}
!28 = !{!"_ZTSN7UapkiNS5Pkcs716SignedDataParser10SignerInfoE", !6, i64 0, !13, i64 8, !29, i64 16, !30, i64 24, !31, i64 32, !32, i64 72, !31, i64 96, !30, i64 136, !32, i64 144, !30, i64 168, !36, i64 176}
!29 = !{!"_ZTSN7UapkiNS5Pkcs720SignerIdentifierTypeE", !7, i64 0}
!30 = !{!"_ZTSN7UapkiNS7SmartBAE", !6, i64 0}
!31 = !{!"_ZTSN7UapkiNS19AlgorithmIdentifierE", !19, i64 0, !6, i64 32}
!32 = !{!"_ZTSSt6vectorIN7UapkiNS9AttributeESaIS1_EE", !33, i64 0}
!33 = !{!"_ZTSSt12_Vector_baseIN7UapkiNS9AttributeESaIS1_EE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIN7UapkiNS9AttributeESaIS1_EE12_Vector_implE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIN7UapkiNS9AttributeESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!36 = !{!"_ZTSN7UapkiNS5Pkcs716SignedDataParser10SignerInfo14MandatoryAttrsE", !19, i64 0, !30, i64 32}
!37 = !{!"_ZTSN7UapkiNS12VerifyStatusE", !7, i64 0}
!38 = !{!10, !6, i64 536}
!39 = !{!10, !37, i64 544}
!40 = !{!10, !37, i64 548}


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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7UapkiNS3Doc6Verify13AttrTimeStampC2Ev(ptr noundef nonnull align 8 dereferenceable(552) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN7UapkiNS3Tsp13TsTokenParserC1Ev(ptr noundef nonnull align 8 dereferenceable(240) %0)
  %2 = getelementptr inbounds i8, ptr %0, i64 240
  invoke void @_ZN7UapkiNS5Pkcs716SignedDataParser10SignerInfoC1Ev(ptr noundef nonnull align 8 dereferenceable(216) %2)
          to label %3 unwind label %8

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 456
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  %5 = getelementptr inbounds i8, ptr %0, i64 488
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  %6 = getelementptr inbounds i8, ptr %0, i64 520
  tail call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %7 = getelementptr inbounds i8, ptr %0, i64 528
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, i8 0, i64 24, i1 false)
  ret void

8:                                                ; preds = %1
  %9 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN7UapkiNS3Tsp13TsTokenParserD1Ev(ptr noundef nonnull align 8 dereferenceable(240) %0) #5
  resume { ptr, i32 } %9
}

declare void @_ZN7UapkiNS3Tsp13TsTokenParserC1Ev(ptr noundef nonnull align 8 dereferenceable(240)) unnamed_addr #1

declare void @_ZN7UapkiNS5Pkcs716SignedDataParser10SignerInfoC1Ev(ptr noundef nonnull align 8 dereferenceable(216)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

; Function Attrs: nounwind
declare void @_ZN7UapkiNS3Tsp13TsTokenParserD1Ev(ptr noundef nonnull align 8 dereferenceable(240)) unnamed_addr #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass