//
// sub_A6CB64 from 0xa6cb64 to 0xa6cc98 (308 bytes)
//
// 4 xrefs:
// > NAME_CONSTRAINTS_check @ 0xa6cec4
// > NAME_CONSTRAINTS_check @ 0xa6cf08
// > NAME_CONSTRAINTS_check @ 0xa6cf4c
// > NAME_CONSTRAINTS_check_CN @ 0xa6d034
//
// 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:40 +0000
//
int __fastcall sub_A6CB64(_DWORD *a1, int *a2)
{
int v2; // r7
signed int i; // r4
int v6; // r0
int result; // r0
signed int v8; // r4
int v9; // r0
unsigned int v10; // r1
int v12; // r0
v2 = 0;
for ( i = 0; i < OPENSSL_sk_num(*a2); ++i )
{
v6 = OPENSSL_sk_value((_DWORD *)*a2, i);
if ( *a1 == **(_DWORD **)v6 )
{
if ( *(_DWORD *)(v6 + 4) || *(_DWORD *)(v6 + 8) )
return 49;
if ( v2 == 2 )
goto LABEL_13;
result = sub_A6C81C((int)a1, *(_DWORD **)v6);
if ( !v2 )
v2 = 1;
if ( !result )
{
LABEL_13:
v2 = 2;
}
else if ( result != 47 )
{
return result;
}
}
}
if ( v2 == 1 )
return 47;
v8 = 0;
while ( 1 )
{
do
{
v9 = OPENSSL_sk_num(a2[1]);
v10 = v8;
if ( v8++ >= v9 )
return 0;
v12 = OPENSSL_sk_value((_DWORD *)a2[1], v10);
}
while ( *a1 != **(_DWORD **)v12 );
if ( *(_DWORD *)(v12 + 4) || *(_DWORD *)(v12 + 8) )
return 49;
result = sub_A6C81C((int)a1, *(_DWORD **)v12);
if ( !result )
break;
if ( result != 47 )
return result;
}
return 48;
}