//
// cocos2d::CCMenuItemToggle::setEnabled from 0xd65e7c to 0xd65f18 (156 bytes)
//
// 2 xrefs:
// > ??> @ 0x69a78
// > ??> @ 0x1526800
//
// 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::CCMenuItemToggle::setEnabled(__int64 this, unsigned __int8 a2)
{
unsigned int v2; // w20
__int64 v3; // x19
unsigned int *v4; // x1
__int64 *v5; // x19
__int64 *i; // x21
v2 = a2;
if ( *(unsigned __int8 *)(this + 339) != a2 )
{
v3 = this;
cocos2d::CCMenuItem::setEnabled(this, a2);
this = *(_QWORD *)(v3 + 384);
if ( this )
{
this = cocos2d::CCArray::count((cocos2d::CCArray *)this);
if ( (_DWORD)this )
{
this = *(_QWORD *)(v3 + 384);
if ( this )
{
v4 = *(unsigned int **)(this + 56);
this = *v4;
if ( (_DWORD)this )
{
v5 = *((__int64 **)v4 + 2);
for ( i = &v5[(unsigned int)this - 1];
i >= v5;
this = (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)this + 1056LL))(this, v2) )
{
this = *v5;
if ( !*v5 )
break;
++v5;
}
}
}
}
}
}
return this;
}