; LLVM IR from specinfo-ua/UAPKI :: library/common/pkix (attribute-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.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.std::allocator.6" = type { i8 }
%"class.UapkiNS::AttributeHelper::RevocationRefsBuilder::CrlOcspRef" = type { ptr }
%struct.CrlOcspRef = type { ptr, ptr, ptr, %struct.asn_struct_ctx_s }
%struct.asn_struct_ctx_s = type { i16, i16, i32, ptr, i64 }
%"struct.UapkiNS::OtherHash" = type { %"struct.UapkiNS::AlgorithmIdentifier", ptr }
%"struct.UapkiNS::AlgorithmIdentifier" = type { %"class.std::__cxx11::basic_string", ptr }
%struct.CrlValidatedID = type { %struct.OtherHash, ptr, %struct.asn_struct_ctx_s }
%struct.OtherHash = type { i32, %"union.OtherHash::OtherHash_u", %struct.asn_struct_ctx_s }
%"union.OtherHash::OtherHash_u" = type { %struct.OtherHashAlgAndValue }
%struct.OtherHashAlgAndValue = type { %struct.AlgorithmIdentifier, %struct.OCTET_STRING, %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.OCTET_STRING = type { ptr, i32, %struct.asn_struct_ctx_s }
%struct.CRLListID = type { %"struct.CRLListID::crls", %struct.asn_struct_ctx_s }
%"struct.CRLListID::crls" = type { %struct.anon.29, %struct.asn_struct_ctx_s }
%struct.anon.29 = type { ptr, i32, i32, ptr }

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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 #3 align 2

declare i32 @__gxx_personality_v0(...)

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7UapkiNS9OtherHash9isPresentEv(ptr noundef nonnull align 8 dereferenceable(48)) #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)) #5

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

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

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

19:                                               ; preds = %3
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call noundef zeroext i1 @_ZNK7UapkiNS9OtherHash9isPresentEv(ptr noundef nonnull align 8 dereferenceable(48) %20)
  br i1 %21, label %23, label %22

22:                                               ; preds = %19, %3
  store i32 4101, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %156

23:                                               ; preds = %19
  %24 = getelementptr inbounds %"class.UapkiNS::AttributeHelper::RevocationRefsBuilder::CrlOcspRef", ptr %15, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !11
  %26 = getelementptr inbounds %struct.CrlOcspRef, ptr %25, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = icmp ne ptr %27, null
  br i1 %28, label %45, label %29

29:                                               ; preds = %23
  %30 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 72) #7
  %31 = getelementptr inbounds %"class.UapkiNS::AttributeHelper::RevocationRefsBuilder::CrlOcspRef", ptr %15, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8, !tbaa !11
  %33 = getelementptr inbounds %struct.CrlOcspRef, ptr %32, i32 0, i32 0
  store ptr %30, ptr %33, align 8, !tbaa !13
  br label %34

34:                                               ; preds = %29
  %35 = getelementptr inbounds %"class.UapkiNS::AttributeHelper::RevocationRefsBuilder::CrlOcspRef", ptr %15, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = getelementptr inbounds %struct.CrlOcspRef, ptr %36, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8, !tbaa !13
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %42

40:                                               ; preds = %34
  store i32 1, ptr %8, align 4, !tbaa !9
  %41 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 723, i32 noundef %41, ptr noundef null)
  br label %152

42:                                               ; preds = %34
  br label %43

43:                                               ; preds = %42
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44, %23
  %46 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 176) #7
  store ptr %46, ptr %9, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %45
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = icmp eq ptr %48, null
  br i1 %49, label %50, label %52

50:                                               ; preds = %47
  store i32 1, ptr %8, align 4, !tbaa !9
  %51 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 726, i32 noundef %51, ptr noundef null)
  br label %152

52:                                               ; preds = %47
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.UapkiNS::OtherHash", ptr %55, i32 0, i32 0
  %57 = getelementptr inbounds %"struct.UapkiNS::AlgorithmIdentifier", ptr %56, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #6
  %58 = load ptr, ptr @OID_SHA1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef %58, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %59 unwind label %77

59:                                               ; preds = %54
  %60 = call noundef zeroext i1 @_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EESA_(ptr noundef nonnull align 8 dereferenceable(32) %57, ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  br i1 %60, label %61, label %100

61:                                               ; preds = %59
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.CrlValidatedID, ptr %62, i32 0, i32 0
  %64 = getelementptr inbounds %struct.OtherHash, ptr %63, i32 0, i32 0
  store i32 2, ptr %64, align 8, !tbaa !18
  br label %65

65:                                               ; preds = %61
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.CrlValidatedID, ptr %66, i32 0, i32 0
  %68 = getelementptr inbounds %struct.OtherHash, ptr %67, i32 0, i32 1
  %69 = getelementptr inbounds %struct.OtherHashAlgAndValue, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.UapkiNS::OtherHash", ptr %70, i32 0, i32 0
  %72 = call noundef i32 @_ZN7UapkiNS4Util25algorithmIdentifierToAsn1ER19AlgorithmIdentifierRKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(48) %69, ptr noundef nonnull align 8 dereferenceable(40) %71)
  store i32 %72, ptr %8, align 4, !tbaa !9
  %73 = load i32, ptr %8, align 4, !tbaa !9
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %81

75:                                               ; preds = %65
  %76 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 731, i32 noundef %76)
  br label %152

77:                                               ; preds = %54
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %13, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %14, align 4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %158

81:                                               ; preds = %65
  br label %82

82:                                               ; preds = %81
  br label %83

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.UapkiNS::OtherHash", ptr %85, i32 0, i32 1
  %87 = load ptr, ptr %86, align 8, !tbaa !22
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.CrlValidatedID, ptr %88, i32 0, i32 0
  %90 = getelementptr inbounds %struct.OtherHash, ptr %89, i32 0, i32 1
  %91 = getelementptr inbounds %struct.OtherHashAlgAndValue, ptr %90, i32 0, i32 1
  %92 = call i32 @asn_ba2OCTSTRING(ptr noundef %87, ptr noundef %91)
  store i32 %92, ptr %8, align 4, !tbaa !9
  %93 = load i32, ptr %8, align 4, !tbaa !9
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %97

95:                                               ; preds = %84
  %96 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 732, i32 noundef %96)
  br label %152

97:                                               ; preds = %84
  br label %98

98:                                               ; preds = %97
  br label %99

99:                                               ; preds = %98
  br label %119

100:                                              ; preds = %59
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.CrlValidatedID, ptr %101, i32 0, i32 0
  %103 = getelementptr inbounds %struct.OtherHash, ptr %102, i32 0, i32 0
  store i32 1, ptr %103, align 8, !tbaa !18
  br label %104

104:                                              ; preds = %100
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %"struct.UapkiNS::OtherHash", ptr %105, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !22
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.CrlValidatedID, ptr %108, i32 0, i32 0
  %110 = getelementptr inbounds %struct.OtherHash, ptr %109, i32 0, i32 1
  %111 = call i32 @asn_ba2OCTSTRING(ptr noundef %107, ptr noundef %110)
  store i32 %111, ptr %8, align 4, !tbaa !9
  %112 = load i32, ptr %8, align 4, !tbaa !9
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %116

114:                                              ; preds = %104
  %115 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 736, i32 noundef %115)
  br label %152

116:                                              ; preds = %104
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117
  br label %119

119:                                              ; preds = %118, %99
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = icmp ne ptr %120, null
  br i1 %121, label %122, label %135

122:                                              ; preds = %119
  br label %123

123:                                              ; preds = %122
  %124 = call ptr @get_CrlIdentifier_desc()
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = call ptr @asn_decode_ba_with_alloc(ptr noundef %124, ptr noundef %125)
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.CrlValidatedID, ptr %127, i32 0, i32 1
  store ptr %126, ptr %128, align 8, !tbaa !27
  %129 = icmp eq ptr null, %126
  br i1 %129, label %130, label %132

130:                                              ; preds = %123
  store i32 2, ptr %8, align 4, !tbaa !9
  %131 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 741, i32 noundef %131)
  br label %152

132:                                              ; preds = %123
  br label %133

133:                                              ; preds = %132
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134, %119
  br label %136

136:                                              ; preds = %135
  %137 = getelementptr inbounds %"class.UapkiNS::AttributeHelper::RevocationRefsBuilder::CrlOcspRef", ptr %15, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !11
  %139 = getelementptr inbounds %struct.CrlOcspRef, ptr %138, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !13
  %141 = getelementptr inbounds %struct.CRLListID, ptr %140, i32 0, i32 0
  %142 = getelementptr inbounds %"struct.CRLListID::crls", ptr %141, i32 0, i32 0
  %143 = load ptr, ptr %9, align 8, !tbaa !5
  %144 = call i32 @asn_set_add(ptr noundef %142, ptr noundef %143)
  store i32 %144, ptr %8, align 4, !tbaa !9
  %145 = load i32, ptr %8, align 4, !tbaa !9
  %146 = icmp ne i32 %145, 0
  br i1 %146, label %147, label %149

147:                                              ; preds = %136
  %148 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 744, i32 noundef %148)
  br label %152

149:                                              ; preds = %136
  br label %150

150:                                              ; preds = %149
  br label %151

151:                                              ; preds = %150
  store ptr null, ptr %9, align 8, !tbaa !5
  br label %152

152:                                              ; preds = %151, %147, %130, %114, %95, %75, %50, %40
  %153 = call ptr @get_CrlValidatedID_desc()
  %154 = load ptr, ptr %9, align 8, !tbaa !5
  call void @asn_free(ptr noundef %153, ptr noundef %154)
  %155 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %155, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %156

156:                                              ; preds = %152, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %157 = load i32, ptr %4, align 4
  ret i32 %157

158:                                              ; preds = %77
  %159 = load ptr, ptr %13, align 8
  %160 = load i32, ptr %14, align 4
  %161 = insertvalue { ptr, i32 } poison, ptr %159, 0
  %162 = insertvalue { ptr, i32 } %161, i32 %160, 1
  resume { ptr, i32 } %162
}

declare ptr @get_CrlIdentifier_desc() #1

declare ptr @get_CrlValidatedID_desc() #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #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 0}
!12 = !{!"_ZTSN7UapkiNS15AttributeHelper21RevocationRefsBuilder10CrlOcspRefE", !6, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS10CrlOcspRef", !6, i64 0, !6, i64 8, !6, i64 16, !15, i64 24}
!15 = !{!"_ZTS16asn_struct_ctx_s", !16, i64 0, !16, i64 2, !10, i64 4, !6, i64 8, !17, i64 16}
!16 = !{!"short", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!19, !21, i64 0}
!19 = !{!"_ZTS14CrlValidatedID", !20, i64 0, !6, i64 144, !15, i64 152}
!20 = !{!"_ZTS9OtherHash", !21, i64 0, !7, i64 8, !15, i64 120}
!21 = !{!"_ZTS12OtherHash_PR", !7, i64 0}
!22 = !{!23, !6, i64 40}
!23 = !{!"_ZTSN7UapkiNS9OtherHashE", !24, i64 0, !6, i64 40}
!24 = !{!"_ZTSN7UapkiNS19AlgorithmIdentifierE", !25, i64 0, !6, i64 32}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !26, i64 0, !17, i64 8, !7, i64 16}
!26 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!27 = !{!19, !6, i64 144}


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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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 #3 align 2

declare i32 @__gxx_personality_v0(...)

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; 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 #4

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7UapkiNS9OtherHash9isPresentEv(ptr noundef nonnull align 8 dereferenceable(48)) 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 #5

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS15AttributeHelper21RevocationRefsBuilder10CrlOcspRef17addCrlValidatedIdERKNS_9OtherHashEPK12ByteArray_st(ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator.6", align 1
  %6 = load ptr, ptr %0, align 8, !tbaa !5
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %56, label %7

7:                                                ; preds = %3
  %8 = tail call noundef zeroext i1 @_ZNK7UapkiNS9OtherHash9isPresentEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  br i1 %8, label %9, label %56

9:                                                ; preds = %7
  %10 = load ptr, ptr %0, align 8, !tbaa !5
  %11 = load ptr, ptr %10, align 8, !tbaa !10
  %.not40 = icmp eq ptr %11, null
  br i1 %.not40, label %12, label %16

12:                                               ; preds = %9
  %13 = tail call noalias dereferenceable_or_null(72) ptr @calloc(i64 noundef 1, i64 noundef 72) #6
  store ptr %13, ptr %10, align 8, !tbaa !10
  %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 723, i32 noundef 1, ptr noundef null)
  br label %54

16:                                               ; preds = %12, %9
  %17 = tail call noalias dereferenceable_or_null(176) ptr @calloc(i64 noundef 1, i64 noundef 176) #6
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %20

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

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  %21 = load ptr, ptr @OID_SHA1, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef %21, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %22 unwind label %28

22:                                               ; preds = %20
  %23 = call noundef zeroext i1 @_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EESA_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  br i1 %23, label %24, label %36

24:                                               ; preds = %22
  store i32 2, ptr %17, align 8, !tbaa !17
  %25 = getelementptr inbounds i8, ptr %17, i64 8
  %26 = call noundef i32 @_ZN7UapkiNS4Util25algorithmIdentifierToAsn1ER19AlgorithmIdentifierRKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(48) %25, ptr noundef nonnull align 8 dereferenceable(40) %1)
  %.not42 = icmp eq i32 %26, 0
  br i1 %.not42, label %30, label %27

27:                                               ; preds = %24
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 731, i32 noundef %26)
  br label %54

28:                                               ; preds = %20
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  resume { ptr, i32 } %29

30:                                               ; preds = %24
  %31 = getelementptr inbounds i8, ptr %1, i64 40
  %32 = load ptr, ptr %31, align 8, !tbaa !21
  %33 = getelementptr inbounds i8, ptr %17, i64 56
  %34 = call i32 @asn_ba2OCTSTRING(ptr noundef %32, ptr noundef nonnull %33)
  %.not43 = icmp eq i32 %34, 0
  br i1 %.not43, label %42, label %35

35:                                               ; preds = %30
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 732, i32 noundef %34)
  br label %54

36:                                               ; preds = %22
  store i32 1, ptr %17, align 8, !tbaa !17
  %37 = getelementptr inbounds i8, ptr %1, i64 40
  %38 = load ptr, ptr %37, align 8, !tbaa !21
  %39 = getelementptr inbounds i8, ptr %17, i64 8
  %40 = call i32 @asn_ba2OCTSTRING(ptr noundef %38, ptr noundef nonnull %39)
  %.not41 = icmp eq i32 %40, 0
  br i1 %.not41, label %42, label %41

41:                                               ; preds = %36
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 736, i32 noundef %40)
  br label %54

42:                                               ; preds = %36, %30
  %.not44 = icmp eq ptr %2, null
  br i1 %.not44, label %49, label %43

43:                                               ; preds = %42
  %44 = call ptr @get_CrlIdentifier_desc()
  %45 = call ptr @asn_decode_ba_with_alloc(ptr noundef %44, ptr noundef nonnull %2)
  %46 = getelementptr inbounds i8, ptr %17, i64 144
  store ptr %45, ptr %46, align 8, !tbaa !26
  %47 = icmp eq ptr %45, null
  br i1 %47, label %48, label %49

48:                                               ; preds = %43
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 741, i32 noundef 2)
  br label %54

49:                                               ; preds = %42, %43
  %50 = load ptr, ptr %0, align 8, !tbaa !5
  %51 = load ptr, ptr %50, align 8, !tbaa !10
  %52 = call i32 @asn_set_add(ptr noundef %51, ptr noundef nonnull %17)
  %.not45 = icmp eq i32 %52, 0
  br i1 %.not45, label %54, label %53

53:                                               ; preds = %49
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 744, i32 noundef %52)
  br label %54

54:                                               ; preds = %49, %53, %48, %41, %35, %27, %19, %15
  %.032 = phi ptr [ null, %19 ], [ %17, %27 ], [ %17, %35 ], [ %17, %48 ], [ %17, %53 ], [ %17, %41 ], [ null, %15 ], [ null, %49 ]
  %.031 = phi i32 [ 1, %19 ], [ %26, %27 ], [ %34, %35 ], [ 2, %48 ], [ %52, %53 ], [ %40, %41 ], [ 1, %15 ], [ 0, %49 ]
  %55 = call ptr @get_CrlValidatedID_desc()
  call void @asn_free(ptr noundef %55, ptr noundef %.032)
  br label %56

56:                                               ; preds = %3, %7, %54
  %.0 = phi i32 [ %.031, %54 ], [ 4101, %7 ], [ 4101, %3 ]
  ret i32 %.0
}

declare ptr @get_CrlIdentifier_desc() local_unnamed_addr #1

declare ptr @get_CrlValidatedID_desc() local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #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, !7, i64 0}
!6 = !{!"_ZTSN7UapkiNS15AttributeHelper21RevocationRefsBuilder10CrlOcspRefE", !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !7, i64 0}
!11 = !{!"_ZTS10CrlOcspRef", !7, i64 0, !7, i64 8, !7, i64 16, !12, i64 24}
!12 = !{!"_ZTS16asn_struct_ctx_s", !13, i64 0, !13, i64 2, !14, i64 4, !7, i64 8, !15, i64 16}
!13 = !{!"short", !8, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!"long", !8, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !20, i64 0}
!18 = !{!"_ZTS14CrlValidatedID", !19, i64 0, !7, i64 144, !12, i64 152}
!19 = !{!"_ZTS9OtherHash", !20, i64 0, !8, i64 8, !12, i64 120}
!20 = !{!"_ZTS12OtherHash_PR", !8, i64 0}
!21 = !{!22, !7, i64 40}
!22 = !{!"_ZTSN7UapkiNS9OtherHashE", !23, i64 0, !7, i64 40}
!23 = !{!"_ZTSN7UapkiNS19AlgorithmIdentifierE", !24, i64 0, !7, i64 32}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !25, i64 0, !15, i64 8, !8, i64 16}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!26 = !{!18, !7, i64 144}


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