//
// sub_77C4B8 from 0x77c4b8 to 0x77c51e (102 bytes)
//
// 4 xrefs:
// > sub_77E8CC @ 0x77ea9e
// > sub_77EC0C @ 0x77edb6
// > sub_77EC0C @ 0x77ef40
// > sub_77EC0C @ 0x77ef5a
//
// 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_77C4B8(int a1)
{
_BYTE *v1; // r3
_BYTE *v3; // r1
int v4; // r4
int v5; // r5
unsigned __int8 *v6; // r1
int v7; // r3
int v8; // r3
v1 = *(_BYTE **)(a1 + 12);
if ( *v1 != 95 )
return 1;
v3 = v1 + 1;
*(_DWORD *)(a1 + 12) = v1 + 1;
v4 = (unsigned __int8)v1[1];
if ( v4 == 110 )
{
v3 = v1 + 2;
*(_DWORD *)(a1 + 12) = v1 + 2;
v4 = (unsigned __int8)v1[2];
if ( (unsigned __int8)(v1[2] - 48) <= 9u )
{
v5 = 1;
goto LABEL_6;
}
return 1;
}
if ( (unsigned __int8)(v4 - 48) > 9u )
return 1;
v5 = 0;
LABEL_6:
v6 = v3 + 1;
v7 = 0;
do
{
v8 = 10 * v7 + v4;
*(_DWORD *)(a1 + 12) = v6;
v4 = *v6;
v7 = v8 - 48;
++v6;
}
while ( (unsigned __int8)(v4 - 48) <= 9u );
if ( !v5 )
return 1;
return (unsigned int)(v7 - 1) >> 31;
}