//
// LevelSettingsLayer::createToggleButton from 0xb624cc to 0xb62744 (632 bytes)
//
// 2 xrefs:
// > LevelSettingsLayer::init @ 0xb66028
// > ??> @ 0xbe210
//
// 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:02:13 +0000
//
__int64 __fastcall LevelSettingsLayer::createToggleButton(
__int64 a1,
unsigned __int8 *a2,
__int64 a3,
__int64 a4,
unsigned __int8 a5,
cocos2d::CCNode *a6,
const cocos2d::CCPoint *a7)
{
__int64 v12; // x21
const char *v13; // x1
__int64 v14; // x19
CCMenuItemToggler *v15; // x19
cocos2d::CCNode *v16; // x0
void (__fastcall *v17)(CCMenuItemToggler *, __int64 *); // x24
const char *v18; // x2
cocos2d::CCLabelBMFont *v19; // x0
__int64 v20; // x19
void (__fastcall *v21)(__int64, __int64 *); // x24
__int64 v22; // x0
__int64 (__fastcall *v23)(__int64); // x1
void (__fastcall *v24)(__int64, __int64 *); // x21
float *v25; // x0
float v26; // s0
void (__fastcall *v28)(__int64, float); // x20
float *v29; // x0
_BYTE v32[8]; // [xsp+88h] [xbp+88h] BYREF
__int64 v33; // [xsp+90h] [xbp+90h] BYREF
v12 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_checkOn_001.png", _stack_chk_guard);
v14 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_checkOff_001.png", v13);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v12 + 160LL))(v12, 0.8);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v14 + 160LL))(v14, 0.8);
v15 = (CCMenuItemToggler *)CCMenuItemToggler::create(v12, v14, a1, a3, a4);
CCMenuItemToggler::toggle(v15, a5);
(*(void (__fastcall **)(cocos2d::CCNode *, CCMenuItemToggler *))(*(_QWORD *)a6 + 456LL))(a6, v15);
v16 = a6;
v17 = *(void (__fastcall **)(CCMenuItemToggler *, __int64 *))(*(_QWORD *)v15 + 184LL);
cocos2d::CCNode::convertToNodeSpace(&v33, v16, a7);
v17(v15, &v33);
CCMenuItemToggler::setSizeMult(v15, 1.5);
v18 = (const char *)*a2;
if ( ((unsigned __int8)v18 & 1) != 0 )
{
if ( !*((_QWORD *)a2 + 1) )
return _stack_chk_guard;
v19 = *((cocos2d::CCLabelBMFont **)a2 + 2);
}
else
{
v19 = (cocos2d::CCLabelBMFont *)(a2 + 1);
if ( !((int)v18 >> 1) )
return _stack_chk_guard;
}
v20 = cocos2d::CCLabelBMFont::create(v19, "bigFont.fnt", v18);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v20);
v21 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v20 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v33, 0.0, 0.5);
v21(v20, &v33);
v22 = v12;
v23 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v12 + 328LL);
v24 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v20 + 184LL);
v25 = (float *)v23(v22);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32, (float)((float)(*v25 * 0.5) * 0.8) + 6.0, 0.0);
cocos2d::CCPoint::operator+(&v33, a7);
v24(v20, &v33);
v26 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 328LL))(v20);
if ( v26 > 110.0 )
{
v28 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)v20 + 160LL);
v29 = (float *)(*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v20 + 328LL))(v20, v26);
v28(v20, 110.0 / *v29);
}
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v20 + 160LL))(v20, 0.35);
return _stack_chk_guard;
}