//
// cocos2d::CCMenuItemToggle::activate from 0x1003aa8a0 to 0x1003aa943 (163 bytes)
//
// 1 xrefs:
// > ??> @ 0x100b34090
//
// 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
//
__int64 __fastcall cocos2d::CCMenuItemToggle::activate(__int64 a1)
{
__int64 result; // rax
unsigned int v3; // r14d
unsigned int v4; // eax
__int64 v5; // rdi
_QWORD *v6; // rdi
_QWORD *v7; // rax
result = *(unsigned __int8 *)(a1 + 339);
if ( (_BYTE)result == 1 )
{
v3 = *(_DWORD *)(a1 + 376) + 1;
v4 = sub_1007FEF90(*(_QWORD *)(a1 + 384));
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1080LL))(a1, v3 % v4);
result = *(unsigned __int8 *)(a1 + 339);
}
if ( (result & 1) != 0 )
{
v5 = *(_QWORD *)(a1 + 344);
if ( v5 )
{
result = *(_QWORD *)(a1 + 352);
if ( result )
{
v6 = (_QWORD *)(*(_QWORD *)(a1 + 360) + v5);
if ( (result & 1) != 0 )
result = *(_QWORD *)(*v6 + result - 1);
result = ((__int64 (__fastcall *)(_QWORD *, __int64))result)(v6, a1);
}
}
if ( *(_DWORD *)(a1 + 300) )
{
v7 = cocos2d::CCScriptEngineManager::sharedManager();
return (*(__int64 (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*v7 + 80LL))(*v7, a1);
}
}
return result;
}