//
// cocos2d::CCMenuItemToggle::setEnabled from 0x18005d840 to 0x18005d8ce (142 bytes)
//
// 5 xrefs:
// > ??> @ 0x1800ff490
// > ??> @ 0x1801422cc
// > ??> @ 0x1801422dc
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bd168
//
// 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 11:21:49 +0000
//
void __fastcall cocos2d::CCMenuItemToggle::setEnabled(cocos2d::CCMenuItemToggle *this, unsigned __int8 a2)
{
cocos2d::CCArray *v4; // rcx
__int64 v5; // rax
unsigned int *v6; // rbx
__int64 v7; // rax
_QWORD *v8; // rbx
_QWORD *i; // rsi
if ( *((_BYTE *)this + 345) != a2 )
{
*((_BYTE *)this + 345) = 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, _QWORD))(*(_QWORD *)*v8 + 936LL))(*v8, a2);
}
}
}
}
}
}
}