//
// cocos2d::CCMenuItemToggle::initWithTarget from 0x18005d2a0 to 0x18005d326 (134 bytes)
//
// 4 xrefs:
// > ??> @ 0x180142260
// > ??> @ 0x180142270
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bd06c
//
// 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::initWithTarget(
__int64 a1,
__int64 a2,
__int64 a3,
struct cocos2d::CCObject *a4,
__int64 a5)
{
struct cocos2d::CCArray *v7; // rax
__int64 v8; // rbx
__int64 v9; // rax
cocos2d::CCMenuItem::initWithTarget((__int64 *)a1, a2, a3);
v7 = cocos2d::CCArray::create();
*(_QWORD *)(a1 + 384) = v7;
cocos2d::CCObject::retain(v7);
if ( a4 )
{
v8 = a5 - 8;
do
{
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 384), a4);
a4 = *(struct cocos2d::CCObject **)(v8 + 8);
v8 += 8;
}
while ( a4 );
}
v9 = *(_QWORD *)a1;
*(_DWORD *)(a1 + 376) = -1;
(*(void (__fastcall **)(__int64, _QWORD))(v9 + 960))(a1, 0);
return 1;
}