//
// LevelSettingsLayer::createToggleButton from 0x14045a560 to 0x14045a7bf (607 bytes)
//
// 2 xrefs:
// > LevelSettingsLayer::init @ 0x140459536
// > ??> @ 0x140927c2c
//
// 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 11:32:31 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall LevelSettingsLayer::createToggleButton(
__int64 a1,
const char *a2,
__int64 a3,
unsigned __int8 a4,
__int64 a5,
__int64 a6)
{
struct cocos2d::CCSprite *v9; // rbp
struct cocos2d::CCSprite *v10; // rbx
cocos2d::CCMenuItem *v11; // rdi
__int64 v12; // rbx
__int64 v13; // rax
const char *v14; // rcx
struct cocos2d::CCLabelBMFont *v15; // rdi
__int64 v16; // rbx
__int64 v17; // rax
float *v18; // rax
__int64 v19; // rax
_BYTE v20[8]; // [rsp+20h] [rbp-68h] BYREF
_BYTE v21[8]; // [rsp+28h] [rbp-60h] BYREF
const char *v22; // [rsp+30h] [rbp-58h]
v22 = a2;
v9 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v10 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v9 + 160LL))(v9);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v10 + 160LL))(v10);
v11 = CCMenuItemToggler::create((int)v9, (int)v10, a1, (__int64)LevelSettingsLayer::onDisable);
CCMenuItemToggler::toggle((__int64)v11, a4);
(*(void (__fastcall **)(__int64, cocos2d::CCMenuItem *))(*(_QWORD *)a5 + 464LL))(a5, v11);
v12 = *(_QWORD *)v11;
cocos2d::CCNode::convertToNodeSpace(a5, v20, a6);
(*(void (__fastcall **)(cocos2d::CCMenuItem *, __int64))(v12 + 184))(v11, v13);
*(_DWORD *)(*((_QWORD *)v11 + 47) + 372LL) = 1069547520;
*(_DWORD *)(*((_QWORD *)v11 + 48) + 372LL) = 1069547520;
CCMenuItemToggler::toggle((__int64)v11, *((unsigned __int8 *)v11 + 392));
if ( *((_QWORD *)a2 + 2) )
{
v14 = a2;
if ( *((_QWORD *)a2 + 3) > 0xFu )
v14 = *(const char **)a2;
v15 = cocos2d::CCLabelBMFont::create(v14, (const char *)&qword_140704F78);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v15);
v16 = *(_QWORD *)v15;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v20, 0.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v16 + 288))(v15, v17);
v18 = (float *)(*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v9 + 320LL))(v9);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v21, (float)((float)(*v18 * 0.5) * 0.80000001) + 6.0, 0.0);
cocos2d::CCPoint::operator+(a6, v20, v19);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, _BYTE *))(*(_QWORD *)v15 + 184LL))(v15, v20);
if ( *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v15 + 320LL))(v15) > 110.0 )
{
(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v15 + 320LL))(v15);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v15 + 160LL))(v15);
}
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v15 + 160LL))(v15);
}
sub_14003D310((__int64)a2);
}