//
// sub_10042C368 from 0x10042c368 to 0x10042c444 (220 bytes)
//
// 3 xrefs:
// > sub_10042E648 @ 0x10042e66c
// > sub_10042E648 @ 0x10042e6b4
// > sub_10042E648 @ 0x10042e6d4
//
// 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_10042C368(__int64 a1, unsigned int a2)
{
int v3; // w9
unsigned int v4; // w11
int v5; // w12
unsigned __int8 *v6; // x12
int v7; // w10
if ( a2 > 0x20 )
return 0xFFFFFFFFLL;
v3 = *(_DWORD *)(a1 + 4);
v4 = v3 + a2;
v5 = *(_DWORD *)(a1 + 24);
if ( *(_DWORD *)a1 < v5 - 4 )
goto LABEL_7;
if ( *(_DWORD *)a1 > v5 - ((int)(v4 + 7) >> 3) )
return 0xFFFFFFFFLL;
if ( !v4 )
return 0;
LABEL_7:
v6 = *(unsigned __int8 **)(a1 + 16);
v7 = *v6 >> v3;
if ( (int)v4 >= 9 )
{
v7 |= v6[1] << (8 - v3);
if ( v4 >= 0x11 )
{
v7 |= v6[2] << (16 - v3);
if ( v4 >= 0x19 )
{
v7 |= v6[3] << (24 - v3);
if ( v3 )
{
if ( v4 >= 0x21 )
v7 |= v6[4] << -(char)v3;
}
}
}
}
return (unsigned int)v7 & dword_100648B60[a2];
}