; LLVM IR from specinfo-ua/UAPKI :: library/common/pkix (tsp-helper)

; 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.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::allocator" = type { i8 }
%struct.TimeStampResp = type { %struct.PKIStatusInfo, ptr, %struct.asn_struct_ctx_s }
%struct.PKIStatusInfo = type { %struct.ASN__PRIMITIVE_TYPE_s, ptr, ptr, %struct.asn_struct_ctx_s }
%struct.ASN__PRIMITIVE_TYPE_s = type { ptr, i32 }
%struct.asn_struct_ctx_s = type { i16, i16, i32, ptr, i64 }
%"class.UapkiNS::Tsp::TspHelper" = type { ptr, ptr, ptr, ptr, i32, ptr }

@.str = external hidden unnamed_addr constant [27 x i8], align 1
@OID_PKCS9_TST_INFO = external global ptr, align 8

declare i32 @__gxx_personality_v0(...)

declare void @asn_free(ptr noundef, ptr noundef) #0

declare ptr @get_TSTInfo_desc() #0

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

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

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

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #0

declare i32 @asn_encode_ba(ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS3Tsp9TspHelper13parseResponseEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.UapkiNS::Pkcs7::SignedDataParser", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::allocator", align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !11
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %20, label %19

19:                                               ; preds = %2
  store i32 4212, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %152

20:                                               ; preds = %2
  br label %21

21:                                               ; preds = %20
  %22 = call ptr @get_TimeStampResp_desc()
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call ptr @asn_decode_ba_with_alloc(ptr noundef %22, ptr noundef %23)
  store ptr %24, ptr %7, align 8, !tbaa !5
  %25 = icmp eq ptr null, %24
  br i1 %25, label %26, label %28

26:                                               ; preds = %21
  store i32 2, ptr %6, align 4, !tbaa !9
  %27 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 213, i32 noundef %27)
  br label %148

28:                                               ; preds = %21
  br label %29

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.TimeStampResp, ptr %32, i32 0, i32 0
  %34 = getelementptr inbounds %struct.PKIStatusInfo, ptr %33, i32 0, i32 0
  %35 = call i32 @asn_INTEGER2ulong(ptr noundef %34, ptr noundef %8)
  store i32 %35, ptr %6, align 4, !tbaa !9
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %40

38:                                               ; preds = %31
  %39 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 215, i32 noundef %39)
  br label %148

40:                                               ; preds = %31
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  %43 = load i64, ptr %8, align 8, !tbaa !11
  %44 = trunc i64 %43 to i32
  %45 = getelementptr inbounds %"class.UapkiNS::Tsp::TspHelper", ptr %16, i32 0, i32 4
  store i32 %44, ptr %45, align 8, !tbaa !13
  %46 = getelementptr inbounds %"class.UapkiNS::Tsp::TspHelper", ptr %16, i32 0, i32 4
  %47 = load i32, ptr %46, align 8, !tbaa !13
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %53, label %49

49:                                               ; preds = %42
  %50 = getelementptr inbounds %"class.UapkiNS::Tsp::TspHelper", ptr %16, i32 0, i32 4
  %51 = load i32, ptr %50, align 8, !tbaa !13
  %52 = icmp eq i32 %51, 1
  br i1 %52, label %53, label %147

53:                                               ; preds = %49, %42
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.TimeStampResp, ptr %54, i32 0, i32 1
  %56 = load ptr, ptr %55, align 8, !tbaa !16
  %57 = icmp ne ptr %56, null
  br i1 %57, label %63, label %58

58:                                               ; preds = %53
  br label %59

59:                                               ; preds = %58
  store i32 4212, ptr %6, align 4, !tbaa !9
  %60 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 220, i32 noundef %60, ptr noundef null)
  br label %148

61:                                               ; No predecessors!
  br label %62

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62, %53
  br label %64

64:                                               ; preds = %63
  %65 = call ptr @get_ContentInfo_desc()
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.TimeStampResp, ptr %66, i32 0, i32 1
  %68 = load ptr, ptr %67, align 8, !tbaa !16
  %69 = getelementptr inbounds %"class.UapkiNS::Tsp::TspHelper", ptr %16, i32 0, i32 5
  %70 = call i32 @asn_encode_ba(ptr noundef %65, ptr noundef %68, ptr noundef %69)
  store i32 %70, ptr %6, align 4, !tbaa !9
  %71 = load i32, ptr %6, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %75

73:                                               ; preds = %64
  %74 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 223, i32 noundef %74)
  br label %148

75:                                               ; preds = %64
  br label %76

76:                                               ; preds = %75
  br label %77

77:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 136, ptr %10) #6
  call void @_ZN7UapkiNS5Pkcs716SignedDataParserC1Ev(ptr noundef nonnull align 8 dereferenceable(136) %10)
  br label %78

78:                                               ; preds = %77
  %79 = getelementptr inbounds %"class.UapkiNS::Tsp::TspHelper", ptr %16, i32 0, i32 5
  %80 = load ptr, ptr %79, align 8, !tbaa !22
  %81 = invoke noundef i32 @_ZN7UapkiNS5Pkcs716SignedDataParser5parseEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(136) %10, ptr noundef %80)
          to label %82 unwind label %88

82:                                               ; preds = %78
  store i32 %81, ptr %6, align 4, !tbaa !9
  %83 = load i32, ptr %6, align 4, !tbaa !9
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %92

85:                                               ; preds = %82
  %86 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 226, i32 noundef %86)
          to label %87 unwind label %88

87:                                               ; preds = %85
  store i32 4, ptr %9, align 4
  br label %142

88:                                               ; preds = %85, %78
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %11, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %12, align 4
  br label %146

92:                                               ; preds = %82
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %95 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZNK7UapkiNS5Pkcs716SignedDataParser19getEncapContentInfoEv(ptr noundef nonnull align 8 dereferenceable(136) %10)
          to label %96 unwind label %114

96:                                               ; preds = %94
  store ptr %95, ptr %13, align 8, !tbaa !5
  %97 = load ptr, ptr %13, align 8, !tbaa !5
  %98 = getelementptr inbounds %"struct.UapkiNS::Pkcs7::EncapsulatedContentInfo", ptr %97, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  %99 = load ptr, ptr @OID_PKCS9_TST_INFO, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef %99, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %100 unwind label %118

100:                                              ; preds = %96
  %101 = call noundef zeroext i1 @_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EESA_(ptr noundef nonnull align 8 dereferenceable(32) %98, ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  br i1 %101, label %108, label %102

102:                                              ; preds = %100
  %103 = load ptr, ptr %13, align 8, !tbaa !5
  %104 = getelementptr inbounds %"struct.UapkiNS::Pkcs7::EncapsulatedContentInfo", ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !23
  %106 = icmp ne ptr %105, null
  %107 = xor i1 %106, true
  br label %108

108:                                              ; preds = %102, %100
  %109 = phi i1 [ true, %100 ], [ %107, %102 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  br i1 %109, label %110, label %124

110:                                              ; preds = %108
  br label %111

111:                                              ; preds = %110
  store i32 4212, ptr %6, align 4, !tbaa !9
  %112 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 230, i32 noundef %112, ptr noundef null)
          to label %113 unwind label %114

113:                                              ; preds = %111
  store i32 4, ptr %9, align 4
  br label %141

114:                                              ; preds = %135, %127, %125, %111, %94
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %11, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %12, align 4
  br label %145

118:                                              ; preds = %96
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %11, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %12, align 4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  br label %145

122:                                              ; No predecessors!
  br label %123

123:                                              ; preds = %122
  br label %124

124:                                              ; preds = %123, %108
  br label %125

125:                                              ; preds = %124
  %126 = invoke ptr @get_TSTInfo_desc()
          to label %127 unwind label %114

127:                                              ; preds = %125
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = getelementptr inbounds %"struct.UapkiNS::Pkcs7::EncapsulatedContentInfo", ptr %128, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8, !tbaa !23
  %131 = invoke ptr @asn_decode_ba_with_alloc(ptr noundef %126, ptr noundef %130)
          to label %132 unwind label %114

132:                                              ; preds = %127
  %133 = getelementptr inbounds %"class.UapkiNS::Tsp::TspHelper", ptr %16, i32 0, i32 1
  store ptr %131, ptr %133, align 8, !tbaa !27
  %134 = icmp eq ptr null, %131
  br i1 %134, label %135, label %138

135:                                              ; preds = %132
  store i32 2, ptr %6, align 4, !tbaa !9
  %136 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 233, i32 noundef %136)
          to label %137 unwind label %114

137:                                              ; preds = %135
  store i32 4, ptr %9, align 4
  br label %141

138:                                              ; preds = %132
  br label %139

139:                                              ; preds = %138
  br label %140

140:                                              ; preds = %139
  store i32 0, ptr %9, align 4
  br label %141

141:                                              ; preds = %140, %137, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %142

142:                                              ; preds = %141, %87
  call void @_ZN7UapkiNS5Pkcs716SignedDataParserD1Ev(ptr noundef nonnull align 8 dereferenceable(136) %10) #6
  call void @llvm.lifetime.end.p0(i64 136, ptr %10) #6
  %143 = load i32, ptr %9, align 4
  switch i32 %143, label %152 [
    i32 0, label %144
    i32 4, label %148
  ]

144:                                              ; preds = %142
  br label %147

145:                                              ; preds = %118, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %146

146:                                              ; preds = %145, %88
  call void @_ZN7UapkiNS5Pkcs716SignedDataParserD1Ev(ptr noundef nonnull align 8 dereferenceable(136) %10) #6
  call void @llvm.lifetime.end.p0(i64 136, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %154

147:                                              ; preds = %144, %49
  br label %148

148:                                              ; preds = %147, %142, %73, %59, %38, %26
  %149 = call ptr @get_TimeStampResp_desc()
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  call void @asn_free(ptr noundef %149, ptr noundef %150)
  %151 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %151, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %152

152:                                              ; preds = %148, %142, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %153 = load i32, ptr %3, align 4
  ret i32 %153

154:                                              ; preds = %146
  %155 = load ptr, ptr %11, align 8
  %156 = load i32, ptr %12, align 4
  %157 = insertvalue { ptr, i32 } poison, ptr %155, 0
  %158 = insertvalue { ptr, i32 } %157, i32 %156, 1
  resume { ptr, i32 } %158
}

declare ptr @asn_decode_ba_with_alloc(ptr noundef, ptr noundef) #0

declare ptr @get_TimeStampResp_desc() #0

declare i32 @asn_INTEGER2ulong(ptr noundef, ptr noundef) #0

declare ptr @get_ContentInfo_desc() #0

declare void @_ZN7UapkiNS5Pkcs716SignedDataParserC1Ev(ptr noundef nonnull align 8 dereferenceable(136)) unnamed_addr #0

declare noundef i32 @_ZN7UapkiNS5Pkcs716SignedDataParser5parseEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) 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 #3 align 2

; Function Attrs: nounwind
declare void @_ZN7UapkiNS5Pkcs716SignedDataParserD1Ev(ptr noundef nonnull align 8 dereferenceable(136)) unnamed_addr #5

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

attributes #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 = { 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 #3 = { 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 = { 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 #5 = { 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 #6 = { 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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !15, i64 32}
!14 = !{!"_ZTSN7UapkiNS3Tsp9TspHelperE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !15, i64 32, !6, i64 40}
!15 = !{!"_ZTSN7UapkiNS3Tsp9PkiStatusE", !7, i64 0}
!16 = !{!17, !6, i64 56}
!17 = !{!"_ZTS13TimeStampResp", !18, i64 0, !6, i64 56, !20, i64 64}
!18 = !{!"_ZTS13PKIStatusInfo", !19, i64 0, !6, i64 16, !6, i64 24, !20, i64 32}
!19 = !{!"_ZTS21ASN__PRIMITIVE_TYPE_s", !6, i64 0, !10, i64 8}
!20 = !{!"_ZTS16asn_struct_ctx_s", !21, i64 0, !21, i64 2, !10, i64 4, !6, i64 8, !12, i64 16}
!21 = !{!"short", !7, i64 0}
!22 = !{!14, !6, i64 40}
!23 = !{!24, !6, i64 32}
!24 = !{!"_ZTSN7UapkiNS5Pkcs723EncapsulatedContentInfoE", !25, i64 0, !6, i64 32}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !26, i64 0, !12, i64 8, !7, i64 16}
!26 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!27 = !{!14, !6, i64 8}


; 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.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::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [27 x i8], align 1
@OID_PKCS9_TST_INFO = external local_unnamed_addr global ptr, align 8

declare i32 @__gxx_personality_v0(...)

declare void @asn_free(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @get_TSTInfo_desc() local_unnamed_addr #0

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

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

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

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare i32 @asn_encode_ba(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS3Tsp9TspHelper13parseResponseEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i64, align 8
  %4 = alloca %"class.UapkiNS::Pkcs7::SignedDataParser", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  store i64 0, ptr %3, align 8, !tbaa !5
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %62, label %7

7:                                                ; preds = %2
  %8 = tail call ptr @get_TimeStampResp_desc()
  %9 = tail call ptr @asn_decode_ba_with_alloc(ptr noundef %8, ptr noundef nonnull %1)
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %12

11:                                               ; preds = %7
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 213, i32 noundef 2)
  br label %60

12:                                               ; preds = %7
  %13 = call i32 @asn_INTEGER2ulong(ptr noundef nonnull %9, ptr noundef nonnull %3)
  %.not39 = icmp eq i32 %13, 0
  br i1 %.not39, label %15, label %14

14:                                               ; preds = %12
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 215, i32 noundef %13)
  br label %60

15:                                               ; preds = %12
  %16 = load i64, ptr %3, align 8, !tbaa !5
  %17 = trunc i64 %16 to i32
  %18 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 %17, ptr %18, align 8, !tbaa !9
  %switch = icmp ult i32 %17, 2
  br i1 %switch, label %19, label %60

19:                                               ; preds = %15
  %20 = getelementptr inbounds i8, ptr %9, i64 56
  %21 = load ptr, ptr %20, align 8, !tbaa !13
  %.not40 = icmp eq ptr %21, null
  br i1 %.not40, label %22, label %23

22:                                               ; preds = %19
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 220, i32 noundef 4212, ptr noundef null)
  br label %60

23:                                               ; preds = %19
  %24 = call ptr @get_ContentInfo_desc()
  %25 = load ptr, ptr %20, align 8, !tbaa !13
  %26 = getelementptr inbounds i8, ptr %0, i64 40
  %27 = call i32 @asn_encode_ba(ptr noundef %24, ptr noundef %25, ptr noundef nonnull %26)
  %.not41 = icmp eq i32 %27, 0
  br i1 %.not41, label %29, label %28

28:                                               ; preds = %23
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 223, i32 noundef %27)
  br label %60

29:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 136, ptr nonnull %4) #6
  call void @_ZN7UapkiNS5Pkcs716SignedDataParserC1Ev(ptr noundef nonnull align 8 dereferenceable(136) %4)
  %30 = load ptr, ptr %26, align 8, !tbaa !20
  %31 = invoke noundef i32 @_ZN7UapkiNS5Pkcs716SignedDataParser5parseEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(136) %4, ptr noundef %30)
          to label %32 unwind label %34

32:                                               ; preds = %29
  %.not42 = icmp eq i32 %31, 0
  br i1 %.not42, label %36, label %33

33:                                               ; preds = %32
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 226, i32 noundef %31)
          to label %58 unwind label %34

34:                                               ; preds = %33, %29
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %59

36:                                               ; preds = %32
  %37 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK7UapkiNS5Pkcs716SignedDataParser19getEncapContentInfoEv(ptr noundef nonnull align 8 dereferenceable(136) %4)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  %38 = load ptr, ptr @OID_PKCS9_TST_INFO, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef %38, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %39 unwind label %47

39:                                               ; preds = %36
  %40 = call noundef zeroext i1 @_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EESA_(ptr noundef nonnull align 8 dereferenceable(32) %37, ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  br i1 %40, label %.critedge, label %41

41:                                               ; preds = %39
  %42 = getelementptr inbounds i8, ptr %37, i64 32
  %43 = load ptr, ptr %42, align 8, !tbaa !22
  %.not43 = icmp eq ptr %43, null
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br i1 %.not43, label %44, label %49

.critedge:                                        ; preds = %39
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %44

44:                                               ; preds = %41, %.critedge
  invoke void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 230, i32 noundef 4212, ptr noundef null)
          to label %58 unwind label %45

45:                                               ; preds = %57, %51, %49, %44
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %59

47:                                               ; preds = %36
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %59

49:                                               ; preds = %41
  %50 = invoke ptr @get_TSTInfo_desc()
          to label %51 unwind label %45

51:                                               ; preds = %49
  %52 = load ptr, ptr %42, align 8, !tbaa !22
  %53 = invoke ptr @asn_decode_ba_with_alloc(ptr noundef %50, ptr noundef %52)
          to label %54 unwind label %45

54:                                               ; preds = %51
  %55 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %53, ptr %55, align 8, !tbaa !26
  %56 = icmp eq ptr %53, null
  br i1 %56, label %57, label %58

57:                                               ; preds = %54
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 233, i32 noundef 2)
          to label %58 unwind label %45

58:                                               ; preds = %44, %57, %54, %33
  %.130 = phi i32 [ %31, %33 ], [ 4212, %44 ], [ 2, %57 ], [ 0, %54 ]
  call void @_ZN7UapkiNS5Pkcs716SignedDataParserD1Ev(ptr noundef nonnull align 8 dereferenceable(136) %4) #6
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %4) #6
  br label %60

59:                                               ; preds = %45, %47, %34
  %.pn45 = phi { ptr, i32 } [ %35, %34 ], [ %46, %45 ], [ %48, %47 ]
  call void @_ZN7UapkiNS5Pkcs716SignedDataParserD1Ev(ptr noundef nonnull align 8 dereferenceable(136) %4) #6
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn45

60:                                               ; preds = %15, %58, %28, %22, %14, %11
  %.2 = phi i32 [ 2, %11 ], [ %13, %14 ], [ %27, %28 ], [ %.130, %58 ], [ 4212, %22 ], [ 0, %15 ]
  %61 = call ptr @get_TimeStampResp_desc()
  call void @asn_free(ptr noundef %61, ptr noundef %9)
  br label %62

62:                                               ; preds = %2, %60
  %.0 = phi i32 [ %.2, %60 ], [ 4212, %2 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i32 %.0
}

declare ptr @asn_decode_ba_with_alloc(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @get_TimeStampResp_desc() local_unnamed_addr #0

declare i32 @asn_INTEGER2ulong(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @get_ContentInfo_desc() local_unnamed_addr #0

declare void @_ZN7UapkiNS5Pkcs716SignedDataParserC1Ev(ptr noundef nonnull align 8 dereferenceable(136)) unnamed_addr #0

declare noundef i32 @_ZN7UapkiNS5Pkcs716SignedDataParser5parseEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) 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 #3 align 2

; Function Attrs: nounwind
declare void @_ZN7UapkiNS5Pkcs716SignedDataParserD1Ev(ptr noundef nonnull align 8 dereferenceable(136)) unnamed_addr #5

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

attributes #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 = { 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 #3 = { 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 = { 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 #5 = { 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 #6 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 32}
!10 = !{!"_ZTSN7UapkiNS3Tsp9TspHelperE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !12, i64 32, !11, i64 40}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"_ZTSN7UapkiNS3Tsp9PkiStatusE", !7, i64 0}
!13 = !{!14, !11, i64 56}
!14 = !{!"_ZTS13TimeStampResp", !15, i64 0, !11, i64 56, !18, i64 64}
!15 = !{!"_ZTS13PKIStatusInfo", !16, i64 0, !11, i64 16, !11, i64 24, !18, i64 32}
!16 = !{!"_ZTS21ASN__PRIMITIVE_TYPE_s", !11, i64 0, !17, i64 8}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTS16asn_struct_ctx_s", !19, i64 0, !19, i64 2, !17, i64 4, !11, i64 8, !6, i64 16}
!19 = !{!"short", !7, i64 0}
!20 = !{!10, !11, i64 40}
!21 = !{!11, !11, i64 0}
!22 = !{!23, !11, i64 32}
!23 = !{!"_ZTSN7UapkiNS5Pkcs723EncapsulatedContentInfoE", !24, i64 0, !11, i64 32}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !25, i64 0, !6, i64 8, !7, i64 16}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !11, i64 0}
!26 = !{!10, !11, i64 8}


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