//
// cocos2d::CCSprite::removeAllChildrenWithCleanup from 0xd87ca4 to 0xd87d5c (184 bytes)
//
// 82 xrefs:
// > ??> @ 0x44110
// > ??> @ 0x1413828
// > ??> @ 0x1413de8
// > ??> @ 0x1414b98
// > ??> @ 0x1417408
// > ??> @ 0x14179a8
// > ??> @ 0x141b2c8
// > ??> @ 0x141b8f8
// > ??> @ 0x141cd78
// > ??> @ 0x14219a8
// > ??> @ 0x1421f58
// > ??> @ 0x1423918
// > ??> @ 0x1423ec8
// > ??> @ 0x1424498
// > ??> @ 0x1428e78
// > ??> @ 0x14334e8
// > ??> @ 0x1433ce8
// > ??> @ 0x14342d8
// > ??> @ 0x1434ab8
// > ??> @ 0x14352c8
// > ??> @ 0x143a258
// > ??> @ 0x1443628
// > ??> @ 0x1443e38
// > ??> @ 0x1444648
// > ??> @ 0x1444e58
// > ??> @ 0x1445668
// > ??> @ 0x1445e78
// > ??> @ 0x1446688
// > ??> @ 0x1446e98
// > ??> @ 0x1447678
// > ??> @ 0x1447e88
// > ??> @ 0x1448698
// > ??> @ 0x1448ea8
// > ??> @ 0x14496b8
// > ??> @ 0x1449f08
// > ??> @ 0x144a718
// > ??> @ 0x144af28
// > ??> @ 0x144b738
// > ??> @ 0x144bf48
// > ??> @ 0x144c768
// > ??> @ 0x144cf78
// > ??> @ 0x144d788
// > ??> @ 0x144df98
// > ??> @ 0x144e7a8
// > ??> @ 0x144efb8
// > ??> @ 0x144f7c8
// > ??> @ 0x144ffd8
// > ??> @ 0x14507e8
// > ??> @ 0x1450ff8
// > ??> @ 0x1451808
// > ??> @ 0x1452018
// > ??> @ 0x1452828
// > ??> @ 0x1453038
// > ??> @ 0x1453848
// > ??> @ 0x1454058
// > ??> @ 0x1454868
// > ??> @ 0x1455078
// > ??> @ 0x1455888
// > ??> @ 0x1456098
// > ??> @ 0x14568a8
// > ??> @ 0x14570b8
// > ??> @ 0x14578c8
// > ??> @ 0x14580d8
// > ??> @ 0x14588e8
// > ??> @ 0x1459118
// > ??> @ 0x145b008
// > ??> @ 0x145b5a8
// > ??> @ 0x1477698
// > ??> @ 0x1479748
// > ??> @ 0x1486ba8
// > ??> @ 0x1487158
// > ??> @ 0x1491a88
// > ??> @ 0x1496ec8
// > ??> @ 0x1499418
// > ??> @ 0x14c1d48
// > ??> @ 0x14d9748
// > ??> @ 0x150cb68
// > ??> @ 0x1517a28
// > ??> @ 0x1517fc8
// > ??> @ 0x1518b48
// > ??> @ 0x152e5a8
// > ??> @ 0x152fda8
//
// 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:13 +0000
//
__int64 __fastcall cocos2d::CCSprite::removeAllChildrenWithCleanup(cocos2d::CCSprite *this, unsigned __int8 a2)
{
__int64 v4; // x0
unsigned int *v5; // x1
const void **v6; // x19
const void **v7; // x21
const void *i; // x0
cocos2d::CCSprite *v9; // x1
__int64 result; // x0
if ( *((_QWORD *)this + 46) )
{
v4 = *((_QWORD *)this + 26);
if ( v4 )
{
v5 = *(unsigned int **)(v4 + 56);
if ( *v5 )
{
v6 = *((const void ***)v5 + 2);
v7 = &v6[*v5 - 1];
if ( v6 <= v7 )
{
for ( i = *v6; *v6; i = *v6 )
{
v9 = (cocos2d::CCSprite *)_dynamic_cast(
i,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCSprite,
0);
if ( v9 )
cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas(*((cocos2d::CCSpriteBatchNode **)this + 46), v9);
if ( v7 < ++v6 )
break;
}
}
}
}
}
result = cocos2d::CCNode::removeAllChildrenWithCleanup((__int64)this, a2);
*((_BYTE *)this + 378) = 0;
return result;
}