//
// cocos2d::CCDirector::purgeDirector from 0x7cab6a to 0x7cac3c (210 bytes)
//
// 1 xrefs:
// > cocos2d::CCDisplayLinkDirector::mainLoop @ 0x7caee4
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:00:30 +0000
//
_DWORD *__fastcall cocos2d::CCDirector::purgeDirector(cocos2d::CCTouchDispatcher **this)
{
__int64 v2; // r0
int v3; // r2
int v4; // r0
cocos2d::CCArray *v5; // r0
_DWORD *v6; // r0
_DWORD *v7; // r0
cocos2d::CCLabelBMFont *v8; // r0
cocos2d *v9; // r0
cocos2d::CCAnimationCache *v10; // r0
cocos2d::CCSpriteFrameCache *v11; // r0
cocos2d::CCTextureCache *v12; // r0
cocos2d::CCShaderCache *v13; // r0
cocos2d::CCFileUtils *v14; // r0
cocos2d::CCConfiguration *v15; // r0
cocos2d::CCUserDefault *v16; // r0
cocos2d::CCNotificationCenter *v17; // r0
cocos2d *v18; // r0
v2 = ((__int64 (__fastcall *)(cocos2d::CCTouchDispatcher **))*((_DWORD *)*this + 16))(this);
cocos2d::CCScheduler::unscheduleAll((cocos2d::CCScheduler *)v2, SHIDWORD(v2), v3);
cocos2d::CCTouchDispatcher::removeAllDelegates(*(this + 25));
v4 = (int)*(this + 55);
if ( v4 )
{
(*(void (__fastcall **)(int))(*(_DWORD *)v4 + 364))(v4);
(*(void (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 55) + 360))(*(this + 55));
(*(void (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 55) + 368))(*(this + 55));
cocos2d::CCObject::release(*(this + 55));
}
v5 = *(this + 58);
*(this + 55) = nullptr;
*(this + 56) = nullptr;
*(this + 22) = nullptr;
cocos2d::CCArray::removeAllObjects(v5);
(*((void (__fastcall **)(cocos2d::CCTouchDispatcher **))*this + 13))(this);
v6 = *(this + 48);
if ( v6 )
{
cocos2d::CCObject::release(v6);
*(this + 48) = nullptr;
}
v7 = *(this + 49);
if ( v7 )
{
cocos2d::CCObject::release(v7);
*(this + 49) = nullptr;
}
v8 = *(this + 50);
if ( v8 )
{
v8 = (cocos2d::CCLabelBMFont *)cocos2d::CCObject::release(v8);
*(this + 50) = nullptr;
}
v9 = (cocos2d *)cocos2d::CCLabelBMFont::purgeCachedData(v8);
v10 = (cocos2d::CCAnimationCache *)cocos2d::ccDrawFree(v9);
v11 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCAnimationCache::purgeSharedAnimationCache(v10);
v12 = (cocos2d::CCTextureCache *)cocos2d::CCSpriteFrameCache::purgeSharedSpriteFrameCache(v11);
v13 = (cocos2d::CCShaderCache *)cocos2d::CCTextureCache::purgeSharedTextureCache(v12);
v14 = (cocos2d::CCFileUtils *)cocos2d::CCShaderCache::purgeSharedShaderCache(v13);
v15 = (cocos2d::CCConfiguration *)cocos2d::CCFileUtils::purgeFileUtils(v14);
v16 = (cocos2d::CCUserDefault *)cocos2d::CCConfiguration::purgeConfiguration(v15);
v17 = (cocos2d::CCNotificationCenter *)cocos2d::CCUserDefault::purgeSharedUserDefault(v16);
v18 = (cocos2d *)cocos2d::CCNotificationCenter::purgeNotificationCenter(v17);
cocos2d::ccGLInvalidateStateCache(v18);
(*(void (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 38) + 8))(*(this + 38));
*(this + 38) = nullptr;
return cocos2d::CCObject::release(this);
}