//
// sub_1800A1AE0 from 0x1800a1ae0 to 0x1800a1b6b (139 bytes)
//
// 4 xrefs:
// > cocos2d::CCArray::removeObject @ 0x180007364
// > ??> @ 0x180148250
// > ??> @ 0x180148260
// > ??> @ 0x1801c1770
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:22:13 +0000
//
unsigned __int64 __fastcall sub_1800A1AE0(__int64 a1, __int64 a2, char a3)
{
unsigned int v3; // r9d
_QWORD *v5; // rcx
__int64 v6; // rbx
unsigned __int64 result; // rax
cocos2d::CCObject *v8; // rcx
v3 = *(_DWORD *)a1;
v5 = *(_QWORD **)(a1 + 16);
v6 = 0;
result = (unsigned __int64)v5;
if ( v3 )
{
while ( *(_QWORD *)result != a2 )
{
v6 = (unsigned int)(v6 + 1);
result += 8LL;
if ( (unsigned int)v6 >= v3 )
return result;
}
if ( (_DWORD)v6 != -1 )
{
if ( a3 )
{
v8 = (cocos2d::CCObject *)v5[v6];
if ( v8 )
cocos2d::CCObject::release(v8);
}
result = (unsigned int)(--*(_DWORD *)a1 - v6);
if ( *(_DWORD *)a1 != (_DWORD)v6 )
return (unsigned __int64)memmove(
(void *)(*(_QWORD *)(a1 + 16) + 8 * v6),
(const void *)(*(_QWORD *)(a1 + 16) + 8LL * (unsigned int)(v6 + 1)),
8LL * (unsigned int)result);
}
}
return result;
}