//
// cocos2d::CCNode::removeAllChildrenWithCleanup from 0x5bcfb8 to 0x5bd03e (134 bytes)
//
// 23 xrefs:
// > CCScrollLayerExt::~CCScrollLayerExt @ 0x2e7f52
// > TableView::~TableView @ 0x2e8d0a
// > TableViewCell::~TableViewCell @ 0x2ea706
// > LoadingLayer::~LoadingLayer @ 0x30b61e
// > TutorialPopup::~TutorialPopup @ 0x32a44e
// > SelectFontLayer::~SelectFontLayer @ 0x4a719a
// > SetIDPopup::~SetIDPopup @ 0x4a7262
// > SetTextPopup::~SetTextPopup @ 0x4a7466
// > CollisionBlockPopup::~CollisionBlockPopup @ 0x4cd28a
// > ColorSelectLiveOverlay::~ColorSelectLiveOverlay @ 0x4ce10e
// > SetupObjectOptionsPopup::~SetupObjectOptionsPopup @ 0x50849e
// > SetupGravityModPopup::~SetupGravityModPopup @ 0x52e54a
// > CreateParticlePopup::~CreateParticlePopup @ 0x52f22a
// > SetupSmartBlockLayer::~SetupSmartBlockLayer @ 0x53cf3e
// > SetupTriggerPopup::~SetupTriggerPopup @ 0x54638e
// > HSVLiveOverlay::~HSVLiveOverlay @ 0x56426a
// > SelectEventLayer::~SelectEventLayer @ 0x57ed1e
// > cocos2d::extension::CCControlHuePicker::~CCControlHuePicker @ 0x5a2b32
// > cocos2d::extension::CCControlSaturationBrightnessPicker::~CCControlSaturationBrightnessPicker @ 0x5a30c2
// > cocos2d::CCParticleBatchNode::removeAllChildrenWithCleanup @ 0x5dd7d2
// > cocos2d::CCSprite::removeAllChildrenWithCleanup @ 0x5e74f8
// > cocos2d::CCSpriteBatchNode::removeAllChildrenWithCleanup @ 0x5e871e
// > cocos2d::CCParallaxNode::removeAllChildrenWithCleanup @ 0x5f6df4
//
// 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 cocos2d::CCNode::removeAllChildrenWithCleanup(cocos2d::CCNode *a1, bool a2)
{
cocos2d::CCArray *m_pChildren; // r0
_BOOL4 v4; // r8
cocos2d::CCArray *v5; // r3
cocos2d::ccArray *data; // r3
cocos2d::CCObject **arr; // r5
cocos2d::CCObject **v8; // r6
int v9; // r4
int v10; // t1
m_pChildren = a1->m_pChildren;
v4 = a2;
if ( m_pChildren && cocos2d::CCArray::count(m_pChildren) )
{
v5 = a1->m_pChildren;
if ( v5 )
{
data = v5->data;
if ( data->num )
{
arr = data->arr;
v8 = &arr[data->num] + 0x3FFFFFFF;
while ( arr <= v8 )
{
v10 = (int)*arr++;
v9 = v10;
if ( !v10 )
break;
if ( a1->m_bRunning )
{
(*(void (__fastcall **)(int))(*(_DWORD *)v9 + 356))(v9);
(*(void (__fastcall **)(int))(*(_DWORD *)v9 + 352))(v9);
}
if ( v4 )
(*(void (__fastcall **)(int))(*(_DWORD *)v9 + 360))(v9);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v9 + 244))(v9, 0);
}
}
}
cocos2d::CCArray::removeAllObjects(a1->m_pChildren);
}
}