//
// ColorSelectLiveOverlay::updateColorLabel from 0x1401265e0 to 0x140126788 (424 bytes)
//
// 3 xrefs:
// > ColorSelectLiveOverlay::init @ 0x140125db0
// > ColorSelectLiveOverlay::onSelectTab @ 0x140126280
// > ??> @ 0x1409169dc
//
// 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:26:58 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall ColorSelectLiveOverlay::updateColorLabel(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rsi
int v4; // ebx
__int64 v5; // rbx
cocos2d::CCString *v6; // rax
char *CString; // rax
size_t v8; // r8
void **v9; // rdx
__int64 v10; // rdx
int v11; // ebx
void *v12; // rcx
void *Block[2]; // [rsp+30h] [rbp-38h] BYREF
__m128i si128; // [rsp+40h] [rbp-28h]
v2 = 696;
if ( !*(_BYTE *)(a1 + 856) )
v2 = 688;
v3 = *(_QWORD *)(v2 + a1);
if ( v3 )
{
v4 = *(_DWORD *)(v3 + 92);
}
else
{
v5 = *(_QWORD *)(a1 + 664);
if ( !v5 )
{
LABEL_27:
(**(void (__fastcall ***)(__int64, const char *))(*(_QWORD *)(a1 + 848) + 360LL))(
*(_QWORD *)(a1 + 848) + 360LL,
" ");
return;
}
v4 = *(_DWORD *)(v5 + 1032);
}
if ( v4 <= 0 )
goto LABEL_27;
*(_OWORD *)Block = 0;
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
if ( v4 >= 1000 )
{
CString = (char *)GJSpecialColorSelect::textForColorIdx((unsigned int)v4);
}
else
{
v6 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)v4);
CString = (char *)cocos2d::CCString::getCString(v6);
}
v8 = -1;
do
++v8;
while ( CString[v8] );
sub_1400405A0(Block, CString, v8);
v9 = Block;
if ( si128.m128i_i64[1] > 0xFuLL )
v9 = (void **)Block[0];
(**(void (__fastcall ***)(__int64, void **))(*(_QWORD *)(a1 + 848) + 360LL))(*(_QWORD *)(a1 + 848) + 360LL, v9);
if ( v3 )
{
if ( v4 >= 1005 && (v11 = v4 - 1009) != 0 && (unsigned int)(v11 - 4) >= 2 )
v10 = 0;
else
LOBYTE(v10) = 1;
ColorSelectLiveOverlay::toggleControls(a1, v10);
}
if ( si128.m128i_i64[1] > 0xFuLL )
{
v12 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v12 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v12 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v12);
}
}