//
// sub_180042B70 from 0x180042b70 to 0x180042c2d (189 bytes)
//
// 7 xrefs:
// > sub_180041D20 @ 0x180041df4
// > sub_180041D20 @ 0x180041e3e
// > sub_180041F40 @ 0x180041fbf
// > sub_180041F40 @ 0x180042081
// > sub_180041F40 @ 0x180042194
// > sub_180042340 @ 0x18004239b
// > sub_180042340 @ 0x18004248e
//
// 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
//
__int64 __fastcall sub_180042B70(__int64 a1, unsigned __int64 a2)
{
__int64 result; // rax
unsigned __int64 v3; // r8
result = *(unsigned int *)(a1 + 32);
v3 = *(unsigned int *)(a1 + 28);
switch ( (_DWORD)result )
{
case 0:
a2 = (unsigned int)a2;
LODWORD(v3) = dword_1801ABCE0[((unsigned __int64)(unsigned int)a2 >> 24) ^ (v3 >> 8)] ^ ((unsigned __int8)v3 << 8);
goto LABEL_9;
case 8:
a2 = (unsigned int)a2;
LABEL_9:
LODWORD(v3) = dword_1801ABCE0[((unsigned int)v3 ^ (a2 >> 8) & 0xFF00) >> 8] ^ ((unsigned __int8)v3 << 8);
LABEL_10:
LODWORD(v3) = dword_1801ABCE0[((unsigned int)v3 ^ (unsigned __int64)((unsigned __int16)a2 & 0xFF00)) >> 8]
^ ((unsigned __int8)v3 << 8);
goto LABEL_11;
case 0x10:
goto LABEL_10;
}
if ( (_DWORD)result != 24 )
{
*(_DWORD *)(a1 + 32) = 0;
return result;
}
LABEL_11:
result = dword_1801ABCE0[(unsigned __int8)a2 ^ ((unsigned __int64)(unsigned int)v3 >> 8)] ^ ((unsigned __int8)v3 << 8);
*(_QWORD *)(a1 + 28) = (unsigned int)result;
return result;
}