//
// sub_77C164 from 0x77c164 to 0x77c1b8 (84 bytes)
//
// 8 xrefs:
// > sub_77C5A8 @ 0x77c5d0
// > sub_77C5A8 @ 0x77c5e2
// > sub_77D87C @ 0x77ddd4
// > sub_77D87C @ 0x77e07c
// > sub_77E8CC @ 0x77ea30
// > sub_77EFB0 @ 0x77f0fc
// > sub_77EFB0 @ 0x77f1c6
// > sub_77EFB0 @ 0x77f226
//
// 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_77C164(unsigned __int8 **a1)
{
int v1; // r3
int v2; // r4
int v3; // r5
int v4; // r6
unsigned __int8 *v5; // r1
int v6; // r3
int v7; // r3
v1 = (int)*a1;
v2 = **a1;
if ( v2 == 110 )
{
*a1 = (unsigned __int8 *)(v1 + 1);
v3 = 1;
v2 = *(unsigned __int8 *)(v1 + 1);
v4 = -1;
}
else
{
v3 = 0;
v4 = 0;
}
if ( (unsigned __int8)(v2 - 48) > 9u )
{
v6 = 0;
}
else
{
v5 = *a1 + 1;
v6 = 0;
do
{
v7 = 10 * v6 + v2;
*a1 = v5;
v2 = *v5;
v6 = v7 - 48;
++v5;
}
while ( (unsigned __int8)(v2 - 48) <= 9u );
}
return (v6 ^ v4) + v3;
}