//
// cocos2d::CCMenuItemToggle::initWithItem from 0x18005cdf0 to 0x18005ceba (202 bytes)
//
// 4 xrefs:
// > cocos2d::CCMenuItemToggle::create @ 0x18005cb06
// > cocos2d::CCMenuItemToggle::create @ 0x18005cb5e
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bd018
//
// 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:21:49 +0000
//
char __fastcall cocos2d::CCMenuItemToggle::initWithItem(
cocos2d::CCMenuItemToggle *this,
struct cocos2d::CCMenuItem *a2)
{
__int64 v3; // rbx
float *v5; // rax
__int64 v6; // rbx
struct cocos2d::CCArray *v7; // rax
__int64 v8; // rax
__int64 v9; // rdx
__int64 v10; // rdx
float v12; // [rsp+30h] [rbp+8h] BYREF
v3 = *(_QWORD *)this;
v5 = kmVec2Fill(&v12, 0.5, 0.5);
(*(void (__fastcall **)(cocos2d::CCMenuItemToggle *, float *))(v3 + 288))(this, v5);
v6 = *(_QWORD *)this;
*((_QWORD *)this + 44) = 0;
*((_QWORD *)this + 45) = 0;
*((_WORD *)this + 172) = 256;
v7 = cocos2d::CCArray::create();
(*(void (__fastcall **)(cocos2d::CCMenuItemToggle *, struct cocos2d::CCArray *))(v6 + 976))(this, v7);
if ( a2 )
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 48), a2);
v8 = *(_QWORD *)this;
*((_DWORD *)this + 94) = -1;
(*(void (__fastcall **)(cocos2d::CCMenuItemToggle *, _QWORD))(v8 + 960))(this, 0);
LOBYTE(v9) = 1;
(*(void (__fastcall **)(char *, __int64))(*((_QWORD *)this + 40) + 72LL))((char *)this + 320, v9);
LOBYTE(v10) = 1;
(*(void (__fastcall **)(char *, __int64))(*((_QWORD *)this + 40) + 96LL))((char *)this + 320, v10);
return 1;
}