//
// SetupObjectOptionsPopup::onDisableObject from 0x639850 to 0x6398d2 (130 bytes)
//
// 0 xrefs:
//
// 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:55:23 +0000
//
unsigned int __fastcall SetupObjectOptionsPopup::onDisableObject(SetupObjectOptionsPopup *this, cocos2d::CCObject *a2)
{
cocos2d::CCArray *v3; // r0
cocos2d::CCArray *v4; // r8
unsigned int v5; // r7
_DWORD *v6; // r5
unsigned int result; // r0
int v8; // r4
int v9; // r1
*((_BYTE *)this + 533) ^= 1u;
v3 = *((cocos2d::CCArray **)this + 130);
if ( v3 )
{
v3 = (cocos2d::CCArray *)cocos2d::CCArray::createWithObject(v3, a2);
v4 = v3;
}
else
{
v4 = *((cocos2d::CCArray **)this + 131);
}
v5 = 0;
v6 = *(_DWORD **)(GameManager::sharedState(v3) + 408);
while ( 1 )
{
result = cocos2d::CCArray::count(v4);
if ( v5 >= result )
break;
v8 = cocos2d::CCArray::objectAtIndex(v4, v5);
if ( v6 )
GJBaseGameLayer::removeObjectFromSection(v6, (GameObject *)v8);
v9 = *(_DWORD *)(v8 + 788);
*(_BYTE *)(v8 + 1050) = *((_BYTE *)this + 533);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v8 + 904))(v8, v9);
(*(void (__fastcall **)(int))(*(_DWORD *)v8 + 808))(v8);
if ( v6 )
(*(void (__fastcall **)(_DWORD *, int))(*v6 + 672))(v6, v8);
++v5;
}
return result;
}