//
// VideoOptionsLayer::createToggleButton from 0x1404ce750 to 0x1404ce98e (574 bytes)
//
// 4 xrefs:
// > VideoOptionsLayer::init @ 0x1404ccf35
// > VideoOptionsLayer::init @ 0x1404cd03b
// > VideoOptionsLayer::init @ 0x1404cd148
// > ??> @ 0x1409296d8
//
// 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:59 +0000
//
// Hidden C++ exception states: #wind=1
cocos2d::CCMenuItem *__fastcall VideoOptionsLayer::createToggleButton(
__int64 a1,
const char *a2,
__int64 a3,
unsigned __int8 a4,
__int64 a5,
__int64 a6,
float a7,
float a8,
__int64 a9,
cocos2d::CCArray *a10)
{
struct cocos2d::CCSprite *v14; // rbx
cocos2d::CCMenuItem *v15; // r12
__int64 v16; // rbx
__int64 v17; // rax
const char *v18; // rcx
struct cocos2d::CCObject *v19; // rdi
__int64 v20; // rbx
__int64 v21; // rax
float *v22; // rax
__int64 v23; // rax
__int64 v25; // [rsp+20h] [rbp-78h] BYREF
_QWORD v26[2]; // [rsp+28h] [rbp-70h] BYREF
v26[1] = a2;
v25 = a6;
v26[0] = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v14 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
(*(void (__fastcall **)(_QWORD))(*(_QWORD *)v26[0] + 160LL))(v26[0]);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v14 + 160LL))(v14);
v15 = CCMenuItemToggler::create((int)v14, v26[0], a1, a3);
CCMenuItemToggler::toggle((__int64)v15, a4);
(*(void (__fastcall **)(__int64, cocos2d::CCMenuItem *))(*(_QWORD *)a5 + 464LL))(a5, v15);
v16 = *(_QWORD *)v15;
cocos2d::CCNode::convertToNodeSpace(a5, &v25, a6);
(*(void (__fastcall **)(cocos2d::CCMenuItem *, __int64))(v16 + 184))(v15, v17);
*(_DWORD *)(*((_QWORD *)v15 + 47) + 372LL) = 1069547520;
*(_DWORD *)(*((_QWORD *)v15 + 48) + 372LL) = 1069547520;
CCMenuItemToggler::toggle((__int64)v15, *((unsigned __int8 *)v15 + 392));
v18 = a2;
if ( *((_QWORD *)a2 + 3) > 0xFu )
v18 = *(const char **)a2;
v19 = cocos2d::CCLabelBMFont::create(v18, (const char *)&qword_140704F78);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCObject *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v19);
if ( a10 )
cocos2d::CCArray::addObject(a10, v19);
v20 = *(_QWORD *)v19;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v25, 0.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(v20 + 288))(v19, v21);
v22 = (float *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v26[0] + 320LL))(v26[0]);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v25, (float)((float)(*v22 * 0.5) * a7) + 8.0, 0.0);
cocos2d::CCPoint::operator+(a6, v26, v23);
(*(void (__fastcall **)(struct cocos2d::CCObject *, _QWORD *))(*(_QWORD *)v19 + 184LL))(v19, v26);
cocos2d::CCLabelBMFont::limitLabelWidth(v19, a8, 0.0, 0.0);
sub_14003D310((__int64)a2);
return v15;
}