//
// SupportLayer::createToggleButton from 0x5394bc to 0x53967a (446 bytes)
//
// 1 xrefs:
// > SupportLayer::customSetup @ 0x53a332
//
// 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 11:52:13 +0000
//
cocos2d::CCNodeRGBA *__fastcall SupportLayer::createToggleButton(
int a1,
int a2,
int a3,
int a4,
bool a5,
const cocos2d::CCPoint *a6,
int a7,
cocos2d::CCArray *a8)
{
int v10; // r11
const char *v11; // r1
int v12; // r6
cocos2d::CCNodeRGBA *v13; // r6
const char *v14; // r2
cocos2d::CCLabelBMFont *v15; // r0
cocos2d::CCObject *v16; // r4
void (__fastcall *v17)(cocos2d::CCObject *, _BYTE *); // r10
float *v18; // r0
void (__fastcall *v19)(cocos2d::CCObject *, _DWORD); // r7
float *v20; // r0
void (__fastcall *v21)(cocos2d::CCObject *, int); // r7
int v22; // r1
void (__fastcall *v24)(cocos2d::CCNodeRGBA *, _BYTE *); // [sp+Ch] [bp-18h]
void (__fastcall *v25)(cocos2d::CCObject *, _BYTE *); // [sp+Ch] [bp-18h]
char v26[4]; // [sp+10h] [bp-14h] BYREF
int v27; // [sp+14h] [bp-10h]
_BYTE v28[8]; // [sp+1Ch] [bp-8h] BYREF
_BYTE v29[8]; // [sp+24h] [bp+0h] BYREF
*(_DWORD *)v26 = a3;
v27 = a4;
v10 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_checkOn_001.png", v26);
v12 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_checkOff_001.png", v11);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v10 + 80))(v10, 1061997773);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v12 + 80))(v12, 1061997773);
v13 = CCMenuItemToggler::create(v10, v12, a1, *(int *)v26, v27);
CCMenuItemToggler::toggle(v13, a5);
(*(void (__fastcall **)(const cocos2d::CCPoint *, cocos2d::CCNodeRGBA *))(*(_DWORD *)a6 + 228))(a6, v13);
v24 = *(void (__fastcall **)(cocos2d::CCNodeRGBA *, _BYTE *))(*(_DWORD *)v13 + 92);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v29, a6);
v24(v13, v29);
CCMenuItemToggler::setSizeMult(v13, 1.5);
if ( (*(_BYTE *)a2 & 1) != 0 )
v15 = *(cocos2d::CCLabelBMFont **)(a2 + 8);
else
v15 = (cocos2d::CCLabelBMFont *)(a2 + 1);
v16 = (cocos2d::CCObject *)cocos2d::CCLabelBMFont::create(v15, "bigFont.fnt", v14);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(**(_DWORD **)(a1 + 464) + 228))(*(_DWORD *)(a1 + 464), v16);
v17 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v16 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29, 0.0, 0.5);
v17(v16, v29);
v25 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v16 + 92);
v18 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v10 + 164))(v10);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, (float)((float)(*v18 * 0.5) * 0.8) + 8.0, 0.0);
cocos2d::CCPoint::operator+(v29, a7, v28);
v25(v16, v29);
if ( *(float *)(*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v16 + 164))(v16) > 120.0 )
{
v19 = *(void (__fastcall **)(cocos2d::CCObject *, _DWORD))(*(_DWORD *)v16 + 80);
v20 = (float *)(*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v16 + 164))(v16);
v19(v16, 120.0 / *v20);
}
v21 = *(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v16 + 80);
if ( (*(float (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v16 + 84))(v16) > 0.35 )
v22 = 1051931443;
else
v22 = (*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v16 + 84))(v16);
v21(v16, v22);
if ( a8 )
{
cocos2d::CCArray::addObject(a8, v13);
cocos2d::CCArray::addObject(a8, v16);
}
return v13;
}