//
// sub_180002AA0 from 0x180002aa0 to 0x180002b64 (196 bytes)
//
// 2 xrefs:
// > ??> @ 0x180023410
// > ??> @ 0x180049180
//
// 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
//
// Hidden C++ exception states: #wind=1
struct cocos2d::CCObject *__fastcall sub_180002AA0(struct cocos2d::CCObject *Block, __int64 a2)
{
char v2; // bp
__int64 v4; // rax
cocos2d::CCScheduler *v5; // rax
void **v6; // rsi
_QWORD **v7; // rcx
_QWORD *v8; // rcx
_QWORD *v9; // rbx
v2 = a2;
*(_QWORD *)Block = &cocos2d::extension::AssetsManager::Helper::`vftable';
v4 = cocos2d::CCDirector::sharedDirector(Block, a2);
v5 = (cocos2d::CCScheduler *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 112LL))(v4);
cocos2d::CCScheduler::unscheduleAllForTarget(v5, Block);
v6 = *((void ***)Block + 7);
if ( v6 )
{
v7 = (_QWORD **)*v6;
**((_QWORD **)*v6 + 1) = 0;
v8 = *v7;
if ( v8 )
{
do
{
v9 = (_QWORD *)*v8;
j_j_free(v8);
v8 = v9;
}
while ( v9 );
}
j_j_free(*v6);
j_j_free(v6);
}
cocos2d::CCObject::~CCObject(Block);
if ( (v2 & 1) != 0 )
j_j_free(Block);
return Block;
}