//
// ColorSelectPopup::onPlayerColor1 from 0x86269c to 0x862748 (172 bytes)
//
// 3 xrefs:
// > ??> @ 0x45e20
// > ColorSelectPopup::init @ 0x8657c8
// > ??> @ 0x1541520
//
// 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 12:55:37 +0000
//
__int64 __fastcall ColorSelectPopup::onPlayerColor1(CCMenuItemToggler **this, cocos2d::CCObject *a2)
{
__int64 v3; // x0
_BOOL4 v4; // w1
__int64 result; // x0
cocos2d::CCArray *v6; // x0
unsigned int v7; // w20
__int64 v8; // x0
int v9; // w1
bool v10; // cf
unsigned int v11; // w1
CCMenuItemToggler::toggle(*(this + 135), 0);
v3 = (__int64)*(this + 85);
v4 = *((_DWORD *)this + 283) != 1;
*((_DWORD *)this + 283) = v4;
if ( v3 )
{
*(_BYTE *)(v3 + 1485) = v4;
result = (__int64)*(this + 85);
*(_BYTE *)(result + 1486) = 0;
}
else
{
v6 = *(this + 86);
if ( v6 )
{
v7 = 0;
while ( 1 )
{
result = cocos2d::CCArray::count(v6);
v10 = v7 >= (unsigned int)result;
v11 = v7++;
if ( v10 )
break;
v8 = cocos2d::CCArray::objectAtIndex(*(this + 86), v11);
v9 = *((_DWORD *)this + 283);
*(_BYTE *)(v8 + 1486) = 0;
*(_BYTE *)(v8 + 1485) = v9 == 1;
v6 = *(this + 86);
}
}
else
{
result = (__int64)*(this + 143);
if ( result )
*(_DWORD *)(result + 88) = v4;
}
}
return result;
}