//
// sub_1004D9888 from 0x1004d9888 to 0x1004d9940 (184 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
//
unsigned __int8 **__fastcall sub_1004D9888(unsigned __int8 **result)
{
__int64 v1; // x10
unsigned int v2; // w8
unsigned __int8 *v3; // x11
int v4; // t1
__int64 v5; // x10
unsigned __int8 *v6; // x11
int v7; // t1
if ( result )
{
(*result)[22] = 0;
(*result)[23] = 0;
(*result)[24] = 0;
(*result)[25] = 0;
v1 = *((unsigned int *)result + 2);
if ( (int)v1 < 1 )
{
v2 = 0;
}
else
{
v2 = 0;
v3 = *result;
do
{
v4 = *v3++;
v2 = dword_10064B634[v4 ^ HIBYTE(v2)] ^ (v2 << 8);
--v1;
}
while ( v1 );
}
v5 = *((unsigned int *)result + 6);
if ( (int)v5 >= 1 )
{
v6 = result[2];
do
{
v7 = *v6++;
v2 = dword_10064B634[v7 ^ HIBYTE(v2)] ^ (v2 << 8);
--v5;
}
while ( v5 );
}
*(_DWORD *)(*result + 22) = v2;
}
return result;
}