//
// GJItemIcon::toggleEnabledState from 0x50bb30 to 0x50bbba (138 bytes)
//
// 2 xrefs:
// > GJGarageLayer::onToggleItem @ 0x50bc36
// > GJGarageLayer::setupSpecialPage @ 0x50f04c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:51:28 +0000
//
unsigned int __fastcall GJItemIcon::toggleEnabledState(unsigned int this, int a2)
{
int v2; // r4
void (__fastcall *v3)(int, _DWORD *); // r6
cocos2d::CCArray *v4; // r6
unsigned int i; // r4
int v6; // r0
_DWORD v7[2]; // [sp+0h] [bp-8h] BYREF
v7[0] = this;
v7[1] = a2;
if ( !*(_BYTE *)(this + 524) )
{
v2 = *(_DWORD *)(this + 508);
v3 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v2 + 480);
if ( a2 )
{
LOWORD(v7[0]) = -1;
BYTE2(v7[0]) = -1;
}
else
{
memset(v7, 100, 3);
}
v3(v2, v7);
this = (*(int (__fastcall **)(int))(*(_DWORD *)v2 + 244))(v2);
v4 = (cocos2d::CCArray *)this;
if ( this )
{
for ( i = 0; ; ++i )
{
this = cocos2d::CCArray::count(v4);
if ( i >= this )
break;
v6 = cocos2d::CCArray::objectAtIndex(v4, i);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v6 + 172))(v6, 1);
}
}
}
return this;
}