//
// cocos2d::CCMenuItemToggle::setEnabled from 0x18005b800 to 0x18005b88e (142 bytes)
//
// 5 xrefs:
// > ??> @ 0x1800f8fb8
// > ??> @ 0x180139010
// > ??> @ 0x180139020
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b2eb0
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall cocos2d::CCMenuItemToggle::setEnabled(cocos2d::CCMenuItemToggle *this, bool a2)
{
cocos2d::CCArray *v4; // rcx
__int64 v5; // rax
unsigned int *v6; // rbx
__int64 v7; // rax
_QWORD *v8; // rbx
_QWORD *i; // rsi
if ( this->m_bEnabled != a2 )
{
this->m_bEnabled = a2;
v4 = *((cocos2d::CCArray **)this + 48);
if ( v4 )
{
if ( (unsigned int)cocos2d::CCArray::count(v4) )
{
v5 = *((_QWORD *)this + 48);
if ( v5 )
{
v6 = *(unsigned int **)(v5 + 56);
v7 = *v6;
if ( (_DWORD)v7 )
{
v8 = *((_QWORD **)v6 + 2);
for ( i = &v8[v7 - 1]; v8 <= i; ++v8 )
{
if ( !*v8 )
break;
(*(void (__fastcall **)(_QWORD, bool))(*(_QWORD *)*v8 + 920LL))(*v8, a2);
}
}
}
}
}
}
}