//
// cocos2d::CCDirector::removeStatsLabel from 0xad76f8 to 0xad782c (308 bytes)
//
// 2 xrefs:
// > GameManager::reloadAllStep2 @ 0x5eeda4
// > ??> @ 0x8e6c8
//
// 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::CCDirector::removeStatsLabel(cocos2d::CCDirector *a1)
{
cocos2d::CCLabelAtlas *m_pFPSLabel; // x0
cocos2d::CCLabelAtlas *m_pSPFLabel; // x0
cocos2d::CCLabelAtlas *m_pDrawsLabel; // x0
cocos2d::CCTextureCache *v5; // x0
void *v6; // x0
unsigned int *v7; // x2
int v8; // w1
__int64 v9; // [xsp+38h] [xbp+38h] BYREF
cocos2d::CCPoint v10; // [xsp+40h] [xbp+40h] BYREF
m_pFPSLabel = a1->m_pFPSLabel;
if ( m_pFPSLabel && a1->m_pSPFLabel )
{
cocos2d::CCObject::release(m_pFPSLabel);
a1->m_pFPSLabel = nullptr;
m_pSPFLabel = a1->m_pSPFLabel;
if ( m_pSPFLabel )
{
cocos2d::CCObject::release(m_pSPFLabel);
a1->m_pSPFLabel = nullptr;
}
m_pDrawsLabel = a1->m_pDrawsLabel;
if ( m_pDrawsLabel )
{
cocos2d::CCObject::release(m_pDrawsLabel);
a1->m_pDrawsLabel = nullptr;
}
v5 = cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::removeTextureForKey(v5, "cc_fps_images");
}
sub_D153B8((int)&v9, &byte_F288A0);
cocos2d::CCPoint::CCPoint(&v10, &stru_1245158);
cocos2d::CCDirector::toggleShowFPS((__int64)a1, 0, (__int64)&v9, (float *)&v10);
v6 = (void *)(v9 - 24);
if ( (__int64 *)(v9 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v9 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *(_DWORD *)(v9 - 8);
*(_DWORD *)(v9 - 8) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v6);
}
}