//
// X509_STORE_add_crl from 0x8400dc to 0x8401d4 (248 bytes)
//
// 4 xrefs:
// > X509_load_crl_file @ 0x83cd78
// > X509_load_crl_file @ 0x83ce20
// > X509_load_cert_crl_file @ 0x83cf14
// > ??> @ 0x66adc
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall X509_STORE_add_crl(int a1, int a2)
{
int *v4; // r0
int *v5; // r6
int v7; // r5
int v8; // r4
if ( !a2 )
return 0;
v4 = X509_OBJECT_new();
v5 = v4;
if ( !v4 )
return 0;
*v4 = 2;
v4[1] = a2;
X509_OBJECT_up_ref_count(v4);
CRYPTO_THREAD_write_lock(*(pthread_rwlock_t **)(a1 + 72));
if ( X509_OBJECT_retrieve_match(*(_DWORD **)(a1 + 4), v5) )
{
ERR_put_error(11, 125, 101, (int)"crypto/x509/x509_lu.c", 360);
CRYPTO_THREAD_unlock(*(pthread_rwlock_t **)(a1 + 72));
v7 = 1;
}
else
{
v7 = OPENSSL_sk_push(*(int **)(a1 + 4), (int)v5);
CRYPTO_THREAD_unlock(*(pthread_rwlock_t **)(a1 + 72));
if ( v7 )
{
v8 = 1;
goto LABEL_7;
}
}
X509_OBJECT_free(v5);
v8 = 0;
LABEL_7:
if ( !v7 )
ERR_put_error(11, 125, 65, (int)"crypto/x509/x509_lu.c", 372);
return v8;
}