//
// sub_86EC0 from 0x86ec0 to 0x86f74 (180 bytes)
//
// 1 xrefs:
// > ??> @ 0x10d6f8
//
// 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_86EC0(__int64 a1)
{
unsigned int v2; // w20
void *v3; // x0
int v4; // w8
unsigned int *v5; // x8
unsigned int v6; // w9
__int64 v7; // x0
v2 = sub_72404(*(_QWORD *)(a1 + 72), *(_QWORD *)(a1 + 48), *(_QWORD *)(a1 + 104), 0, 1);
if ( !v2 )
{
v3 = memcpy(
(void *)(*(_QWORD *)(a1 + 96) + 8LL * (*(_DWORD *)(a1 + 16) + 1) * *(_DWORD *)(a1 + 40)),
*(const void **)(a1 + 104),
8 * (*(int *)(a1 + 16) + 1LL));
v4 = *(_DWORD *)(a1 + 40);
*(_DWORD *)(a1 + 40) = v4 - 1;
if ( v4 <= 0 )
*(_DWORD *)(a1 + 40) = *(_DWORD *)(a1 + 32) - 1;
v5 = (unsigned int *)(a1 + 136);
do
v6 = __ldaxr(v5);
while ( __stlxr(v6 + 1, v5) );
v7 = sub_871DC(v3);
sub_54C8C(v7);
}
return v2;
}