//
// sub_1077604 from 0x1077604 to 0x107775c (344 bytes)
//
// 6 xrefs:
// > X509v3_asid_subset @ 0x10785b8
// > X509v3_asid_subset @ 0x10785d0
// > X509v3_asid_validate_path @ 0x10788dc
// > X509v3_asid_validate_path @ 0x107891c
// > X509v3_asid_validate_resource_set @ 0x1078bcc
// > X509v3_asid_validate_resource_set @ 0x1078be8
//
// 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:17:04 +0000
//
__int64 __fastcall sub_1077604(unsigned int *a1, unsigned int *a2)
{
__int64 v2; // x22
int v5; // w21
__int64 v6; // x26
__int64 v7; // x23
__int64 v8; // x25
int v9; // w19
_DWORD *v10; // x0
_DWORD *v11; // x2
int v12; // w0
__int64 *v13; // x0
__int64 v14; // x0
__int64 *v15; // x0
if ( a1 != a2 && a2 )
{
if ( !a1 )
return 0;
v2 = 0;
v5 = 0;
v6 = 0;
v7 = 0;
v8 = 0;
v9 = 0;
while ( v5 < (int)OPENSSL_sk_num(a2) )
{
v10 = (_DWORD *)OPENSSL_sk_value((__int64)a2, v5);
v11 = v10;
if ( !v10 )
LABEL_23:
sub_632BBC();
v12 = *v10;
if ( v12 )
{
if ( v12 == 1 )
{
v13 = *((__int64 **)v11 + 1);
v6 = *v13;
v2 = v13[1];
}
}
else
{
v6 = *((_QWORD *)v11 + 1);
v2 = v6;
}
if ( v9 >= (int)OPENSSL_sk_num(a1) )
return 0;
while ( 1 )
{
v14 = OPENSSL_sk_value((__int64)a1, v9);
if ( !v14 )
goto LABEL_23;
if ( *(_DWORD *)v14 )
{
if ( *(_DWORD *)v14 == 1 )
{
v15 = *(__int64 **)(v14 + 8);
v8 = *v15;
v7 = v15[1];
}
}
else
{
v8 = *(_QWORD *)(v14 + 8);
v7 = v8;
}
if ( (ASN1_INTEGER_cmp(v7, v2) & 0x80000000) == 0 )
break;
if ( ++v9 >= (int)OPENSSL_sk_num(a1) )
return 0;
}
if ( (int)ASN1_INTEGER_cmp(v8, v6) > 0 )
return 0;
++v5;
}
}
return 1;
}