//
// sub_77709C from 0x77709c to 0x7770dc (64 bytes)
//
// 0 xrefs:
//
// 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
//
unsigned int __fastcall sub_77709C(_DWORD *a1, wchar_t *s2, unsigned int a3, size_t n)
{
size_t v4; // r4
unsigned int v6; // r4
int v9; // r5
const wchar_t *v10; // r0
v4 = *(_DWORD *)(*a1 - 12);
if ( n > v4 )
return -1;
v6 = v4 - n;
if ( v6 >= a3 )
v6 = a3;
v9 = *a1 + 4 * v6;
while ( 1 )
{
v10 = (const wchar_t *)v9;
v9 -= 4;
if ( !wmemcmp(v10, s2, n) )
break;
if ( !v6 )
return -1;
--v6;
}
return v6;
}