//
// cocos2d::CCDirector::toggleShowFPS from 0xd4964c to 0xd4977c (304 bytes)
//
// 6 xrefs:
// > LoadingLayer::loadAssets @ 0x6ede58
// > GraphicsReloadLayer::performReload @ 0x8f31ac
// > MoreOptionsLayer::onToggle @ 0x8f5d14
// > MoreVideoOptionsLayer::onToggle @ 0x8f6200
// > cocos2d::CCDirector::removeStatsLabel @ 0xd4a3d8
// > ??> @ 0xba310
//
// 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:07:37 +0000
//
__int64 __fastcall cocos2d::CCDirector::toggleShowFPS(__int64 a1, unsigned __int8 a2, char *a3, float *a4)
{
int v5; // w21
_DWORD *v7; // x0
const char *v8; // x1
__int64 v9; // x0
__int64 v10; // x23
void (__fastcall *v11)(__int64, float *); // x24
cocos2d::CCDirector *v12; // x0
cocos2d::CCDirector *v13; // x0
__int64 v14; // x19
float v15; // s0
float v16; // s1
void (__fastcall *v17)(__int64, float *); // x22
char *v19; // [xsp+58h] [xbp+58h]
__int64 v20; // [xsp+68h] [xbp+68h] BYREF
float v21; // [xsp+70h] [xbp+70h] BYREF
v5 = a2;
v7 = *(_DWORD **)(a1 + 376);
if ( v7 )
{
v19 = a3;
cocos2d::CCObject::release(v7);
a3 = v19;
*(_QWORD *)(a1 + 376) = 0;
}
*(_BYTE *)(a1 + 368) = v5;
if ( v5 )
{
v8 = a3 + 1;
if ( (*a3 & 1) != 0 )
v8 = *((const char **)a3 + 2);
v9 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"FPS: 0", v8, a3);
*(_QWORD *)(a1 + 376) = v9;
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v9 + 160LL))(v9, 0.5);
v10 = *(_QWORD *)(a1 + 376);
v11 = *(void (__fastcall **)(__int64, float *))(*(_QWORD *)v10 + 296LL);
cocos2d::CCPoint::CCPoint(&v21, 0.0, 1.0);
v11(v10, &v21);
v12 = (cocos2d::CCDirector *)cocos2d::CCObject::retain(*(_QWORD *)(a1 + 376));
v13 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v12);
cocos2d::CCDirector::getWinSize(&v20, v13);
v14 = *(_QWORD *)(a1 + 376);
v15 = *a4 + 1.0;
v16 = *((float *)&v20 + 1) + a4[1];
v17 = *(void (__fastcall **)(__int64, float *))(*(_QWORD *)v14 + 184LL);
cocos2d::CCPoint::CCPoint(&v21, v15, v16);
v17(v14, &v21);
}
return _stack_chk_guard;
}