//
// cocos2d::CCMenuItem::activate from 0xd6634c to 0xd663dc (144 bytes)
//
// 10 xrefs:
// > CCMenuExtra::fireSelectedItem @ 0x69136c
// > CCMenuItemSpriteExtra::activate @ 0x691b80
// > CCMenuItemToggler::activate @ 0x691f14
// > cocos2d::CCMenuItemToggle::activate @ 0xd66428
// > cocos2d::CCMenuItemLabel::activate @ 0xd66474
// > ??> @ 0xf9778
// > ??> @ 0x141dc50
// > ??> @ 0x1525430
// > ??> @ 0x1525dd0
// > ??> @ 0x15262d0
//
// This function is hookable on this platform (idp: arm, 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 13:07:53 +0000
//
__int64 __fastcall cocos2d::CCMenuItem::activate(__int64 this)
{
__int64 v1; // x3
__int64 v2; // x19
void (__fastcall *v3)(__int64, __int64); // x2
__int64 v4; // x0
_QWORD *v5; // x0
if ( *(_BYTE *)(this + 339) )
{
v1 = *(_QWORD *)(this + 344);
v2 = this;
if ( !v1 )
goto LABEL_6;
v3 = *(void (__fastcall **)(__int64, __int64))(this + 352);
v4 = *(_QWORD *)(this + 360);
if ( v3 )
{
if ( (v4 & 1) == 0 )
{
v3(v1 + (v4 >> 1), v2);
goto LABEL_6;
}
}
else if ( (v4 & 1) == 0 )
{
goto LABEL_6;
}
(*(void (__fastcall **)(__int64, __int64))((char *)v3 + *(_QWORD *)(v1 + (v4 >> 1))))(v1 + (v4 >> 1), v2);
LABEL_6:
this = *(unsigned int *)(v2 + 300);
if ( (_DWORD)this )
{
v5 = (_QWORD *)cocos2d::CCScriptEngineManager::sharedManager((cocos2d::CCScriptEngineManager *)this);
return (*(__int64 (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*v5 + 80LL))(*v5, v2);
}
}
return this;
}