//
// SetupObjectOptionsPopup::onToggleAreaParent from 0x140597200 to 0x14059728a (138 bytes)
//
// 2 xrefs:
// > SetupObjectOptionsPopup::init @ 0x14059534f
// > ??> @ 0x14092d128
//
// 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:34:34 +0000
//
char __fastcall SetupObjectOptionsPopup::onToggleAreaParent(__int64 a1)
{
unsigned int v2; // eax
__int64 v3; // rcx
unsigned int v4; // edi
struct cocos2d::CCObject *v5; // rax
LOBYTE(v2) = *(_BYTE *)(a1 + 697) == 0;
*(_BYTE *)(a1 + 697) = v2;
v3 = *(_QWORD *)(a1 + 664);
if ( v3 )
{
*(_BYTE *)(v3 + 1159) = v2;
}
else
{
v4 = 0;
v2 = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 672));
if ( v2 )
{
do
{
v5 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 672), v4++);
*((_BYTE *)v5 + 1159) = *(_BYTE *)(a1 + 697);
v2 = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 672));
}
while ( v4 < v2 );
}
}
return v2;
}