//
// sub_A53FE8 from 0xa53fe8 to 0xa540dc (244 bytes)
//
// 4 xrefs:
// > X509_OBJECT_idx_by_subject @ 0xa546ac
// > X509_STORE_CTX_get1_certs @ 0xa5483c
// > X509_STORE_CTX_get1_certs @ 0xa54950
// > X509_STORE_CTX_get1_crls @ 0xa549fc
//
// 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:24 +0000
//
int __fastcall sub_A53FE8(_DWORD *a1, int a2, int a3, _DWORD *a4)
{
int v6; // r0
_BOOL4 v7; // r3
int v8; // r7
signed int i; // r4
int v10; // r0
int *v11; // r0
int v12; // r2
int v14; // [sp+4h] [bp-150h] BYREF
char *v15; // [sp+8h] [bp-14Ch]
char v16; // [sp+Ch] [bp-148h] BYREF
int v17; // [sp+18h] [bp-13Ch]
char v18; // [sp+94h] [bp-C0h] BYREF
int v19; // [sp+BCh] [bp-98h]
v14 = a2;
if ( a2 == 1 )
{
v19 = a3;
v15 = &v18;
}
else
{
if ( a2 != 2 )
return -1;
v17 = a3;
v15 = &v16;
}
v6 = OPENSSL_sk_find((int)a1, (int)&v14);
v7 = v6 >= 0;
if ( !a4 )
v7 = 0;
v8 = v6;
if ( v7 )
{
*a4 = 1;
for ( i = v6 + 1; ; ++i )
{
if ( i >= OPENSSL_sk_num((int)a1) )
return v8;
v11 = (int *)OPENSSL_sk_value(a1, i);
v12 = *v11;
if ( *v11 != v14 )
return v8;
if ( v12 == 1 )
{
v10 = X509_subject_name_cmp(v11[1], (int)v15);
}
else
{
if ( v12 != 2 )
goto LABEL_11;
v10 = X509_CRL_cmp(v11[1], (int)v15);
}
if ( v10 )
return v8;
LABEL_11:
++*a4;
}
}
return v8;
}