//
// X509v3_get_ext_by_critical from 0xa563d8 to 0xa5646c (148 bytes)
//
// 8 xrefs:
// > OCSP_REQUEST_get_ext_by_critical @ 0xa32d28
// > OCSP_ONEREQ_get_ext_by_critical @ 0xa32d80
// > OCSP_BASICRESP_get_ext_by_critical @ 0xa32dd8
// > OCSP_SINGLERESP_get_ext_by_critical @ 0xa32e30
// > X509_CRL_get_ext_by_critical @ 0xa53e60
// > X509_get_ext_by_critical @ 0xa53eb8
// > X509_REVOKED_get_ext_by_critical @ 0xa53f10
// > ??> @ 0x7e3cc
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:08:26 +0000
//
int __fastcall X509v3_get_ext_by_critical(_DWORD *a1, int a2, int a3)
{
signed int v5; // r4
int v6; // r7
if ( !a1 )
return -1;
v5 = (a3 + 1) & ~((a3 + 1) >> 31);
v6 = OPENSSL_sk_num((int)a1);
if ( v6 <= v5 )
return -1;
if ( a2 )
{
while ( *(int *)(OPENSSL_sk_value(a1, v5) + 4) <= 0 )
{
if ( ++v5 == v6 )
return -1;
}
}
else
{
while ( *(int *)(OPENSSL_sk_value(a1, v5) + 4) > 0 )
{
if ( ++v5 == v6 )
return -1;
}
}
return v5;
}