//
// sub_180087B10 from 0x180087b10 to 0x180087bb2 (162 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801ae348
// > ??> @ 0x1801fa284
//
// 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_180087B10(__int64 *a1, __int64 a2, void *a3, int a4, __int64 a5, _DWORD *a6)
{
__int64 v6; // r10
int v7; // r9d
__int64 v9; // rcx
const void *v10; // rdx
v6 = *a1;
if ( a2 )
{
*a6 = *(_DWORD *)(v6 + 572);
v7 = *(_DWORD *)(v6 + 572) * a4;
if ( v7 > *(_DWORD *)(v6 + 576) )
return 28;
v9 = *(_QWORD *)(v6 + 8);
if ( v9 == *(_QWORD *)(v6 + 584) )
{
v10 = *(const void **)(v6 + 552);
}
else
{
v10 = *(const void **)(v6 + 560);
*(_QWORD *)(v6 + 560) = *(_QWORD *)(v6 + 552);
*(_BYTE *)(v6 + 592) = *(_BYTE *)(v6 + 593);
*(_QWORD *)(v6 + 552) = v10;
*(_BYTE *)(v6 + 593) = 0;
*(_QWORD *)(v6 + 584) = v9;
}
memmove(a3, v10, 4LL * v7);
}
return 0;
}