//
// sub_7772F4 from 0x7772f4 to 0x777330 (60 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
//
int __fastcall sub_7772F4(int *a1, int a2, unsigned int a3)
{
int v3; // r4
int result; // r0
int v5; // r3
unsigned int v6; // r3
int *v7; // r2
int v8; // t1
v3 = *a1;
result = -1;
v5 = *(_DWORD *)(v3 - 12);
if ( v5 )
{
v6 = v5 - 1;
if ( a3 >= v6 )
a3 = v6;
result = a3;
v7 = (int *)(v3 + 4 * a3);
while ( result != -1 )
{
v8 = *v7--;
if ( a2 == v8 )
break;
--result;
}
}
return result;
}