//
// cocos2d::CCMenuItemToggle::initWithTarget from 0x1003aa130 to 0x1003aa226 (246 bytes)
//
// 0 xrefs:
//
// 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 12:29:23 +0000
//
char __fastcall cocos2d::CCMenuItemToggle::initWithTarget(
__int64 a1,
__int64 a2,
__int64 a3,
__int64 a4,
__int64 a5,
unsigned int *a6)
{
__int64 v9; // rax
__int64 v10; // rsi
__int64 *v11; // rax
unsigned __int64 v12; // rcx
__int64 *v13; // rax
float v15; // [rsp+8h] [rbp-38h] BYREF
__int64 v16; // [rsp+10h] [rbp-30h]
v16 = a5;
sub_100278250(&v15, 0.5, 0.5);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)a1 + 296LL))(a1, &v15);
*(_QWORD *)(a1 + 344) = a2;
*(_QWORD *)(a1 + 352) = a3;
*(_QWORD *)(a1 + 360) = a4;
*(_WORD *)(a1 + 338) = 256;
v9 = sub_1007FE900(a1);
*(_QWORD *)(a1 + 384) = v9;
cocos2d::CCObject::retain(v9);
v10 = v16;
if ( v16 )
{
do
{
while ( 1 )
{
sub_1007FEBF0(*(_QWORD *)(a1 + 384), v10);
v12 = *a6;
if ( v12 > 0x28 )
break;
v11 = (__int64 *)(*((_QWORD *)a6 + 2) + v12);
*a6 = v12 + 8;
v10 = *v11;
if ( !*v11 )
goto LABEL_6;
}
v13 = *((__int64 **)a6 + 1);
*((_QWORD *)a6 + 1) = v13 + 1;
v10 = *v13;
}
while ( *v13 );
}
LABEL_6:
*(_DWORD *)(a1 + 376) = -1;
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1080LL))(a1, 0);
return 1;
}