//
// sub_774974 from 0x774974 to 0x7749ae (58 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_774974(int *a1, void *a2, unsigned int a3, size_t a4)
{
int v4; // r6
size_t v5; // r4
unsigned int v7; // r4
v4 = *a1;
v5 = *(_DWORD *)(*a1 - 12);
if ( a4 > v5 )
return -1;
v7 = v5 - a4;
if ( v7 >= a3 )
v7 = a3;
while ( memcmp((const void *)(v4 + v7), a2, a4) )
{
if ( !v7 )
return -1;
--v7;
}
return v7;
}