//
// cocos2d::CCMenuItemToggle::setEnabled from 0xaf3dd4 to 0xaf3e70 (156 bytes)
//
// 2 xrefs:
// > ??> @ 0x4b138
// > ??> @ 0x1210ae0
//
// 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 cocos2d::CCMenuItemToggle::setEnabled(cocos2d::CCMenuItemToggle *a1, bool a2)
{
_BOOL4 v2; // w20
cocos2d::CCArray *v4; // x0
__int64 v5; // x0
unsigned int *v6; // x1
__int64 *v7; // x19
__int64 *v8; // x21
__int64 v9; // x0
v2 = a2;
if ( a1->m_bEnabled != a2 )
{
cocos2d::CCMenuItem::setEnabled(a1, a2);
v4 = *(cocos2d::CCArray **)&a1[1].m_uID;
if ( v4 )
{
if ( (unsigned int)cocos2d::CCArray::count(v4) )
{
v5 = *(_QWORD *)&a1[1].m_uID;
if ( v5 )
{
v6 = *(unsigned int **)(v5 + 56);
if ( *v6 )
{
v7 = *((__int64 **)v6 + 2);
v8 = &v7[*v6 - 1];
while ( v8 >= v7 )
{
v9 = *v7;
if ( !*v7 )
break;
++v7;
(*(void (__fastcall **)(__int64, _BOOL4))(*(_QWORD *)v9 + 1040LL))(v9, v2);
}
}
}
}
}
}
}