//
// cocos2d::CCAutoreleasePool::clear from 0x1800076d0 to 0x180007738 (104 bytes)
//
// 4 xrefs:
// > cocos2d::CCPoolManager::finalize @ 0x180007788
// > cocos2d::CCPoolManager::pop @ 0x180007803
// > ??> @ 0x18014cf68
// > ??> @ 0x1801b7a8c
//
// 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:21:18 +0000
//
void __fastcall cocos2d::CCAutoreleasePool::clear(cocos2d::CCAutoreleasePool *this)
{
__int64 v2; // rax
unsigned int *v3; // rdx
__int64 v4; // rax
unsigned __int64 v5; // rdx
unsigned __int64 i; // rcx
if ( (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 7)) )
{
v2 = *((_QWORD *)this + 7);
if ( v2 )
{
v3 = *(unsigned int **)(v2 + 56);
v4 = *v3;
if ( (_DWORD)v4 )
{
v5 = *((_QWORD *)v3 + 2);
for ( i = v5 + 8 * (v4 - 1); i >= v5; i -= 8LL )
{
if ( !*(_QWORD *)i )
break;
--*(_DWORD *)(*(_QWORD *)i + 24LL);
}
}
}
cocos2d::CCArray::removeAllObjects(*((cocos2d::CCArray **)this + 7));
}
}