//
// sub_D22778 from 0xd22778 to 0xd2281c (164 bytes)
//
// 4 xrefs:
// > sub_D25FE0 @ 0xd262f4
// > sub_D26564 @ 0xd267b4
// > sub_D26564 @ 0xd26a98
// > sub_D26564 @ 0xd26ab4
//
// 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 __int64 __fastcall sub_D22778(__int64 a1)
{
_BYTE *v1; // x1
_BYTE *v3; // x3
int v4; // w4
int v5; // w5
char *v6; // x3
__int64 v7; // x1
__int64 v8; // x1
char v9; // t1
v1 = *(_BYTE **)(a1 + 24);
if ( *v1 != 95 )
return 1;
v3 = v1 + 1;
*(_QWORD *)(a1 + 24) = v1 + 1;
v4 = (unsigned __int8)v1[1];
if ( v4 == 110 )
{
v3 = v1 + 2;
*(_QWORD *)(a1 + 24) = v1 + 2;
LOBYTE(v4) = v1[2];
if ( (unsigned __int8)(v4 - 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
{
*(_QWORD *)(a1 + 24) = v6;
v8 = 10 * v7 + (unsigned __int8)v4;
v9 = *v6++;
LOBYTE(v4) = v9;
v7 = v8 - 48;
}
while ( (unsigned __int8)(v9 - 48) <= 9u );
if ( !v5 )
return 1;
return (unsigned __int64)(v7 - 1) >> 63;
}