//
// cocos2d::CCSprite::removeAllChildrenWithCleanup from 0x18008bff0 to 0x18008c0b3 (195 bytes)
//
// 9 xrefs:
// > ??> @ 0x1800ebab0
// > ??> @ 0x1800ebf88
// > ??> @ 0x1800ecb08
// > ??> @ 0x1801039c0
// > ??> @ 0x1801069b8
// > ??> @ 0x18013d380
// > ??> @ 0x18013d3d8
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b5c10
//
// 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
//
void __fastcall cocos2d::CCSprite::removeAllChildrenWithCleanup(cocos2d::CCSprite *this, char a2)
{
cocos2d::CCArray *m_pChildren; // rax
cocos2d::ccArray *data; // rbx
__int64 num; // rax
cocos2d::CCObject **arr; // rbx
cocos2d::CCObject **i; // rsi
struct cocos2d::CCSprite *v9; // rax
if ( this->m_pobBatchNode )
{
m_pChildren = this->m_pChildren;
if ( m_pChildren )
{
data = m_pChildren->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
for ( i = &arr[num - 1]; arr <= i; ++arr )
{
if ( !*arr )
break;
v9 = (struct cocos2d::CCSprite *)_RTDynamicCast(
*arr,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::CCSprite `RTTI Type Descriptor',
0);
if ( v9 )
cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas(this->m_pobBatchNode, v9);
}
}
}
}
cocos2d::CCNode::removeAllChildrenWithCleanup(this, a2);
this->m_bHasChildren = 0;
}