//
// cocos2d::CCMenuItemSprite::selected from 0x1003a9430 to 0x1003a94ca (154 bytes)
//
// 4 xrefs:
// > CCMenuItemSpriteExtra::selected @ 0x1002634f1
// > ??> @ 0x100b14648
// > ??> @ 0x100b34a88
// > ??> @ 0x100b34f98
//
// 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::CCMenuItemSprite::selected(__int64 a1)
{
__int64 result; // rax
__int64 v3; // rdi
__int64 v4; // rdi
__int64 (__fastcall *v5)(__int64, __int64); // rcx
*(_BYTE *)(a1 + 338) = 1;
result = *(_QWORD *)(a1 + 384);
if ( (result || *(_QWORD *)(a1 + 392)) && *(_QWORD *)(a1 + 376) )
{
v3 = *(_QWORD *)(a1 + 392);
if ( v3 )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v3 + 344LL))(v3, 0);
result = *(_QWORD *)(a1 + 384);
}
v4 = *(_QWORD *)(a1 + 376);
v5 = *(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v4 + 344LL);
if ( result )
{
v5(v4, 0);
return (*(__int64 (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 384) + 344LL))(*(_QWORD *)(a1 + 384), 1);
}
else
{
return v5(v4, 1);
}
}
return result;
}