//
// CharacterColorPage::activeColorForMode from 0x140089490 to 0x140089596 (262 bytes)
//
// 2 xrefs:
// > CharacterColorPage::onPlayerColor @ 0x140089e2c
// > ??> @ 0x1406c6cfc
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=3
int CharacterColorPage::activeColorForMode(CharacterColorPage *a1, int a2)
{
int v2; // edx
__int64 v4; // rcx
__int64 v5; // rcx
__int64 v6; // rcx
void *v7; // [rsp+30h] [rbp+8h]
void *v8; // [rsp+30h] [rbp+8h]
void *v9; // [rsp+30h] [rbp+8h]
if ( a2 )
{
v2 = a2 - 1;
if ( v2 )
{
if ( v2 == 1 )
{
v4 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v7 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v4 = qword_1406C2ED8;
}
return *(_DWORD *)(v4 + 828) - *(_DWORD *)(v4 + 832);
}
else
{
return 0;
}
}
else
{
v5 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v8 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v8);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v5 = qword_1406C2ED8;
}
return *(_DWORD *)(v5 + 816) - *(_DWORD *)(v5 + 820);
}
}
else
{
v6 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v9 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v9);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v6 = qword_1406C2ED8;
}
return *(_DWORD *)(v6 + 804) - *(_DWORD *)(v6 + 808);
}
}