//
// sub_10042C444 from 0x10042c444 to 0x10042c528 (228 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
//
__int64 __fastcall sub_10042C444(__int64 a1, unsigned int a2)
{
int v3; // w8
unsigned int v4; // w10
int v5; // w11
unsigned __int8 *v6; // x12
unsigned int v7; // w11
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 + 24);
if ( (int)v4 >= 9 )
{
v7 |= v6[1] << (v3 + 16);
if ( v4 >= 0x11 )
{
v7 |= v6[2] << (v3 + 8);
if ( v4 >= 0x19 )
{
v7 |= v6[3] << v3;
if ( v3 )
{
if ( v4 >= 0x21 )
v7 |= v6[4] >> (8 - v3);
}
}
}
}
return v7 >> ((32 - a2) >> 1) >> ((33 - a2) >> 1);
}