//
// sub_77E710 from 0x77e710 to 0x77e7ae (158 bytes)
//
// 3 xrefs:
// > sub_77E8CC @ 0x77ea0a
// > sub_77EFB0 @ 0x77f08a
// > sub_77F8D0 @ 0x77f8f8
//
// 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_77E710(_DWORD *a1)
{
unsigned __int8 *v1; // r6
int v2; // r3
int *v4; // r5
_DWORD *v5; // r0
int v6; // r2
int result; // r0
_DWORD *v8; // r2
int v9; // r2
int v10; // [sp+4h] [bp-4h] BYREF
v1 = (unsigned __int8 *)a1[3];
v10 = 0;
v2 = *v1;
if ( v2 == 69 || v2 == 0 )
return 0;
v4 = &v10;
if ( v2 == 46 )
return 0;
do
{
if ( (v2 == 79 || v2 == 82) && v1[1] == 69 )
break;
v6 = sub_77D87C((int)a1);
if ( !v6 )
return 0;
v5 = sub_77BD98(a1, 46, v6, 0);
*v4 = (int)v5;
if ( !v5 )
return 0;
v1 = (unsigned __int8 *)a1[3];
v2 = *v1;
v4 = v5 + 2;
if ( v2 == 0 || v2 == 69 )
break;
}
while ( v2 != 46 );
result = v10;
if ( !v10 )
return 0;
if ( !*(_DWORD *)(v10 + 8) )
{
v8 = *(_DWORD **)(v10 + 4);
if ( *v8 == 39 )
{
v9 = v8[1];
if ( *(_DWORD *)(v9 + 16) == 9 )
{
a1[12] -= *(_DWORD *)(v9 + 4);
*(_DWORD *)(result + 4) = 0;
}
}
}
return result;
}