; 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.__gnu_cxx::__normal_iterator.18" = type { 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.std::allocator.6" = type { i8 }
%"struct.UapkiNS::OtherHash" = type { %"struct.UapkiNS::AlgorithmIdentifier", ptr }
%"struct.UapkiNS::AlgorithmIdentifier" = type { %"class.std::__cxx11::basic_string", ptr }
%struct.OtherCertID = 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.asn_struct_ctx_s = type { i16, i16, i32, ptr, i64 }
%"struct.UapkiNS::AttrCertId" = type { %"struct.UapkiNS::OtherHash", %"struct.UapkiNS::AttrCertId::IssuerSerial" }
%"struct.UapkiNS::AttrCertId::IssuerSerial" = type { ptr, ptr }
%struct.IssuerSerial = type { %struct.GeneralNames, %struct.ASN__PRIMITIVE_TYPE_s, ptr, %struct.asn_struct_ctx_s }
%struct.GeneralNames = type { %struct.anon.9, %struct.asn_struct_ctx_s }
%struct.anon.9 = type { ptr, i32, i32, ptr }
%struct.CompleteCertificateRefs = type { %struct.anon.0, %struct.asn_struct_ctx_s }
%struct.anon.0 = 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 void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) #1

declare i32 @asn_encode_ba(ptr noundef, ptr noundef, ptr 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

declare ptr @get_CompleteCertificateRefs_desc() #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

declare ptr @get_GeneralNames_desc() #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
define dso_local noundef i32 @_ZN7UapkiNS15AttributeHelper21encodeCertificateRefsERKSt6vectorINS_10AttrCertIdESaIS2_EEPP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1) #3 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 ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca i1, align 1
  %16 = alloca %"class.std::allocator.6", align 1
  %17 = alloca i1, align 1
  %18 = alloca i1, align 1
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i1, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  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 ptr null, ptr %8, align 8, !tbaa !5
  %22 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 48) #7
  store ptr %22, ptr %7, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %2
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %28

26:                                               ; preds = %23
  store i32 1, ptr %6, align 4, !tbaa !9
  %27 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 308, i32 noundef %27, ptr noundef null)
  br label %228

28:                                               ; preds = %23
  br label %29

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %31, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = call ptr @_ZNKSt6vectorIN7UapkiNS10AttrCertIdESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #6
  %34 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.18", ptr %10, i32 0, i32 0
  store ptr %33, ptr %34, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = call ptr @_ZNKSt6vectorIN7UapkiNS10AttrCertIdESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #6
  %37 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.18", ptr %11, i32 0, i32 0
  store ptr %36, ptr %37, align 8
  br label %38

38:                                               ; preds = %211, %30
  %39 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN7UapkiNS10AttrCertIdESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  br i1 %39, label %41, label %40

40:                                               ; preds = %38
  store i32 5, ptr %12, align 4
  br label %213

41:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %42 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN7UapkiNS10AttrCertIdESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  store ptr %42, ptr %13, align 8, !tbaa !5
  %43 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 176) #7
  store ptr %43, ptr %8, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %41
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = icmp eq ptr %45, null
  br i1 %46, label %47, label %49

47:                                               ; preds = %44
  store i32 1, ptr %6, align 4, !tbaa !9
  %48 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 311, i32 noundef %48, ptr noundef null)
  store i32 4, ptr %12, align 4
  br label %208

49:                                               ; preds = %44
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr %13, align 8, !tbaa !5
  %53 = call noundef zeroext i1 @_ZNK7UapkiNS9OtherHash9isPresentEv(ptr noundef nonnull align 8 dereferenceable(48) %52)
  store i1 false, ptr %15, align 1
  store i1 false, ptr %17, align 1
  store i1 false, ptr %18, align 1
  store i1 false, ptr %21, align 1
  br i1 %53, label %54, label %61

54:                                               ; preds = %51
  %55 = load ptr, ptr %13, 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 %14) #6
  store i1 true, ptr %15, align 1
  %58 = load ptr, ptr @OID_SHA1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #6
  store i1 true, ptr %17, align 1
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  store i1 true, ptr %18, align 1
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef %58, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %59 unwind label %91

59:                                               ; preds = %54
  store i1 true, ptr %21, align 1
  %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) %14) #6
  br label %61

61:                                               ; preds = %59, %51
  %62 = phi i1 [ false, %51 ], [ %60, %59 ]
  %63 = load i1, ptr %21, align 1
  br i1 %63, label %64, label %65

64:                                               ; preds = %61
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  br label %65

65:                                               ; preds = %64, %61
  %66 = load i1, ptr %18, align 1
  br i1 %66, label %67, label %68

67:                                               ; preds = %65
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  br label %68

68:                                               ; preds = %67, %65
  %69 = load i1, ptr %17, align 1
  br i1 %69, label %70, label %71

70:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  br label %71

71:                                               ; preds = %70, %68
  %72 = load i1, ptr %15, align 1
  br i1 %72, label %73, label %74

73:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  br label %74

74:                                               ; preds = %73, %71
  br i1 %62, label %75, label %123

75:                                               ; preds = %74
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.OtherCertID, ptr %76, i32 0, i32 0
  %78 = getelementptr inbounds %struct.OtherHash, ptr %77, i32 0, i32 0
  store i32 2, ptr %78, align 8, !tbaa !11
  br label %79

79:                                               ; preds = %75
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.OtherCertID, ptr %80, i32 0, i32 0
  %82 = getelementptr inbounds %struct.OtherHash, ptr %81, i32 0, i32 1
  %83 = getelementptr inbounds %struct.OtherHashAlgAndValue, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %13, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.UapkiNS::OtherHash", ptr %84, i32 0, i32 0
  %86 = call noundef i32 @_ZN7UapkiNS4Util25algorithmIdentifierToAsn1ER19AlgorithmIdentifierRKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(48) %83, ptr noundef nonnull align 8 dereferenceable(40) %85)
  store i32 %86, ptr %6, align 4, !tbaa !9
  %87 = load i32, ptr %6, align 4, !tbaa !9
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %104

89:                                               ; preds = %79
  %90 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 316, i32 noundef %90)
  store i32 4, ptr %12, align 4
  br label %208

91:                                               ; preds = %54
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %19, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %20, align 4
  %95 = load i1, ptr %18, align 1
  br i1 %95, label %96, label %97

96:                                               ; preds = %91
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  br label %97

97:                                               ; preds = %96, %91
  %98 = load i1, ptr %17, align 1
  br i1 %98, label %99, label %100

99:                                               ; preds = %97
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  br label %100

100:                                              ; preds = %99, %97
  %101 = load i1, ptr %15, align 1
  br i1 %101, label %102, label %103

102:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  br label %103

103:                                              ; preds = %102, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #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 %236

104:                                              ; preds = %79
  br label %105

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  %108 = load ptr, ptr %13, align 8, !tbaa !5
  %109 = getelementptr inbounds %"struct.UapkiNS::OtherHash", ptr %108, i32 0, i32 1
  %110 = load ptr, ptr %109, align 8, !tbaa !18
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.OtherCertID, ptr %111, i32 0, i32 0
  %113 = getelementptr inbounds %struct.OtherHash, ptr %112, i32 0, i32 1
  %114 = getelementptr inbounds %struct.OtherHashAlgAndValue, ptr %113, i32 0, i32 1
  %115 = call i32 @asn_ba2OCTSTRING(ptr noundef %110, ptr noundef %114)
  store i32 %115, ptr %6, align 4, !tbaa !9
  %116 = load i32, ptr %6, align 4, !tbaa !9
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %120

118:                                              ; preds = %107
  %119 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 317, i32 noundef %119)
  store i32 4, ptr %12, align 4
  br label %208

120:                                              ; preds = %107
  br label %121

121:                                              ; preds = %120
  br label %122

122:                                              ; preds = %121
  br label %142

123:                                              ; preds = %74
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.OtherCertID, ptr %124, i32 0, i32 0
  %126 = getelementptr inbounds %struct.OtherHash, ptr %125, i32 0, i32 0
  store i32 1, ptr %126, align 8, !tbaa !11
  br label %127

127:                                              ; preds = %123
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = getelementptr inbounds %"struct.UapkiNS::OtherHash", ptr %128, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8, !tbaa !18
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.OtherCertID, ptr %131, i32 0, i32 0
  %133 = getelementptr inbounds %struct.OtherHash, ptr %132, i32 0, i32 1
  %134 = call i32 @asn_ba2OCTSTRING(ptr noundef %130, ptr noundef %133)
  store i32 %134, ptr %6, align 4, !tbaa !9
  %135 = load i32, ptr %6, align 4, !tbaa !9
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %137, label %139

137:                                              ; preds = %127
  %138 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 321, i32 noundef %138)
  store i32 4, ptr %12, align 4
  br label %208

139:                                              ; preds = %127
  br label %140

140:                                              ; preds = %139
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141, %122
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  %144 = getelementptr inbounds %"struct.UapkiNS::AttrCertId", ptr %143, i32 0, i32 1
  %145 = call noundef zeroext i1 @_ZNK7UapkiNS10AttrCertId12IssuerSerial9isPresentEv(ptr noundef nonnull align 8 dereferenceable(16) %144)
  br i1 %145, label %146, label %195

146:                                              ; preds = %142
  %147 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 96) #7
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.OtherCertID, ptr %148, i32 0, i32 1
  store ptr %147, ptr %149, align 8, !tbaa !23
  br label %150

150:                                              ; preds = %146
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.OtherCertID, ptr %151, i32 0, i32 1
  %153 = load ptr, ptr %152, align 8, !tbaa !23
  %154 = icmp eq ptr %153, null
  br i1 %154, label %155, label %157

155:                                              ; preds = %150
  store i32 1, ptr %6, align 4, !tbaa !9
  %156 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 326, i32 noundef %156, ptr noundef null)
  store i32 4, ptr %12, align 4
  br label %208

157:                                              ; preds = %150
  br label %158

158:                                              ; preds = %157
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159
  %161 = call ptr @get_GeneralNames_desc()
  %162 = load ptr, ptr %8, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.OtherCertID, ptr %162, i32 0, i32 1
  %164 = load ptr, ptr %163, align 8, !tbaa !23
  %165 = getelementptr inbounds %struct.IssuerSerial, ptr %164, i32 0, i32 0
  %166 = load ptr, ptr %13, align 8, !tbaa !5
  %167 = getelementptr inbounds %"struct.UapkiNS::AttrCertId", ptr %166, i32 0, i32 1
  %168 = getelementptr inbounds %"struct.UapkiNS::AttrCertId::IssuerSerial", ptr %167, i32 0, i32 0
  %169 = load ptr, ptr %168, align 8, !tbaa !24
  %170 = call i32 @asn_decode_ba(ptr noundef %161, ptr noundef %165, ptr noundef %169)
  store i32 %170, ptr %6, align 4, !tbaa !9
  %171 = load i32, ptr %6, align 4, !tbaa !9
  %172 = icmp ne i32 %171, 0
  br i1 %172, label %173, label %175

173:                                              ; preds = %160
  %174 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 327, i32 noundef %174)
  store i32 4, ptr %12, align 4
  br label %208

175:                                              ; preds = %160
  br label %176

176:                                              ; preds = %175
  br label %177

177:                                              ; preds = %176
  br label %178

178:                                              ; preds = %177
  %179 = load ptr, ptr %13, align 8, !tbaa !5
  %180 = getelementptr inbounds %"struct.UapkiNS::AttrCertId", ptr %179, i32 0, i32 1
  %181 = getelementptr inbounds %"struct.UapkiNS::AttrCertId::IssuerSerial", ptr %180, i32 0, i32 1
  %182 = load ptr, ptr %181, align 8, !tbaa !27
  %183 = load ptr, ptr %8, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.OtherCertID, ptr %183, i32 0, i32 1
  %185 = load ptr, ptr %184, align 8, !tbaa !23
  %186 = getelementptr inbounds %struct.IssuerSerial, ptr %185, i32 0, i32 1
  %187 = call i32 @asn_ba2INTEGER(ptr noundef %182, ptr noundef %186)
  store i32 %187, ptr %6, align 4, !tbaa !9
  %188 = load i32, ptr %6, align 4, !tbaa !9
  %189 = icmp ne i32 %188, 0
  br i1 %189, label %190, label %192

190:                                              ; preds = %178
  %191 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 328, i32 noundef %191)
  store i32 4, ptr %12, align 4
  br label %208

192:                                              ; preds = %178
  br label %193

193:                                              ; preds = %192
  br label %194

194:                                              ; preds = %193
  br label %195

195:                                              ; preds = %194, %142
  br label %196

196:                                              ; preds = %195
  %197 = load ptr, ptr %7, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.CompleteCertificateRefs, ptr %197, i32 0, i32 0
  %199 = load ptr, ptr %8, align 8, !tbaa !5
  %200 = call i32 @asn_set_add(ptr noundef %198, ptr noundef %199)
  store i32 %200, ptr %6, align 4, !tbaa !9
  %201 = load i32, ptr %6, align 4, !tbaa !9
  %202 = icmp ne i32 %201, 0
  br i1 %202, label %203, label %205

203:                                              ; preds = %196
  %204 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 331, i32 noundef %204)
  store i32 4, ptr %12, align 4
  br label %208

205:                                              ; preds = %196
  br label %206

206:                                              ; preds = %205
  br label %207

207:                                              ; preds = %206
  store ptr null, ptr %8, align 8, !tbaa !5
  store i32 0, ptr %12, align 4
  br label %208

208:                                              ; preds = %207, %203, %190, %173, %155, %137, %118, %89, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %209 = load i32, ptr %12, align 4
  switch i32 %209, label %213 [
    i32 0, label %210
  ]

210:                                              ; preds = %208
  br label %211

211:                                              ; preds = %210
  %212 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN7UapkiNS10AttrCertIdESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br label %38

213:                                              ; preds = %208, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  %214 = load i32, ptr %12, align 4
  switch i32 %214, label %234 [
    i32 5, label %215
    i32 4, label %228
  ]

215:                                              ; preds = %213
  br label %216

216:                                              ; preds = %215
  %217 = call ptr @get_CompleteCertificateRefs_desc()
  %218 = load ptr, ptr %7, align 8, !tbaa !5
  %219 = load ptr, ptr %5, align 8, !tbaa !5
  %220 = call i32 @asn_encode_ba(ptr noundef %217, ptr noundef %218, ptr noundef %219)
  store i32 %220, ptr %6, align 4, !tbaa !9
  %221 = load i32, ptr %6, align 4, !tbaa !9
  %222 = icmp ne i32 %221, 0
  br i1 %222, label %223, label %225

223:                                              ; preds = %216
  %224 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 335, i32 noundef %224)
  br label %228

225:                                              ; preds = %216
  br label %226

226:                                              ; preds = %225
  br label %227

227:                                              ; preds = %226
  br label %228

228:                                              ; preds = %227, %223, %213, %26
  %229 = call ptr @get_CompleteCertificateRefs_desc()
  %230 = load ptr, ptr %7, align 8, !tbaa !5
  call void @asn_free(ptr noundef %229, ptr noundef %230)
  %231 = call ptr @get_OtherCertID_desc()
  %232 = load ptr, ptr %8, align 8, !tbaa !5
  call void @asn_free(ptr noundef %231, ptr noundef %232)
  %233 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %233, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %234

234:                                              ; preds = %228, %213
  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
  %235 = load i32, ptr %3, align 4
  ret i32 %235

236:                                              ; preds = %103
  %237 = load ptr, ptr %19, align 8
  %238 = load i32, ptr %20, align 4
  %239 = insertvalue { ptr, i32 } poison, ptr %237, 0
  %240 = insertvalue { ptr, i32 } %239, i32 %238, 1
  resume { ptr, i32 } %240
}

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

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

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

; 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7UapkiNS10AttrCertId12IssuerSerial9isPresentEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

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

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

declare ptr @get_OtherCertID_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, !14, i64 0}
!12 = !{!"_ZTS11OtherCertID", !13, i64 0, !6, i64 144, !15, i64 152}
!13 = !{!"_ZTS9OtherHash", !14, i64 0, !7, i64 8, !15, i64 120}
!14 = !{!"_ZTS12OtherHash_PR", !7, i64 0}
!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, !6, i64 40}
!19 = !{!"_ZTSN7UapkiNS9OtherHashE", !20, i64 0, !6, i64 40}
!20 = !{!"_ZTSN7UapkiNS19AlgorithmIdentifierE", !21, i64 0, !6, i64 32}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !22, i64 0, !17, i64 8, !7, i64 16}
!22 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!23 = !{!12, !6, i64 144}
!24 = !{!25, !6, i64 48}
!25 = !{!"_ZTSN7UapkiNS10AttrCertIdE", !19, i64 0, !26, i64 48}
!26 = !{!"_ZTSN7UapkiNS10AttrCertId12IssuerSerialE", !6, i64 0, !6, i64 8}
!27 = !{!25, !6, i64 56}


; 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.18" = type { 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.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 void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

declare i32 @asn_encode_ba(ptr noundef, ptr noundef, ptr 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

declare ptr @get_CompleteCertificateRefs_desc() 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

declare ptr @get_GeneralNames_desc() 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
define dso_local noundef i32 @_ZN7UapkiNS15AttributeHelper21encodeCertificateRefsERKSt6vectorINS_10AttrCertIdESaIS2_EEPP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator.6", align 1
  %7 = tail call noalias dereferenceable_or_null(48) ptr @calloc(i64 noundef 1, i64 noundef 48) #6
  %8 = icmp eq ptr %7, null
  br i1 %8, label %9, label %10

9:                                                ; preds = %2
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 308, i32 noundef 1, ptr noundef null)
  br label %71

10:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %11 = tail call ptr @_ZNKSt6vectorIN7UapkiNS10AttrCertIdESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  store ptr %11, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %12 = tail call ptr @_ZNKSt6vectorIN7UapkiNS10AttrCertIdESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  store ptr %12, ptr %4, align 8
  %13 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN7UapkiNS10AttrCertIdESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br i1 %13, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %10, %64
  %14 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN7UapkiNS10AttrCertIdESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %15 = call noalias dereferenceable_or_null(176) ptr @calloc(i64 noundef 1, i64 noundef 176) #6
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %18

17:                                               ; preds = %.lr.ph
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 311, i32 noundef 1, ptr noundef null)
  br label %67

18:                                               ; preds = %.lr.ph
  %19 = call noundef zeroext i1 @_ZNK7UapkiNS9OtherHash9isPresentEv(ptr noundef nonnull align 8 dereferenceable(48) %14)
  br i1 %19, label %20, label %.critedge87.thread

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

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

23:                                               ; preds = %.critedge87
  store i32 2, ptr %15, align 8, !tbaa !9
  %24 = getelementptr inbounds i8, ptr %15, i64 8
  %25 = call noundef i32 @_ZN7UapkiNS4Util25algorithmIdentifierToAsn1ER19AlgorithmIdentifierRKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(48) %24, ptr noundef nonnull align 8 dereferenceable(40) %14)
  %.not80 = icmp eq i32 %25, 0
  br i1 %.not80, label %29, label %26

26:                                               ; preds = %23
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 316, i32 noundef %25)
  br label %67

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

29:                                               ; preds = %23
  %30 = getelementptr inbounds i8, ptr %14, i64 40
  %31 = load ptr, ptr %30, align 8, !tbaa !17
  %32 = getelementptr inbounds i8, ptr %15, i64 56
  %33 = call i32 @asn_ba2OCTSTRING(ptr noundef %31, ptr noundef nonnull %32)
  %.not81 = icmp eq i32 %33, 0
  br i1 %.not81, label %40, label %34

34:                                               ; preds = %29
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 317, i32 noundef %33)
  br label %67

.critedge87.thread:                               ; preds = %18, %.critedge87
  store i32 1, ptr %15, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %14, i64 40
  %36 = load ptr, ptr %35, align 8, !tbaa !17
  %37 = getelementptr inbounds i8, ptr %15, i64 8
  %38 = call i32 @asn_ba2OCTSTRING(ptr noundef %36, ptr noundef nonnull %37)
  %.not = icmp eq i32 %38, 0
  br i1 %.not, label %40, label %39

39:                                               ; preds = %.critedge87.thread
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 321, i32 noundef %38)
  br label %67

40:                                               ; preds = %.critedge87.thread, %29
  %41 = getelementptr inbounds i8, ptr %14, i64 48
  %42 = call noundef zeroext i1 @_ZNK7UapkiNS10AttrCertId12IssuerSerial9isPresentEv(ptr noundef nonnull align 8 dereferenceable(16) %41)
  br i1 %42, label %43, label %61

43:                                               ; preds = %40
  %44 = call noalias dereferenceable_or_null(96) ptr @calloc(i64 noundef 1, i64 noundef 96) #6
  %45 = getelementptr inbounds i8, ptr %15, i64 144
  store ptr %44, ptr %45, align 8, !tbaa !22
  %46 = icmp eq ptr %44, null
  br i1 %46, label %47, label %48

47:                                               ; preds = %43
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 326, i32 noundef 1, ptr noundef null)
  br label %67

48:                                               ; preds = %43
  %49 = call ptr @get_GeneralNames_desc()
  %50 = load ptr, ptr %45, align 8, !tbaa !22
  %51 = load ptr, ptr %41, align 8, !tbaa !23
  %52 = call i32 @asn_decode_ba(ptr noundef %49, ptr noundef %50, ptr noundef %51)
  %.not82 = icmp eq i32 %52, 0
  br i1 %.not82, label %54, label %53

53:                                               ; preds = %48
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 327, i32 noundef %52)
  br label %67

54:                                               ; preds = %48
  %55 = getelementptr inbounds i8, ptr %14, i64 56
  %56 = load ptr, ptr %55, align 8, !tbaa !26
  %57 = load ptr, ptr %45, align 8, !tbaa !22
  %58 = getelementptr inbounds i8, ptr %57, i64 48
  %59 = call i32 @asn_ba2INTEGER(ptr noundef %56, ptr noundef nonnull %58)
  %.not83 = icmp eq i32 %59, 0
  br i1 %.not83, label %61, label %60

60:                                               ; preds = %54
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 328, i32 noundef %59)
  br label %67

61:                                               ; preds = %40, %54
  %62 = call i32 @asn_set_add(ptr noundef nonnull %7, ptr noundef nonnull %15)
  %.not84 = icmp eq i32 %62, 0
  br i1 %.not84, label %64, label %63

63:                                               ; preds = %61
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 331, i32 noundef %62)
  br label %67

64:                                               ; preds = %61
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN7UapkiNS10AttrCertIdESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %66 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN7UapkiNS10AttrCertIdESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br i1 %66, label %.lr.ph, label %._crit_edge

67:                                               ; preds = %17, %26, %34, %47, %53, %60, %63, %39
  %.1.ph = phi i32 [ %38, %39 ], [ %62, %63 ], [ %59, %60 ], [ %52, %53 ], [ 1, %47 ], [ %33, %34 ], [ %25, %26 ], [ 1, %17 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %71

._crit_edge:                                      ; preds = %64, %10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %68 = call ptr @get_CompleteCertificateRefs_desc()
  %69 = call i32 @asn_encode_ba(ptr noundef %68, ptr noundef nonnull %7, ptr noundef %1)
  %.not85 = icmp eq i32 %69, 0
  br i1 %.not85, label %71, label %70

70:                                               ; preds = %._crit_edge
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 335, i32 noundef %69)
  br label %71

71:                                               ; preds = %67, %._crit_edge, %70, %9
  %.367 = phi ptr [ null, %9 ], [ %15, %67 ], [ null, %70 ], [ null, %._crit_edge ]
  %.3 = phi i32 [ 1, %9 ], [ %.1.ph, %67 ], [ %69, %70 ], [ 0, %._crit_edge ]
  %72 = call ptr @get_CompleteCertificateRefs_desc()
  call void @asn_free(ptr noundef %72, ptr noundef %7)
  %73 = call ptr @get_OtherCertID_desc()
  call void @asn_free(ptr noundef %73, ptr noundef %.367)
  ret i32 %.3
}

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

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

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

; 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7UapkiNS10AttrCertId12IssuerSerial9isPresentEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

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

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

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

declare ptr @get_OtherCertID_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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 0}
!10 = !{!"_ZTS11OtherCertID", !11, i64 0, !6, i64 144, !13, i64 152}
!11 = !{!"_ZTS9OtherHash", !12, i64 0, !7, i64 8, !13, i64 120}
!12 = !{!"_ZTS12OtherHash_PR", !7, i64 0}
!13 = !{!"_ZTS16asn_struct_ctx_s", !14, i64 0, !14, i64 2, !15, i64 4, !6, i64 8, !16, i64 16}
!14 = !{!"short", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!18, !6, i64 40}
!18 = !{!"_ZTSN7UapkiNS9OtherHashE", !19, i64 0, !6, i64 40}
!19 = !{!"_ZTSN7UapkiNS19AlgorithmIdentifierE", !20, i64 0, !6, i64 32}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !21, i64 0, !16, i64 8, !7, i64 16}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!22 = !{!10, !6, i64 144}
!23 = !{!24, !6, i64 48}
!24 = !{!"_ZTSN7UapkiNS10AttrCertIdE", !18, i64 0, !25, i64 48}
!25 = !{!"_ZTSN7UapkiNS10AttrCertId12IssuerSerialE", !6, i64 0, !6, i64 8}
!26 = !{!24, !6, i64 56}


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