; LLVM IR from specinfo-ua/UAPKI :: library/uapki/src (ocsp-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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.UapkiNS::Ocsp::OcspHelper" = type <{ %"class.std::vector", ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<UapkiNS::Ocsp::OcspHelper::SingleResponseInfo, std::allocator<UapkiNS::Ocsp::OcspHelper::SingleResponseInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::Ocsp::OcspHelper::SingleResponseInfo, std::allocator<UapkiNS::Ocsp::OcspHelper::SingleResponseInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::Ocsp::OcspHelper::SingleResponseInfo, std::allocator<UapkiNS::Ocsp::OcspHelper::SingleResponseInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::Ocsp::OcspHelper::SingleResponseInfo, std::allocator<UapkiNS::Ocsp::OcspHelper::SingleResponseInfo>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Signature = type { %struct.AlgorithmIdentifier, %struct.BIT_STRING_s, ptr, %struct.asn_struct_ctx_s }
%struct.AlgorithmIdentifier = type { %struct.ASN__PRIMITIVE_TYPE_s, ptr, %struct.asn_struct_ctx_s }
%struct.ASN__PRIMITIVE_TYPE_s = type { ptr, i32 }
%struct.BIT_STRING_s = type { ptr, i32, i32, %struct.asn_struct_ctx_s }
%struct.asn_struct_ctx_s = type { i16, i16, i32, ptr, i64 }
%struct.Certificates = type { %struct.anon.20, %struct.asn_struct_ctx_s }
%struct.anon.20 = type { ptr, i32, i32, ptr }
%struct.OCSPRequest = type { %struct.TBSRequest, ptr, %struct.asn_struct_ctx_s }
%struct.TBSRequest = type { ptr, ptr, %"struct.TBSRequest::requestList", ptr, %struct.asn_struct_ctx_s }
%"struct.TBSRequest::requestList" = type { %struct.anon, %struct.asn_struct_ctx_s }
%struct.anon = type { ptr, i32, i32, ptr }

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

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #1

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

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

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

declare noundef i32 @_ZN7UapkiNS4Util25algorithmIdentifierToAsn1ER19AlgorithmIdentifierRKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(40)) #0

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS4Ocsp10OcspHelper12setSignatureERKNS_19AlgorithmIdentifierEPK12ByteArray_stRKSt6vectorIPS5_SaIS9_EE(ptr noundef nonnull align 8 dereferenceable(92) %0, ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3) #4 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %18 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store ptr null, ptr %12, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.UapkiNS::Ocsp::OcspHelper", ptr %18, i32 0, i32 1
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %28

22:                                               ; preds = %4
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = call noundef zeroext i1 @_ZNK7UapkiNS19AlgorithmIdentifier9isPresentEv(ptr noundef nonnull align 8 dereferenceable(40) %23)
  br i1 %24, label %25, label %28

25:                                               ; preds = %22
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %29, label %28

28:                                               ; preds = %25, %22, %4
  store i32 4101, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %140

29:                                               ; preds = %25
  %30 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 120) #7
  store ptr %30, ptr %12, align 8, !tbaa !5
  br label %31

31:                                               ; preds = %29
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %36

34:                                               ; preds = %31
  store i32 1, ptr %10, align 4, !tbaa !9
  %35 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 296, i32 noundef %35, ptr noundef null)
  br label %134

36:                                               ; preds = %31
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.Signature, ptr %40, i32 0, i32 0
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = call noundef i32 @_ZN7UapkiNS4Util25algorithmIdentifierToAsn1ER19AlgorithmIdentifierRKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(48) %41, ptr noundef nonnull align 8 dereferenceable(40) %42)
  store i32 %43, ptr %10, align 4, !tbaa !9
  %44 = load i32, ptr %10, align 4, !tbaa !9
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %48

46:                                               ; preds = %39
  %47 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 299, i32 noundef %47)
  br label %134

48:                                               ; preds = %39
  br label %49

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.Signature, ptr %53, i32 0, i32 1
  %55 = call i32 @asn_ba2BITSTRING(ptr noundef %52, ptr noundef %54)
  store i32 %55, ptr %10, align 4, !tbaa !9
  %56 = load i32, ptr %10, align 4, !tbaa !9
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %60

58:                                               ; preds = %51
  %59 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 302, i32 noundef %59)
  br label %134

60:                                               ; preds = %51
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = call noundef zeroext i1 @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %63) #6
  br i1 %64, label %84, label %65

65:                                               ; preds = %62
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.Signature, ptr %66, i32 0, i32 2
  %68 = load ptr, ptr %67, align 8, !tbaa !19
  %69 = icmp ne ptr %68, null
  br i1 %69, label %84, label %70

70:                                               ; preds = %65
  %71 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 48) #7
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.Signature, ptr %72, i32 0, i32 2
  store ptr %71, ptr %73, align 8, !tbaa !19
  br label %74

74:                                               ; preds = %70
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.Signature, ptr %75, i32 0, i32 2
  %77 = load ptr, ptr %76, align 8, !tbaa !19
  %78 = icmp eq ptr %77, null
  br i1 %78, label %79, label %81

79:                                               ; preds = %74
  store i32 1, ptr %10, align 4, !tbaa !9
  %80 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 306, i32 noundef %80, ptr noundef null)
  br label %134

81:                                               ; preds = %74
  br label %82

82:                                               ; preds = %81
  br label %83

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83, %65, %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %85, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = call ptr @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %86) #6
  %88 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %87, ptr %88, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = call ptr @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %89) #6
  %91 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %90, ptr %91, align 8
  br label %92

92:                                               ; preds = %125, %84
  %93 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKP12ByteArray_stSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  br i1 %93, label %95, label %94

94:                                               ; preds = %92
  store i32 11, ptr %13, align 4
  br label %127

95:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKP12ByteArray_stSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  store ptr %96, ptr %17, align 8, !tbaa !5
  br label %97

97:                                               ; preds = %95
  %98 = call ptr @get_Certificate_desc()
  %99 = load ptr, ptr %17, align 8, !tbaa !5
  %100 = load ptr, ptr %99, align 8, !tbaa !5
  %101 = call ptr @asn_decode_ba_with_alloc(ptr noundef %98, ptr noundef %100)
  store ptr %101, ptr %11, align 8, !tbaa !5
  %102 = icmp eq ptr null, %101
  br i1 %102, label %103, label %105

103:                                              ; preds = %97
  store i32 2, ptr %10, align 4, !tbaa !9
  %104 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 309, i32 noundef %104)
  store i32 4, ptr %13, align 4
  br label %122

105:                                              ; preds = %97
  br label %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  br label %108

108:                                              ; preds = %107
  %109 = load ptr, ptr %12, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.Signature, ptr %109, i32 0, i32 2
  %111 = load ptr, ptr %110, align 8, !tbaa !19
  %112 = getelementptr inbounds %struct.Certificates, ptr %111, i32 0, i32 0
  %113 = load ptr, ptr %11, align 8, !tbaa !5
  %114 = call i32 @asn_set_add(ptr noundef %112, ptr noundef %113)
  store i32 %114, ptr %10, align 4, !tbaa !9
  %115 = load i32, ptr %10, align 4, !tbaa !9
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %119

117:                                              ; preds = %108
  %118 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 310, i32 noundef %118)
  store i32 4, ptr %13, align 4
  br label %122

119:                                              ; preds = %108
  br label %120

120:                                              ; preds = %119
  br label %121

121:                                              ; preds = %120
  store ptr null, ptr %11, align 8, !tbaa !5
  store i32 0, ptr %13, align 4
  br label %122

122:                                              ; preds = %121, %117, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  %123 = load i32, ptr %13, align 4
  switch i32 %123, label %127 [
    i32 0, label %124
  ]

124:                                              ; preds = %122
  br label %125

125:                                              ; preds = %124
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKP12ByteArray_stSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  br label %92

127:                                              ; preds = %122, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %128 = load i32, ptr %13, align 4
  switch i32 %128, label %140 [
    i32 11, label %129
    i32 4, label %134
  ]

129:                                              ; preds = %127
  %130 = load ptr, ptr %12, align 8, !tbaa !5
  %131 = getelementptr inbounds %"class.UapkiNS::Ocsp::OcspHelper", ptr %18, i32 0, i32 1
  %132 = load ptr, ptr %131, align 8, !tbaa !11
  %133 = getelementptr inbounds %struct.OCSPRequest, ptr %132, i32 0, i32 1
  store ptr %130, ptr %133, align 8, !tbaa !26
  store ptr null, ptr %12, align 8, !tbaa !5
  br label %134

134:                                              ; preds = %129, %127, %79, %58, %46, %34
  %135 = call ptr @get_Certificate_desc()
  %136 = load ptr, ptr %11, align 8, !tbaa !5
  call void @asn_free(ptr noundef %135, ptr noundef %136)
  %137 = call ptr @get_Signature_desc()
  %138 = load ptr, ptr %12, align 8, !tbaa !5
  call void @asn_free(ptr noundef %137, ptr noundef %138)
  %139 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %139, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %140

140:                                              ; preds = %134, %127, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %141 = load i32, ptr %5, align 4
  ret i32 %141
}

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

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

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

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

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

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

declare ptr @get_Certificate_desc() #0

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

declare ptr @get_Signature_desc() #0

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"_ZTSN7UapkiNS4Ocsp10OcspHelperE", !13, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !17, i64 80, !18, i64 88}
!13 = !{!"_ZTSSt6vectorIN7UapkiNS4Ocsp10OcspHelper18SingleResponseInfoESaIS3_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIN7UapkiNS4Ocsp10OcspHelper18SingleResponseInfoESaIS3_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN7UapkiNS4Ocsp10OcspHelper18SingleResponseInfoESaIS3_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN7UapkiNS4Ocsp10OcspHelper18SingleResponseInfoESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSN7UapkiNS4Ocsp14ResponseStatusE", !7, i64 0}
!19 = !{!20, !6, i64 88}
!20 = !{!"_ZTS9Signature", !21, i64 0, !25, i64 48, !6, i64 88, !23, i64 96}
!21 = !{!"_ZTS19AlgorithmIdentifier", !22, i64 0, !6, i64 16, !23, i64 24}
!22 = !{!"_ZTS21ASN__PRIMITIVE_TYPE_s", !6, i64 0, !10, i64 8}
!23 = !{!"_ZTS16asn_struct_ctx_s", !24, i64 0, !24, i64 2, !10, i64 4, !6, i64 8, !17, i64 16}
!24 = !{!"short", !7, i64 0}
!25 = !{!"_ZTS12BIT_STRING_s", !6, i64 0, !10, i64 8, !10, i64 12, !23, i64 16}
!26 = !{!27, !6, i64 96}
!27 = !{!"_ZTS11OCSPRequest", !28, i64 0, !6, i64 96, !23, i64 104}
!28 = !{!"_ZTS10TBSRequest", !6, i64 0, !6, i64 8, !29, i64 16, !6, i64 64, !23, i64 72}
!29 = !{!"_ZTSN10TBSRequest11requestListE", !30, i64 0, !23, i64 24}
!30 = !{!"_ZTSN10TBSRequest11requestListUt_E", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}


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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #1

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

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

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

declare noundef i32 @_ZN7UapkiNS4Util25algorithmIdentifierToAsn1ER19AlgorithmIdentifierRKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0

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

declare i32 @asn_set_add(ptr noundef, ptr 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) #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS4Ocsp10OcspHelper12setSignatureERKNS_19AlgorithmIdentifierEPK12ByteArray_stRKSt6vectorIPS5_SaIS9_EE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(92) %0, ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3) local_unnamed_addr #4 align 2 {
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %57, label %9

9:                                                ; preds = %4
  %10 = tail call noundef zeroext i1 @_ZNK7UapkiNS19AlgorithmIdentifier9isPresentEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  %11 = icmp ne ptr %2, null
  %or.cond = and i1 %11, %10
  br i1 %or.cond, label %12, label %57

12:                                               ; preds = %9
  %13 = tail call noalias dereferenceable_or_null(120) ptr @calloc(i64 noundef 1, i64 noundef 120) #6
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %16

15:                                               ; preds = %12
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 296, i32 noundef 1, ptr noundef null)
  br label %54

16:                                               ; preds = %12
  %17 = tail call noundef i32 @_ZN7UapkiNS4Util25algorithmIdentifierToAsn1ER19AlgorithmIdentifierRKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(40) %1)
  %.not52 = icmp eq i32 %17, 0
  br i1 %.not52, label %19, label %18

18:                                               ; preds = %16
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 299, i32 noundef %17)
  br label %54

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %13, i64 48
  %21 = tail call i32 @asn_ba2BITSTRING(ptr noundef nonnull %2, ptr noundef nonnull %20)
  %.not53 = icmp eq i32 %21, 0
  br i1 %.not53, label %23, label %22

22:                                               ; preds = %19
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 302, i32 noundef %21)
  br label %54

23:                                               ; preds = %19
  %24 = tail call noundef zeroext i1 @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  br i1 %24, label %32, label %25

25:                                               ; preds = %23
  %26 = getelementptr inbounds i8, ptr %13, i64 88
  %27 = load ptr, ptr %26, align 8, !tbaa !16
  %.not54 = icmp eq ptr %27, null
  br i1 %.not54, label %28, label %32

28:                                               ; preds = %25
  %29 = tail call noalias dereferenceable_or_null(48) ptr @calloc(i64 noundef 1, i64 noundef 48) #6
  store ptr %29, ptr %26, align 8, !tbaa !16
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %32

31:                                               ; preds = %28
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 306, i32 noundef 1, ptr noundef null)
  br label %54

32:                                               ; preds = %28, %25, %23
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %33 = tail call ptr @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  store ptr %33, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %34 = tail call ptr @_ZNKSt6vectorIP12ByteArray_stSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  store ptr %34, ptr %6, align 8
  %35 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKP12ByteArray_stSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br i1 %35, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %32
  %36 = getelementptr inbounds i8, ptr %13, i64 88
  br label %37

37:                                               ; preds = %.lr.ph, %48
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKP12ByteArray_stSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %39 = call ptr @get_Certificate_desc()
  %40 = load ptr, ptr %38, align 8, !tbaa !24
  %41 = call ptr @asn_decode_ba_with_alloc(ptr noundef %39, ptr noundef %40)
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %44

43:                                               ; preds = %37
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 309, i32 noundef 2)
  br label %51

44:                                               ; preds = %37
  %45 = load ptr, ptr %36, align 8, !tbaa !16
  %46 = call i32 @asn_set_add(ptr noundef %45, ptr noundef nonnull %41)
  %.not55 = icmp eq i32 %46, 0
  br i1 %.not55, label %48, label %47

47:                                               ; preds = %44
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 310, i32 noundef %46)
  br label %51

48:                                               ; preds = %44
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKP12ByteArray_stSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %50 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKP12ByteArray_stSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br i1 %50, label %37, label %._crit_edge

51:                                               ; preds = %43, %47
  %.1.ph = phi i32 [ %46, %47 ], [ 2, %43 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %54

._crit_edge:                                      ; preds = %48, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 96
  store ptr %13, ptr %53, align 8, !tbaa !25
  br label %54

54:                                               ; preds = %51, %._crit_edge, %31, %22, %18, %15
  %.341 = phi ptr [ null, %15 ], [ null, %18 ], [ null, %22 ], [ %41, %51 ], [ null, %._crit_edge ], [ null, %31 ]
  %.037 = phi ptr [ null, %15 ], [ %13, %18 ], [ %13, %22 ], [ %13, %51 ], [ null, %._crit_edge ], [ %13, %31 ]
  %.3 = phi i32 [ 1, %15 ], [ %17, %18 ], [ %21, %22 ], [ %.1.ph, %51 ], [ 0, %._crit_edge ], [ 1, %31 ]
  %55 = call ptr @get_Certificate_desc()
  call void @asn_free(ptr noundef %55, ptr noundef %.341)
  %56 = call ptr @get_Signature_desc()
  call void @asn_free(ptr noundef %56, ptr noundef %.037)
  br label %57

57:                                               ; preds = %4, %9, %54
  %.0 = phi i32 [ %.3, %54 ], [ 4101, %9 ], [ 4101, %4 ]
  ret i32 %.0
}

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

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

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

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

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

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

declare ptr @get_Certificate_desc() local_unnamed_addr #0

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

declare ptr @get_Signature_desc() local_unnamed_addr #0

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 nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind allocsize(0,1) }
attributes #7 = { 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, !11, i64 24}
!6 = !{!"_ZTSN7UapkiNS4Ocsp10OcspHelperE", !7, i64 0, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !14, i64 80, !15, i64 88}
!7 = !{!"_ZTSSt6vectorIN7UapkiNS4Ocsp10OcspHelper18SingleResponseInfoESaIS3_EE", !8, i64 0}
!8 = !{!"_ZTSSt12_Vector_baseIN7UapkiNS4Ocsp10OcspHelper18SingleResponseInfoESaIS3_EE", !9, i64 0}
!9 = !{!"_ZTSNSt12_Vector_baseIN7UapkiNS4Ocsp10OcspHelper18SingleResponseInfoESaIS3_EE12_Vector_implE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseIN7UapkiNS4Ocsp10OcspHelper18SingleResponseInfoESaIS3_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"long", !12, i64 0}
!15 = !{!"_ZTSN7UapkiNS4Ocsp14ResponseStatusE", !12, i64 0}
!16 = !{!17, !11, i64 88}
!17 = !{!"_ZTS9Signature", !18, i64 0, !23, i64 48, !11, i64 88, !21, i64 96}
!18 = !{!"_ZTS19AlgorithmIdentifier", !19, i64 0, !11, i64 16, !21, i64 24}
!19 = !{!"_ZTS21ASN__PRIMITIVE_TYPE_s", !11, i64 0, !20, i64 8}
!20 = !{!"int", !12, i64 0}
!21 = !{!"_ZTS16asn_struct_ctx_s", !22, i64 0, !22, i64 2, !20, i64 4, !11, i64 8, !14, i64 16}
!22 = !{!"short", !12, i64 0}
!23 = !{!"_ZTS12BIT_STRING_s", !11, i64 0, !20, i64 8, !20, i64 12, !21, i64 16}
!24 = !{!11, !11, i64 0}
!25 = !{!26, !11, i64 96}
!26 = !{!"_ZTS11OCSPRequest", !27, i64 0, !11, i64 96, !21, i64 104}
!27 = !{!"_ZTS10TBSRequest", !11, i64 0, !11, i64 8, !28, i64 16, !11, i64 64, !21, i64 72}
!28 = !{!"_ZTSN10TBSRequest11requestListE", !29, i64 0, !21, i64 24}
!29 = !{!"_ZTSN10TBSRequest11requestListUt_E", !11, i64 0, !20, i64 8, !20, i64 12, !11, i64 16}


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