//
// cocos2d::CCDirector::purgeDirector from 0x100479090 to 0x1004791c3 (307 bytes)
//
// 1 xrefs:
// > cocos2d::CCDisplayLinkDirector::mainLoop @ 0x100479680
//
// This function is hookable on this platform (idp: pc, 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 12:30:36 +0000
//
__int64 __fastcall cocos2d::CCDirector::purgeDirector(_QWORD *a1)
{
__int64 v2; // rax
_QWORD *v3; // r14
__int64 v4; // rdi
__int64 v5; // rdi
__int64 v6; // rdi
__int64 v7; // rdi
v2 = (*(__int64 (__fastcall **)(_QWORD *))(*a1 + 128LL))(a1);
cocos2d::CCScheduler::unscheduleAll(v2);
cocos2d::CCTouchDispatcher::removeAllDelegates(a1[15]);
v3 = a1 + 34;
v4 = a1[34];
if ( v4 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v4 + 728LL))(v4);
(*(void (__fastcall **)(_QWORD))(*(_QWORD *)*v3 + 720LL))(*v3);
(*(void (__fastcall **)(_QWORD))(*(_QWORD *)*v3 + 736LL))(*v3);
cocos2d::CCObject::release(*v3);
}
a1[12] = 0;
*(_OWORD *)v3 = 0;
sub_1007FF190(a1[37]);
(*(void (__fastcall **)(_QWORD *))(*a1 + 104LL))(a1);
v5 = a1[29];
if ( v5 )
{
cocos2d::CCObject::release(v5);
a1[29] = 0;
}
v6 = a1[30];
if ( v6 )
{
cocos2d::CCObject::release(v6);
a1[30] = 0;
}
v7 = a1[31];
if ( v7 )
{
cocos2d::CCObject::release(v7);
a1[31] = 0;
}
cocos2d::CCLabelBMFont::purgeCachedData(v7);
cocos2d::ccDrawFree();
cocos2d::CCAnimationCache::purgeSharedAnimationCache();
cocos2d::CCSpriteFrameCache::purgeSharedSpriteFrameCache();
cocos2d::CCTextureCache::purgeSharedTextureCache(v7);
cocos2d::CCShaderCache::purgeSharedShaderCache();
cocos2d::CCFileUtils::purgeFileUtils();
cocos2d::CCConfiguration::purgeConfiguration();
cocos2d::CCUserDefault::purgeSharedUserDefault();
cocos2d::CCNotificationCenter::purgeNotificationCenter();
cocos2d::ccGLInvalidateStateCache();
(*(void (__fastcall **)(_QWORD))(*(_QWORD *)a1[24] + 16LL))(a1[24]);
a1[24] = 0;
return cocos2d::CCObject::release(a1);
}