//
// cocos2d::CCSpriteBatchNode::removeAllChildrenWithCleanup from 0xd89cf4 to 0xd89d94 (160 bytes)
//
// 5 xrefs:
// > ??> @ 0x4a140
// > ??> @ 0x1415158
// > ??> @ 0x15185c8
// > ??> @ 0x152eb88
// > ??> @ 0x1530be8
//
// This function is hookable on this platform (idp: arm, 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 13:08:15 +0000
//
__int64 __fastcall cocos2d::CCSpriteBatchNode::removeAllChildrenWithCleanup(
cocos2d::CCSpriteBatchNode *this,
unsigned __int8 a2)
{
cocos2d::CCArray *v4; // x0
__int64 v5; // x0
unsigned int *v6; // x1
__int64 *v7; // x19
__int64 *v8; // x20
__int64 v9; // x0
v4 = *((cocos2d::CCArray **)this + 43);
if ( v4 )
{
if ( (unsigned int)cocos2d::CCArray::count(v4) )
{
v5 = *((_QWORD *)this + 43);
if ( v5 )
{
v6 = *(unsigned int **)(v5 + 56);
if ( *v6 )
{
v7 = *((__int64 **)v6 + 2);
v8 = &v7[*v6 - 1];
while ( v8 >= v7 )
{
v9 = *v7;
if ( !*v7 )
break;
++v7;
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v9 + 1120LL))(v9, 0);
}
}
}
}
}
cocos2d::CCNode::removeAllChildrenWithCleanup((__int64)this, a2);
cocos2d::CCArray::removeAllObjects(*((cocos2d::CCArray **)this + 43));
return cocos2d::CCTextureAtlas::removeAllQuads(*((cocos2d::CCTextureAtlas **)this + 41));
}