//
// sub_10042C590 from 0x10042c590 to 0x10042c5e4 (84 bytes)
//
// 1 xrefs:
// > sub_10042E648 @ 0x10042e760
//
// 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
//
int *__fastcall sub_10042C590(int *result, int a2)
{
int v2; // w9
int v3; // w8
int v4; // w10
int v5; // w10
int v6; // w10
v2 = *result;
v3 = result[1] + a2;
v4 = result[6];
if ( *result <= v4 - ((v3 + 7) >> 3) )
{
if ( v3 >= 0 )
v5 = result[1] + a2;
else
v5 = v3 + 7;
v6 = v5 >> 3;
*((_QWORD *)result + 2) += v6;
*result = v6 + v2;
result[1] = v3 & 7;
}
else
{
*((_QWORD *)result + 2) = 0;
*result = v4;
result[1] = 1;
}
return result;
}