//
// sub_10015E7C8 from 0x10015e7c8 to 0x10015e87c (180 bytes)
//
// 1 xrefs:
// > sub_10015E660 @ 0x10015e69c
//
// 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_10015E7C8(__int64 *result, _QWORD *a2)
{
int8x8_t v2; // x8
unsigned __int64 v3; // x10
uint8x8_t v4; // d0
__int64 v5; // x12
_QWORD *v6; // x11
unsigned __int64 v7; // x10
v2 = (int8x8_t)result[1];
v3 = a2[1];
v4 = (uint8x8_t)vcnt_s8(v2);
v4.i16[0] = vaddlv_u8(v4);
if ( v4.u32[0] > 1uLL )
{
if ( v3 >= *(_QWORD *)&v2 )
v3 %= *(_QWORD *)&v2;
}
else
{
v3 &= *(_QWORD *)&v2 - 1LL;
}
v5 = *result;
v6 = *(_QWORD **)(*result + 8 * v3);
if ( v6 )
{
*a2 = *v6;
LABEL_13:
*v6 = a2;
goto LABEL_14;
}
*a2 = result[2];
result[2] = (__int64)a2;
*(_QWORD *)(v5 + 8 * v3) = result + 2;
if ( *a2 )
{
v7 = *(_QWORD *)(*a2 + 8LL);
if ( v4.u32[0] > 1uLL )
{
if ( v7 >= *(_QWORD *)&v2 )
v7 %= *(_QWORD *)&v2;
}
else
{
v7 &= *(_QWORD *)&v2 - 1LL;
}
v6 = (_QWORD *)(*result + 8 * v7);
goto LABEL_13;
}
LABEL_14:
++result[3];
return result;
}