//
// X509_STORE_add_crl from 0x10664a0 to 0x10665ac (268 bytes)
//
// 4 xrefs:
// > X509_load_crl_file @ 0x1062f64
// > X509_load_crl_file @ 0x1062ff4
// > X509_load_cert_crl_file @ 0x10630f0
// > ??> @ 0x8e0d8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:16:53 +0000
//
__int64 __fastcall X509_STORE_add_crl(__int64 a1, __int64 a2)
{
_DWORD *v4; // x0
_QWORD *v5; // x21
int v6; // w20
unsigned int v7; // w19
pthread_rwlock_t *v9; // x0
if ( !a2 )
return 0;
v4 = X509_OBJECT_new();
v5 = v4;
if ( !v4 )
return 0;
*((_QWORD *)v4 + 1) = a2;
*v4 = 2;
X509_OBJECT_up_ref_count((__int64)v4);
CRYPTO_THREAD_write_lock(*(pthread_rwlock_t **)(a1 + 144));
if ( X509_OBJECT_retrieve_match(*(unsigned int **)(a1 + 8), (__int64)v5) )
{
v6 = 1;
ERR_put_error(11, 125, 101, (__int64)"crypto/x509/x509_lu.c", 360);
CRYPTO_THREAD_unlock(*(pthread_rwlock_t **)(a1 + 144));
}
else
{
v6 = OPENSSL_sk_push(*(int **)(a1 + 8), (__int64)v5);
v9 = *(pthread_rwlock_t **)(a1 + 144);
v7 = 1;
CRYPTO_THREAD_unlock(v9);
if ( v6 )
return v7;
}
v7 = 0;
X509_OBJECT_free(v5);
if ( v6 )
return v7;
ERR_put_error(11, 125, 65, (__int64)"crypto/x509/x509_lu.c", 372);
return 0;
}