//
// ColorSelectPopup::determineStartValues from 0x862110 to 0x8625bc (1196 bytes)
//
// 2 xrefs:
// > ??> @ 0xcaa20
// > ??> @ 0x14427b0
//
// 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
//
bool __fastcall ColorSelectPopup::determineStartValues(cocos2d::CCObject **this)
{
cocos2d::CCArray *v2; // x0
cocos2d::CCArray *v3; // x19
float v4; // s8
float v5; // s9
int v6; // w24
int v7; // w25
unsigned int v8; // w28
__int64 v9; // x4
__int64 v10; // x5
int v11; // w22
int v12; // w23
int v13; // w21
__int64 v14; // x0
int v15; // w1
char v16; // w4
char v17; // w1
int v18; // w6
int v19; // w4
char v20; // w5
int v21; // w1
int v22; // w1
int v23; // w1
int v24; // w0
int v25; // w1
_BOOL8 result; // x0
__int64 v27; // x0
int v28; // w3
char v29; // w1
int v30; // w4
char v31; // w6
int v32; // w3
char v33; // w5
int v34; // w0
int v35; // w1
unsigned __int64 v36; // [xsp+88h] [xbp+88h]
SetupTriggerPopup::determineStartValues((SetupTriggerPopup *)this);
v2 = *(this + 85);
if ( v2 )
{
v3 = (cocos2d::CCArray *)cocos2d::CCArray::create(v2);
cocos2d::CCArray::addObject(v3, *(this + 85));
}
else
{
v3 = *(this + 86);
}
if ( v3 && (unsigned int)cocos2d::CCArray::count(v3) )
{
v4 = -1.0;
v5 = -1.0;
*((_DWORD *)this + 284) = 1;
*((_BYTE *)this + 1180) = 1;
*((_BYTE *)this + 1160) = 1;
v6 = 1;
*((_BYTE *)this + 1161) = 1;
v7 = 1;
*((_BYTE *)this + 1162) = 1;
*((_DWORD *)this + 283) = -1;
v8 = 0;
v9 = qword_155CA00;
v10 = qword_155CA08;
*((_BYTE *)this + 1112) = -1;
v11 = 0;
*((_BYTE *)this + 1113) = -1;
v12 = 0;
*((_BYTE *)this + 1114) = -1;
v13 = 0;
*((_DWORD *)this + 292) = -1;
*((_DWORD *)this + 294) = -1;
*((float *)this + 285) = 1.0;
*(this + 149) = (cocos2d::CCObject *)v9;
*(this + 150) = (cocos2d::CCObject *)v10;
while ( v8 < (unsigned int)cocos2d::CCArray::count(v3) )
{
v14 = cocos2d::CCArray::objectAtIndex(v3, v8);
if ( !*(_BYTE *)(v14 + 1632) )
*((_BYTE *)this + 1180) = 0;
if ( !*(_BYTE *)(v14 + 1636) )
*((_BYTE *)this + 1162) = 0;
if ( !v12 )
{
v15 = *((_DWORD *)this + 283);
if ( v15 == -1 )
{
if ( *(_BYTE *)(v14 + 1485) )
{
*((_DWORD *)this + 283) = 1;
}
else
{
if ( *(_BYTE *)(v14 + 1486) )
v35 = 2;
else
v35 = 0;
*((_DWORD *)this + 283) = v35;
}
}
else if ( *(_BYTE *)(v14 + 1485) && v15 != 1 || *(_BYTE *)(v14 + 1486) && v15 != 2 )
{
*((_DWORD *)this + 283) = 0;
v12 = 1;
}
}
if ( *(_DWORD *)(v14 + 1028) == 29 )
{
if ( *((_BYTE *)this + 1161) )
*((_BYTE *)this + 1161) = *(_BYTE *)(v14 + 1484);
}
else
{
*((_BYTE *)this + 1160) = 0;
}
if ( *((_DWORD *)this + 284) == 1 )
*((_DWORD *)this + 284) = *(unsigned __int8 *)(v14 + 1487);
if ( !*((_BYTE *)this + 1163) )
*((_BYTE *)this + 1163) = (*(_DWORD *)(v14 + 1028) & 0xFFFFFFEF) == 899 || *(_DWORD *)(v14 + 1028) == 744;
if ( !*((_BYTE *)this + 1165) )
*((_BYTE *)this + 1165) = *(_DWORD *)(v14 + 1028) == 899;
if ( v5 == -1.0 )
{
v5 = *(float *)(v14 + 1452);
}
else if ( v5 != *(float *)(v14 + 1452) )
{
v5 = -2.0;
}
if ( v4 == -1.0 )
{
v4 = *(float *)(v14 + 1456);
}
else if ( v4 != *(float *)(v14 + 1456) )
{
v4 = -2.0;
}
if ( !v13 )
{
if ( v7 )
{
v16 = *(_BYTE *)(v14 + 1448);
v7 = 0;
v17 = *(_BYTE *)(v14 + 1449);
*((_BYTE *)this + 1114) = *(_BYTE *)(v14 + 1450);
*((_BYTE *)this + 1112) = v16;
*((_BYTE *)this + 1113) = v17;
}
else if ( *((unsigned __int8 *)this + 1112) != *(unsigned __int8 *)(v14 + 1448)
|| *((unsigned __int8 *)this + 1113) != *(unsigned __int8 *)(v14 + 1449)
|| *((unsigned __int8 *)this + 1114) != *(unsigned __int8 *)(v14 + 1450) )
{
*((_BYTE *)this + 1112) = -1;
v13 = 1;
*((_BYTE *)this + 1113) = -1;
*((_BYTE *)this + 1114) = -1;
}
}
if ( !v11 )
{
if ( v6 )
{
v18 = *(_DWORD *)(v14 + 1612);
v19 = *(_DWORD *)(v14 + 1616);
v20 = *(_BYTE *)(v14 + 1625);
v21 = *(_DWORD *)(v14 + 1620);
v6 = 0;
*((_BYTE *)this + 1204) = *(_BYTE *)(v14 + 1624);
*((_BYTE *)this + 1205) = v20;
*((_DWORD *)this + 298) = v18;
*((_DWORD *)this + 299) = v19;
*((_DWORD *)this + 300) = v21;
}
else if ( *(float *)(v14 + 1612) != *((float *)this + 298)
|| *(float *)(v14 + 1616) != *((float *)this + 299)
|| *(float *)(v14 + 1620) != *((float *)this + 300)
|| (v36 = v36 & 0xFFFF0000FFFFFFFFLL
| ((unsigned __int64)*(unsigned __int8 *)(v14 + 1624) << 32) & 0xFFFF00FFFFFFFFFFLL
| ((unsigned __int64)*(unsigned __int8 *)(v14 + 1625) << 40),
WORD2(v36) != *((unsigned __int16 *)this + 602)) )
{
*((_BYTE *)this + 1204) = 0;
*((_DWORD *)this + 298) = -1165815185;
*((_BYTE *)this + 1205) = 0;
v11 = 1;
*((_DWORD *)this + 299) = 0;
*((_DWORD *)this + 300) = 0;
}
}
v22 = *((_DWORD *)this + 292);
if ( v22 == -1 )
{
*((_DWORD *)this + 292) = *(_DWORD *)(v14 + 1024);
}
else if ( v22 != *(_DWORD *)(v14 + 1024) )
{
*((_DWORD *)this + 292) = 0;
}
v23 = *((_DWORD *)this + 294);
v24 = *(_DWORD *)(v14 + 1628);
if ( v23 == -1 )
{
*((_DWORD *)this + 294) = v24;
++v8;
}
else
{
if ( v23 != v24 )
*((_DWORD *)this + 294) = 0;
++v8;
}
}
if ( v5 >= 0.0 )
*((float *)this + 282) = v5;
if ( v4 >= 0.0 )
*((float *)this + 285) = v4;
}
else
{
v27 = (__int64)*(this + 143);
if ( v27 )
{
*((_BYTE *)this + 1160) = 0;
*((_DWORD *)this + 283) = *(_DWORD *)(v27 + 88);
*((_DWORD *)this + 284) = *(unsigned __int8 *)(v27 + 84);
*((_DWORD *)this + 285) = *(_DWORD *)(v27 + 96);
v28 = *(_DWORD *)(v27 + 92);
*((_BYTE *)this + 1163) = (unsigned int)(v28 - 1) <= 0x3E6 || (unsigned int)(v28 - 1002) <= 1;
*((_BYTE *)this + 1164) = v28 == 0;
LOBYTE(v28) = *(_BYTE *)(v27 + 72);
v29 = *(_BYTE *)(v27 + 73);
*((_BYTE *)this + 1114) = *(_BYTE *)(v27 + 74);
*((_BYTE *)this + 1112) = v28;
*((_BYTE *)this + 1113) = v29;
*((_DWORD *)this + 282) = 0;
v25 = *(_DWORD *)(v27 + 120);
*((_DWORD *)this + 294) = v25;
*((_BYTE *)this + 1180) = *(_BYTE *)(v27 + 125);
v30 = *(_DWORD *)(v27 + 104);
v31 = *(_BYTE *)(v27 + 116);
v32 = *(_DWORD *)(v27 + 108);
v33 = *(_BYTE *)(v27 + 117);
v34 = *(_DWORD *)(v27 + 112);
*((_BYTE *)this + 1204) = v31;
*((_BYTE *)this + 1205) = v33;
*((_DWORD *)this + 298) = v30;
*((_DWORD *)this + 299) = v32;
*((_DWORD *)this + 300) = v34;
goto LABEL_46;
}
}
v25 = *((_DWORD *)this + 294);
LABEL_46:
result = v25 != 0;
*((_BYTE *)this + 1163) = 1;
*((_BYTE *)this + 1256) = result;
return result;
}