; LLVM IR from specinfo-ua/UAPKI :: library/uapki/src/cer-item.ll (ZN7UapkiNS4Cert7CerItem6verifyEPKS1_b)

; 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::lock_guard" = type { ptr }
%"class.UapkiNS::SmartBA" = 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.UapkiNS::Cert::CerItem" = type <{ %"class.std::mutex", %"class.std::__cxx11::basic_string", ptr, ptr, ptr, ptr, %"class.std::__cxx11::basic_string", ptr, ptr, ptr, ptr, ptr, i32, [4 x i8], i64, i64, i32, %"struct.std::atomic", [3 x i8], %"struct.UapkiNS::Cert::CerItem::Uris", i32, [4 x i8], %"class.std::vector.3", %"struct.UapkiNS::Cert::CertStatusInfo", %"struct.UapkiNS::Cert::CertStatusInfo", %"struct.std::atomic", [7 x i8] }>
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"struct.UapkiNS::Cert::CerItem::Uris" = type { %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<UapkiNS::AttrCertId *, std::allocator<UapkiNS::AttrCertId *>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::AttrCertId *, std::allocator<UapkiNS::AttrCertId *>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::AttrCertId *, std::allocator<UapkiNS::AttrCertId *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::AttrCertId *, std::allocator<UapkiNS::AttrCertId *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.UapkiNS::Cert::CertStatusInfo" = type { i32, %"struct.std::atomic", ptr, i32, i64 }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
%struct.X509Tbs = type { %struct.ANY, %struct.AlgorithmIdentifier, %struct.BIT_STRING_s, %struct.asn_struct_ctx_s }
%struct.ANY = type { ptr, i32, %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.Certificate = type { %struct.TBSCertificate, %struct.AlgorithmIdentifier, %struct.BIT_STRING_s, %struct.asn_struct_ctx_s }
%struct.TBSCertificate = type { ptr, %struct.ASN__PRIMITIVE_TYPE_s, %struct.AlgorithmIdentifier, %struct.Name, %struct.Validity, %struct.Name, %struct.SubjectPublicKeyInfo, ptr, ptr, ptr, %struct.asn_struct_ctx_s }
%struct.Validity = type { %struct.PKIXTime, %struct.PKIXTime, %struct.asn_struct_ctx_s }
%struct.PKIXTime = type { i32, %"union.PKIXTime::PKIXTime_u", %struct.asn_struct_ctx_s }
%"union.PKIXTime::PKIXTime_u" = type { %struct.OCTET_STRING }
%struct.OCTET_STRING = type { ptr, i32, %struct.asn_struct_ctx_s }
%struct.Name = type { i32, %"union.Name::Name_u", %struct.asn_struct_ctx_s }
%"union.Name::Name_u" = type { %struct.RDNSequence }
%struct.RDNSequence = type { %struct.anon, %struct.asn_struct_ctx_s }
%struct.anon = type { ptr, i32, i32, ptr }
%struct.SubjectPublicKeyInfo = type { %struct.AlgorithmIdentifier, %struct.BIT_STRING_s, %struct.asn_struct_ctx_s }

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

declare i32 @__gxx_personality_v0(...)

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

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

declare void @asn_free(ptr noundef, ptr 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS4Cert7CerItem6verifyEPKS1_b(ptr noundef nonnull align 8 dereferenceable(401) %0, ptr noundef %1, i1 noundef zeroext %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 i8, align 1
  %8 = alloca %"class.std::lock_guard", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.UapkiNS::SmartBA", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.UapkiNS::SmartBA", align 8
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca ptr, align 8
  %17 = alloca i8, align 1
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  %18 = zext i1 %2 to i8
  store i8 %18, ptr %7, align 1, !tbaa !9
  %19 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %20 = getelementptr inbounds %"class.UapkiNS::Cert::CerItem", ptr %19, i32 0, i32 0
  call void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(40) %20)
  %21 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %22 = trunc i8 %21 to i1
  br i1 %22, label %29, label %23

23:                                               ; preds = %3
  %24 = getelementptr inbounds %"class.UapkiNS::Cert::CerItem", ptr %19, i32 0, i32 20
  %25 = load i32, ptr %24, align 8, !tbaa !13
  %26 = icmp ugt i32 %25, 1
  br i1 %26, label %27, label %28

27:                                               ; preds = %23
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %194

28:                                               ; preds = %23
  br label %29

29:                                               ; preds = %28, %3
  %30 = getelementptr inbounds %"class.UapkiNS::Cert::CerItem", ptr %19, i32 0, i32 20
  store i32 1, ptr %30, align 8, !tbaa !13
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %194

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  invoke void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %35 unwind label %49

35:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  invoke void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %36 unwind label %53

36:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %37 = invoke ptr @get_X509Tbs_desc()
          to label %38 unwind label %57

38:                                               ; preds = %36
  %39 = getelementptr inbounds %"class.UapkiNS::Cert::CerItem", ptr %19, i32 0, i32 2
  %40 = load ptr, ptr %39, align 8, !tbaa !38
  %41 = invoke ptr @asn_decode_ba_with_alloc(ptr noundef %37, ptr noundef %40)
          to label %42 unwind label %57

42:                                               ; preds = %38
  store ptr %41, ptr %16, align 8, !tbaa !5
  %43 = load ptr, ptr %16, align 8, !tbaa !5
  %44 = icmp ne ptr %43, null
  br i1 %44, label %63, label %45

45:                                               ; preds = %42
  br label %46

46:                                               ; preds = %45
  store i32 4145, ptr %10, align 4, !tbaa !37
  %47 = load i32, ptr %10, align 4, !tbaa !37
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 326, i32 noundef %47, ptr noundef null)
          to label %48 unwind label %57

48:                                               ; preds = %46
  br label %184

49:                                               ; preds = %34
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %12, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %13, align 4
  br label %193

53:                                               ; preds = %35
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %12, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %13, align 4
  br label %192

57:                                               ; preds = %186, %184, %144, %142, %139, %136, %130, %125, %120, %113, %108, %103, %93, %84, %78, %74, %63, %46, %38, %36
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %12, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %13, align 4
  br label %191

61:                                               ; No predecessors!
  br label %62

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62, %42
  %64 = load ptr, ptr %16, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.X509Tbs, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds %struct.ANY, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !39
  %68 = load ptr, ptr %16, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.X509Tbs, ptr %68, i32 0, i32 0
  %70 = getelementptr inbounds %struct.ANY, ptr %69, i32 0, i32 1
  %71 = load i32, ptr %70, align 8, !tbaa !47
  %72 = sext i32 %71 to i64
  %73 = invoke ptr @ba_alloc_from_uint8(ptr noundef %67, i64 noundef %72)
          to label %74 unwind label %57

74:                                               ; preds = %63
  %75 = invoke noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef %73)
          to label %76 unwind label %57

76:                                               ; preds = %74
  br i1 %75, label %83, label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77
  store i32 4097, ptr %10, align 4, !tbaa !37
  %79 = load i32, ptr %10, align 4, !tbaa !37
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 329, i32 noundef %79, ptr noundef null)
          to label %80 unwind label %57

80:                                               ; preds = %78
  br label %184

81:                                               ; No predecessors!
  br label %82

82:                                               ; preds = %81
  br label %83

83:                                               ; preds = %82, %76
  br label %84

84:                                               ; preds = %83
  %85 = getelementptr inbounds %"class.UapkiNS::Cert::CerItem", ptr %19, i32 0, i32 3
  %86 = load ptr, ptr %85, align 8, !tbaa !48
  %87 = getelementptr inbounds %struct.Certificate, ptr %86, i32 0, i32 1
  %88 = getelementptr inbounds %struct.AlgorithmIdentifier, ptr %87, i32 0, i32 0
  %89 = invoke noundef i32 @_ZN7UapkiNS4Util11oidFromAsn1EPK21ASN__PRIMITIVE_TYPE_sRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %88, ptr noundef nonnull align 8 dereferenceable(32) %15)
          to label %90 unwind label %57

90:                                               ; preds = %84
  store i32 %89, ptr %10, align 4, !tbaa !37
  %91 = load i32, ptr %10, align 4, !tbaa !37
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %96

93:                                               ; preds = %90
  %94 = load i32, ptr %10, align 4, !tbaa !37
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 332, i32 noundef %94)
          to label %95 unwind label %57

95:                                               ; preds = %93
  br label %184

96:                                               ; preds = %90
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  %99 = getelementptr inbounds %"class.UapkiNS::Cert::CerItem", ptr %19, i32 0, i32 12
  %100 = load i32, ptr %99, align 8, !tbaa !49
  %101 = icmp eq i32 %100, 4
  br i1 %101, label %102, label %119

102:                                              ; preds = %98
  br label %103

103:                                              ; preds = %102
  %104 = getelementptr inbounds %"class.UapkiNS::Cert::CerItem", ptr %19, i32 0, i32 3
  %105 = load ptr, ptr %104, align 8, !tbaa !48
  %106 = getelementptr inbounds %struct.Certificate, ptr %105, i32 0, i32 2
  %107 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %108 unwind label %57

108:                                              ; preds = %103
  %109 = invoke noundef i32 @_ZN7UapkiNS4Util27bitStringEncapOctetFromAsn1EPK12BIT_STRING_sPP12ByteArray_st(ptr noundef %106, ptr noundef %107)
          to label %110 unwind label %57

110:                                              ; preds = %108
  store i32 %109, ptr %10, align 4, !tbaa !37
  %111 = load i32, ptr %10, align 4, !tbaa !37
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %116

113:                                              ; preds = %110
  %114 = load i32, ptr %10, align 4, !tbaa !37
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 334, i32 noundef %114)
          to label %115 unwind label %57

115:                                              ; preds = %113
  br label %184

116:                                              ; preds = %110
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117
  br label %136

119:                                              ; preds = %98
  br label %120

120:                                              ; preds = %119
  %121 = getelementptr inbounds %"class.UapkiNS::Cert::CerItem", ptr %19, i32 0, i32 3
  %122 = load ptr, ptr %121, align 8, !tbaa !48
  %123 = getelementptr inbounds %struct.Certificate, ptr %122, i32 0, i32 2
  %124 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %125 unwind label %57

125:                                              ; preds = %120
  %126 = invoke i32 @asn_BITSTRING2ba(ptr noundef %123, ptr noundef %124)
          to label %127 unwind label %57

127:                                              ; preds = %125
  store i32 %126, ptr %10, align 4, !tbaa !37
  %128 = load i32, ptr %10, align 4, !tbaa !37
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %133

130:                                              ; preds = %127
  %131 = load i32, ptr %10, align 4, !tbaa !37
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 337, i32 noundef %131)
          to label %132 unwind label %57

132:                                              ; preds = %130
  br label %184

133:                                              ; preds = %127
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135, %118
  %137 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  %138 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %139 unwind label %57

139:                                              ; preds = %136
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = invoke noundef ptr @_ZNK7UapkiNS4Cert7CerItem7getSpkiEv(ptr noundef nonnull align 8 dereferenceable(401) %140)
          to label %142 unwind label %57

142:                                              ; preds = %139
  %143 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %144 unwind label %57

144:                                              ; preds = %142
  %145 = invoke noundef i32 @_ZN7UapkiNS6Verify15verifySignatureEPKcPK12ByteArray_stbS5_S5_(ptr noundef %137, ptr noundef %138, i1 noundef zeroext false, ptr noundef %141, ptr noundef %143)
          to label %146 unwind label %57

146:                                              ; preds = %144
  store i32 %145, ptr %10, align 4, !tbaa !37
  %147 = load i32, ptr %10, align 4, !tbaa !37
  switch i32 %147, label %152 [
    i32 0, label %148
    i32 3, label %150
  ]

148:                                              ; preds = %146
  %149 = getelementptr inbounds %"class.UapkiNS::Cert::CerItem", ptr %19, i32 0, i32 20
  store i32 5, ptr %149, align 8, !tbaa !13
  br label %154

150:                                              ; preds = %146
  %151 = getelementptr inbounds %"class.UapkiNS::Cert::CerItem", ptr %19, i32 0, i32 20
  store i32 3, ptr %151, align 8, !tbaa !13
  br label %154

152:                                              ; preds = %146
  %153 = getelementptr inbounds %"class.UapkiNS::Cert::CerItem", ptr %19, i32 0, i32 20
  store i32 2, ptr %153, align 8, !tbaa !13
  br label %154

154:                                              ; preds = %152, %150, %148
  %155 = getelementptr inbounds %"class.UapkiNS::Cert::CerItem", ptr %19, i32 0, i32 20
  %156 = load i32, ptr %155, align 8, !tbaa !13
  %157 = icmp eq i32 %156, 5
  br i1 %157, label %158, label %183

158:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #4
  store i8 0, ptr %17, align 1, !tbaa !9
  br label %159

159:                                              ; preds = %158
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = invoke noundef i32 @_ZNK7UapkiNS4Cert7CerItem13keyUsageByBitEjRb(ptr noundef nonnull align 8 dereferenceable(401) %160, i32 noundef 5, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %162 unwind label %168

162:                                              ; preds = %159
  store i32 %161, ptr %10, align 4, !tbaa !37
  %163 = load i32, ptr %10, align 4, !tbaa !37
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %172

165:                                              ; preds = %162
  %166 = load i32, ptr %10, align 4, !tbaa !37
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 355, i32 noundef %166)
          to label %167 unwind label %168

167:                                              ; preds = %165
  store i32 4, ptr %9, align 4
  br label %180

168:                                              ; preds = %165, %159
  %169 = landingpad { ptr, i32 }
          cleanup
  %170 = extractvalue { ptr, i32 } %169, 0
  store ptr %170, ptr %12, align 8
  %171 = extractvalue { ptr, i32 } %169, 1
  store i32 %171, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #4
  br label %191

172:                                              ; preds = %162
  br label %173

173:                                              ; preds = %172
  br label %174

174:                                              ; preds = %173
  %175 = load i8, ptr %17, align 1, !tbaa !9, !range !11, !noundef !12
  %176 = trunc i8 %175 to i1
  br i1 %176, label %179, label %177

177:                                              ; preds = %174
  %178 = getelementptr inbounds %"class.UapkiNS::Cert::CerItem", ptr %19, i32 0, i32 20
  store i32 4, ptr %178, align 8, !tbaa !13
  br label %179

179:                                              ; preds = %177, %174
  store i32 0, ptr %9, align 4
  br label %180

180:                                              ; preds = %179, %167
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #4
  %181 = load i32, ptr %9, align 4
  switch i32 %181, label %190 [
    i32 0, label %182
    i32 4, label %184
  ]

182:                                              ; preds = %180
  br label %183

183:                                              ; preds = %182, %154
  br label %184

184:                                              ; preds = %183, %180, %132, %115, %95, %80, %48
  %185 = invoke ptr @get_X509Tbs_desc()
          to label %186 unwind label %57

186:                                              ; preds = %184
  %187 = load ptr, ptr %16, align 8, !tbaa !5
  invoke void @asn_free(ptr noundef %185, ptr noundef %187)
          to label %188 unwind label %57

188:                                              ; preds = %186
  %189 = load i32, ptr %10, align 4, !tbaa !37
  store i32 %189, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %190

190:                                              ; preds = %188, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %194

191:                                              ; preds = %168, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  br label %192

192:                                              ; preds = %191, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  br label %193

193:                                              ; preds = %192, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %196

194:                                              ; preds = %190, %33, %27
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %195 = load i32, ptr %4, align 4
  ret i32 %195

196:                                              ; preds = %193
  %197 = load ptr, ptr %12, align 8
  %198 = load i32, ptr %13, align 4
  %199 = insertvalue { ptr, i32 } poison, ptr %197, 0
  %200 = insertvalue { ptr, i32 } %199, i32 %198, 1
  resume { ptr, i32 } %200
}

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

declare ptr @get_X509Tbs_desc() #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

declare ptr @ba_alloc_from_uint8(ptr noundef, i64 noundef) #1

declare noundef i32 @_ZN7UapkiNS4Util11oidFromAsn1EPK21ASN__PRIMITIVE_TYPE_sRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) #1

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

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

declare noundef i32 @_ZN7UapkiNS6Verify15verifySignatureEPKcPK12ByteArray_stbS5_S5_(ptr noundef, ptr noundef, i1 noundef zeroext, ptr noundef, ptr noundef) #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7UapkiNS4Cert7CerItem13keyUsageByBitEjRb(ptr noundef nonnull align 8 dereferenceable(401), i32 noundef, ptr noundef nonnull align 1 dereferenceable(1)) #0 align 2

attributes #0 = { 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 #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 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 }

!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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !29, i64 304}
!14 = !{!"_ZTSN7UapkiNS4Cert7CerItemE", !15, i64 0, !17, i64 40, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !17, i64 104, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !20, i64 176, !19, i64 184, !19, i64 192, !21, i64 200, !22, i64 204, !24, i64 208, !29, i64 304, !30, i64 312, !34, i64 336, !34, i64 368, !22, i64 400}
!15 = !{!"_ZTSSt5mutex", !16, i64 0}
!16 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !18, i64 0, !19, i64 8, !7, i64 16}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTS7HashAlg", !7, i64 0}
!21 = !{!"int", !7, i64 0}
!22 = !{!"_ZTSSt6atomicIbE", !23, i64 0}
!23 = !{!"_ZTSSt13__atomic_baseIbE", !10, i64 0}
!24 = !{!"_ZTSN7UapkiNS4Cert7CerItem4UrisE", !25, i64 0, !25, i64 24, !25, i64 48, !25, i64 72}
!25 = !{!"_ZTSSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTSN7UapkiNS4Cert12VerifyStatusE", !7, i64 0}
!30 = !{!"_ZTSSt6vectorIPN7UapkiNS10AttrCertIdESaIS2_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseIPN7UapkiNS10AttrCertIdESaIS2_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS10AttrCertIdESaIS2_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS10AttrCertIdESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{!"_ZTSN7UapkiNS4Cert14CertStatusInfoE", !35, i64 0, !22, i64 4, !6, i64 8, !36, i64 16, !19, i64 24}
!35 = !{!"_ZTSN7UapkiNS4Cert14ValidationTypeE", !7, i64 0}
!36 = !{!"_ZTSN7UapkiNS10CertStatusE", !7, i64 0}
!37 = !{!21, !21, i64 0}
!38 = !{!14, !6, i64 72}
!39 = !{!40, !6, i64 0}
!40 = !{!"_ZTS7X509Tbs", !41, i64 0, !44, i64 40, !46, i64 88, !42, i64 128}
!41 = !{!"_ZTS3ANY", !6, i64 0, !21, i64 8, !42, i64 16}
!42 = !{!"_ZTS16asn_struct_ctx_s", !43, i64 0, !43, i64 2, !21, i64 4, !6, i64 8, !19, i64 16}
!43 = !{!"short", !7, i64 0}
!44 = !{!"_ZTS19AlgorithmIdentifier", !45, i64 0, !6, i64 16, !42, i64 24}
!45 = !{!"_ZTS21ASN__PRIMITIVE_TYPE_s", !6, i64 0, !21, i64 8}
!46 = !{!"_ZTS12BIT_STRING_s", !6, i64 0, !21, i64 8, !21, i64 12, !42, i64 16}
!47 = !{!40, !21, i64 8}
!48 = !{!14, !6, i64 80}
!49 = !{!14, !20, i64 176}


; 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::lock_guard" = type { ptr }
%"class.UapkiNS::SmartBA" = 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] }

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

declare i32 @__gxx_personality_v0(...)

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

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

declare void @asn_free(ptr noundef, ptr 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS4Cert7CerItem6verifyEPKS1_b(ptr noundef nonnull align 8 dereferenceable(401) %0, ptr noundef %1, i1 noundef zeroext %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::lock_guard", align 8
  %5 = alloca %"class.UapkiNS::SmartBA", align 8
  %6 = alloca %"class.UapkiNS::SmartBA", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  call void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(40) %0)
  %9 = getelementptr inbounds i8, ptr %0, i64 304
  %10 = load i32, ptr %9, align 8
  %11 = icmp ult i32 %10, 2
  %or.cond.not = select i1 %2, i1 true, i1 %11
  br i1 %or.cond.not, label %12, label %77

12:                                               ; preds = %3
  store i32 1, ptr %9, align 8, !tbaa !5
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %77, label %13

13:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  %14 = invoke ptr @get_X509Tbs_desc()
          to label %15 unwind label %21

15:                                               ; preds = %13
  %16 = getelementptr inbounds i8, ptr %0, i64 72
  %17 = load ptr, ptr %16, align 8, !tbaa !33
  %18 = invoke ptr @asn_decode_ba_with_alloc(ptr noundef %14, ptr noundef %17)
          to label %19 unwind label %21

19:                                               ; preds = %15
  %.not34 = icmp eq ptr %18, null
  br i1 %.not34, label %20, label %23

20:                                               ; preds = %19
  invoke void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 326, i32 noundef 4145, ptr noundef null)
          to label %.thread unwind label %21

21:                                               ; preds = %74, %.thread, %54, %53, %50, %49, %46, %38, %32, %31, %23, %20, %15, %13
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %76

23:                                               ; preds = %19
  %24 = load ptr, ptr %18, align 8, !tbaa !34
  %25 = getelementptr inbounds i8, ptr %18, i64 8
  %26 = load i32, ptr %25, align 8, !tbaa !42
  %27 = sext i32 %26 to i64
  %28 = invoke ptr @ba_alloc_from_uint8(ptr noundef %24, i64 noundef %27)
          to label %29 unwind label %21

29:                                               ; preds = %23
  %30 = call noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef %28)
  br i1 %30, label %32, label %31

31:                                               ; preds = %29
  invoke void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 329, i32 noundef 4097, ptr noundef null)
          to label %.thread unwind label %21

32:                                               ; preds = %29
  %33 = getelementptr inbounds i8, ptr %0, i64 80
  %34 = load ptr, ptr %33, align 8, !tbaa !43
  %35 = getelementptr inbounds i8, ptr %34, i64 560
  %36 = invoke noundef i32 @_ZN7UapkiNS4Util11oidFromAsn1EPK21ASN__PRIMITIVE_TYPE_sRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %35, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %37 unwind label %21

37:                                               ; preds = %32
  %.not35 = icmp eq i32 %36, 0
  br i1 %.not35, label %39, label %38

38:                                               ; preds = %37
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 332, i32 noundef %36)
          to label %.thread unwind label %21

39:                                               ; preds = %37
  %40 = getelementptr inbounds i8, ptr %0, i64 176
  %41 = load i32, ptr %40, align 8, !tbaa !44
  %42 = icmp eq i32 %41, 4
  %43 = load ptr, ptr %33, align 8, !tbaa !43
  %44 = getelementptr inbounds i8, ptr %43, i64 608
  %45 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  br i1 %42, label %46, label %50

46:                                               ; preds = %39
  %47 = invoke noundef i32 @_ZN7UapkiNS4Util27bitStringEncapOctetFromAsn1EPK12BIT_STRING_sPP12ByteArray_st(ptr noundef nonnull %44, ptr noundef %45)
          to label %48 unwind label %21

48:                                               ; preds = %46
  %.not37 = icmp eq i32 %47, 0
  br i1 %.not37, label %54, label %49

49:                                               ; preds = %48
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 334, i32 noundef %47)
          to label %.thread unwind label %21

50:                                               ; preds = %39
  %51 = invoke i32 @asn_BITSTRING2ba(ptr noundef nonnull %44, ptr noundef %45)
          to label %52 unwind label %21

52:                                               ; preds = %50
  %.not36 = icmp eq i32 %51, 0
  br i1 %.not36, label %54, label %53

53:                                               ; preds = %52
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 337, i32 noundef %51)
          to label %.thread unwind label %21

54:                                               ; preds = %52, %48
  %55 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  %56 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %57 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem7getSpkiEv(ptr noundef nonnull align 8 dereferenceable(401) %1)
  %58 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %59 = invoke noundef i32 @_ZN7UapkiNS6Verify15verifySignatureEPKcPK12ByteArray_stbS5_S5_(ptr noundef %55, ptr noundef %56, i1 noundef zeroext false, ptr noundef %57, ptr noundef %58)
          to label %60 unwind label %21

60:                                               ; preds = %54
  switch i32 %59, label %62 [
    i32 0, label %63
    i32 3, label %61
  ]

61:                                               ; preds = %60
  store i32 3, ptr %9, align 8, !tbaa !5
  br label %.thread

62:                                               ; preds = %60
  store i32 2, ptr %9, align 8, !tbaa !5
  br label %.thread

63:                                               ; preds = %60
  store i32 5, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #4
  store i8 0, ptr %8, align 1, !tbaa !45
  %64 = call noundef i32 @_ZNK7UapkiNS4Cert7CerItem13keyUsageByBitEjRb(ptr noundef nonnull align 8 dereferenceable(401) %1, i32 noundef 5, ptr noundef nonnull align 1 dereferenceable(1) %8)
  %.not38 = icmp eq i32 %64, 0
  br i1 %.not38, label %68, label %65

65:                                               ; preds = %63
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 355, i32 noundef %64)
          to label %72 unwind label %66

66:                                               ; preds = %65
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #4
  br label %76

68:                                               ; preds = %63
  %69 = load i8, ptr %8, align 1, !tbaa !45, !range !46, !noundef !47
  %70 = trunc nuw i8 %69 to i1
  br i1 %70, label %72, label %71

71:                                               ; preds = %68
  store i32 4, ptr %9, align 8, !tbaa !5
  br label %72

72:                                               ; preds = %68, %71, %65
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #4
  br label %.thread

.thread:                                          ; preds = %61, %62, %72, %53, %49, %38, %31, %20
  %.026 = phi i32 [ %36, %38 ], [ %47, %49 ], [ %64, %72 ], [ %51, %53 ], [ 4097, %31 ], [ 4145, %20 ], [ %59, %62 ], [ 3, %61 ]
  %73 = invoke ptr @get_X509Tbs_desc()
          to label %74 unwind label %21

74:                                               ; preds = %.thread
  invoke void @asn_free(ptr noundef %73, ptr noundef %18)
          to label %75 unwind label %21

75:                                               ; preds = %74
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %77

76:                                               ; preds = %66, %21
  %.pn = phi { ptr, i32 } [ %22, %21 ], [ %67, %66 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  resume { ptr, i32 } %.pn

77:                                               ; preds = %12, %3, %75
  %.1 = phi i32 [ %.026, %75 ], [ 0, %3 ], [ 0, %12 ]
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  ret i32 %.1
}

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

declare ptr @get_X509Tbs_desc() local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

declare ptr @ba_alloc_from_uint8(ptr noundef, i64 noundef) local_unnamed_addr #1

declare noundef i32 @_ZN7UapkiNS4Util11oidFromAsn1EPK21ASN__PRIMITIVE_TYPE_sRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

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

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

declare noundef i32 @_ZN7UapkiNS6Verify15verifySignatureEPKcPK12ByteArray_stbS5_S5_(ptr noundef, ptr noundef, i1 noundef zeroext, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7UapkiNS4Cert7CerItem13keyUsageByBitEjRb(ptr noundef nonnull align 8 dereferenceable(401), i32 noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0 align 2

attributes #0 = { 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 }

!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, !25, i64 304}
!6 = !{!"_ZTSN7UapkiNS4Cert7CerItemE", !7, i64 0, !11, i64 40, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !11, i64 104, !13, i64 136, !13, i64 144, !13, i64 152, !13, i64 160, !13, i64 168, !15, i64 176, !14, i64 184, !14, i64 192, !16, i64 200, !17, i64 204, !20, i64 208, !25, i64 304, !26, i64 312, !30, i64 336, !30, i64 368, !17, i64 400}
!7 = !{!"_ZTSSt5mutex", !8, i64 0}
!8 = !{!"_ZTSSt12__mutex_base", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !14, i64 8, !9, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !13, i64 0}
!13 = !{!"any pointer", !9, i64 0}
!14 = !{!"long", !9, i64 0}
!15 = !{!"_ZTS7HashAlg", !9, i64 0}
!16 = !{!"int", !9, i64 0}
!17 = !{!"_ZTSSt6atomicIbE", !18, i64 0}
!18 = !{!"_ZTSSt13__atomic_baseIbE", !19, i64 0}
!19 = !{!"bool", !9, i64 0}
!20 = !{!"_ZTSN7UapkiNS4Cert7CerItem4UrisE", !21, i64 0, !21, i64 24, !21, i64 48, !21, i64 72}
!21 = !{!"_ZTSSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_Vector_impl_dataE", !13, i64 0, !13, i64 8, !13, i64 16}
!25 = !{!"_ZTSN7UapkiNS4Cert12VerifyStatusE", !9, i64 0}
!26 = !{!"_ZTSSt6vectorIPN7UapkiNS10AttrCertIdESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIPN7UapkiNS10AttrCertIdESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS10AttrCertIdESaIS2_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIPN7UapkiNS10AttrCertIdESaIS2_EE17_Vector_impl_dataE", !13, i64 0, !13, i64 8, !13, i64 16}
!30 = !{!"_ZTSN7UapkiNS4Cert14CertStatusInfoE", !31, i64 0, !17, i64 4, !13, i64 8, !32, i64 16, !14, i64 24}
!31 = !{!"_ZTSN7UapkiNS4Cert14ValidationTypeE", !9, i64 0}
!32 = !{!"_ZTSN7UapkiNS10CertStatusE", !9, i64 0}
!33 = !{!6, !13, i64 72}
!34 = !{!35, !13, i64 0}
!35 = !{!"_ZTS7X509Tbs", !36, i64 0, !39, i64 40, !41, i64 88, !37, i64 128}
!36 = !{!"_ZTS3ANY", !13, i64 0, !16, i64 8, !37, i64 16}
!37 = !{!"_ZTS16asn_struct_ctx_s", !38, i64 0, !38, i64 2, !16, i64 4, !13, i64 8, !14, i64 16}
!38 = !{!"short", !9, i64 0}
!39 = !{!"_ZTS19AlgorithmIdentifier", !40, i64 0, !13, i64 16, !37, i64 24}
!40 = !{!"_ZTS21ASN__PRIMITIVE_TYPE_s", !13, i64 0, !16, i64 8}
!41 = !{!"_ZTS12BIT_STRING_s", !13, i64 0, !16, i64 8, !16, i64 12, !37, i64 16}
!42 = !{!35, !16, i64 8}
!43 = !{!6, !13, i64 80}
!44 = !{!6, !15, i64 176}
!45 = !{!19, !19, i64 0}
!46 = !{i8 0, i8 2}
!47 = !{}


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