//
// sub_1005DEC64 from 0x1005dec64 to 0x1005deccc (104 bytes)
//
// 6 xrefs:
// > sub_10058A418 @ 0x10058a464
// > sub_10058BBF8 @ 0x10058bce0
// > sub_10058BBF8 @ 0x10058bcec
// > sub_100611928 @ 0x10061193c
// > sub_100611928 @ 0x100611948
// > sub_1005DEB20 @ 0x1005deb88
//
// 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_1005DEC64(_BYTE *a1)
{
unsigned int v1; // w12
unsigned __int64 v2; // x10
unsigned __int8 *v3; // x8
__int64 v4; // x9
unsigned __int64 v5; // x13
unsigned int v6; // t1
if ( !a1 )
return 0;
v1 = (unsigned __int8)*a1;
if ( !*a1 )
return 0;
v2 = 0;
v3 = a1 + 1;
v4 = 256;
do
{
v5 = (char)v1 | (unsigned __int64)v4;
v4 += 256;
v2 = ((unsigned int)(v2 >> (32 - ((v1 ^ (v1 >> 2)) & 0xF))) | (unsigned int)(v2 << ((v1 ^ (v1 >> 2)) & 0xF)))
^ (v5 * v5);
v6 = *v3++;
v1 = v6;
}
while ( v6 );
return v2 ^ (v2 >> 16);
}