//
// LevelEditorLayer::updateObjectLabel from 0x1403f4650 to 0x1403f4b75 (1317 bytes)
//
// 5 xrefs:
// > EditorUI::dynamicGroupUpdate @ 0x1401b8a41
// > LevelEditorLayer::addSpecial @ 0x1403f4c33
// > SetupTriggerPopup::updateEditorLabel @ 0x14060c9be
// > ??> @ 0x14092549c
// > ??> @ 0x1409254a8
//
// 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:31:49 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall LevelEditorLayer::updateObjectLabel(__int64 a1)
{
int v2; // edx
float v3; // xmm7_4
unsigned int v4; // r9d
__int64 v5; // r8
const char *v6; // rcx
cocos2d::CCString *v7; // rax
char *CString; // rax
size_t v9; // r8
cocos2d::CCString *v10; // rax
char *v11; // rax
size_t v12; // r8
cocos2d::CCString *v13; // rax
__m128i *v14; // rbx
void *v15; // rax
__int64 v16; // rax
cocos2d::CCLabelBMFont *v17; // r14
void **v18; // rcx
void **v19; // rdx
float *v20; // rbx
__int64 v21; // rdi
__int64 v22; // rax
__int64 v23; // rax
_BYTE v24[8]; // [rsp+38h] [rbp-29h] BYREF
void *Block[2]; // [rsp+40h] [rbp-21h] BYREF
__m128i si128; // [rsp+50h] [rbp-11h]
_QWORD v27[4]; // [rsp+60h] [rbp-1h] BYREF
v2 = *(_DWORD *)(a1 + 1036);
if ( v2 <= 1585 )
{
if ( v2 != 1585 )
{
if ( v2 > 1049 )
{
if ( v2 != 1268 && (unsigned int)(v2 - 1346) >= 2 )
return;
}
else if ( v2 != 1049 && v2 != 899 && v2 != 901 && (unsigned int)(v2 - 1006) >= 2 )
{
return;
}
}
goto LABEL_29;
}
if ( v2 <= 1811 )
{
if ( v2 != 1811 && v2 != 1595 && v2 != 1611 && v2 != 1616 )
return;
goto LABEL_29;
}
if ( v2 > 2062 )
{
if ( v2 > 3609 )
{
if ( v2 != 3640 && v2 != 3660 )
return;
}
else if ( v2 != 3609 && v2 != 2067 && v2 != 3016 && v2 != 3033 )
{
return;
}
LABEL_29:
v3 = -5.0;
v4 = *(_DWORD *)(a1 + 1480);
v5 = v4;
switch ( v2 )
{
case 899:
v5 = *(unsigned int *)(a1 + 1032);
break;
case 1811:
LABEL_33:
v5 = *(unsigned int *)(a1 + 1696);
break;
case 1816:
v5 = *(unsigned int *)(a1 + 1696);
v3 = 0.0;
break;
case 1817:
goto LABEL_33;
default:
break;
}
*(_OWORD *)Block = 0;
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
switch ( v2 )
{
case 1816:
v6 = "%i.";
if ( !*(_BYTE *)(a1 + 1693) )
v6 = (const char *)&word_1406ED6F8;
v7 = cocos2d::CCString::createWithFormat(v6, *(unsigned int *)(a1 + 1696), v5);
CString = (char *)cocos2d::CCString::getCString(v7);
v9 = -1;
do
++v9;
while ( CString[v9] );
break;
case 3640:
v10 = cocos2d::CCString::createWithFormat("%i\n%i", v4, *(_DWORD *)(a1 + 1484));
v11 = (char *)cocos2d::CCString::getCString(v10);
v12 = -1;
do
++v12;
while ( v11[v12] );
sub_1400405A0(Block, v11, v12);
v3 = 0.0;
goto LABEL_65;
case 1912:
v13 = cocos2d::CCString::createWithFormat("%i/%i", v4, *(_DWORD *)(a1 + 1484));
CString = (char *)cocos2d::CCString::getCString(v13);
v9 = -1;
do
++v9;
while ( CString[v9] );
break;
default:
if ( (int)v5 < 1000 || v2 != 899 && (v2 != 1006 || *(_DWORD *)(a1 + 1624)) )
{
v14 = (__m128i *)GameToolbox::intToString(v27, v5);
if ( Block != (void **)v14 )
{
if ( si128.m128i_i64[1] > 0xFuLL )
{
v15 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v15 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v15 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v15);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
*(__m128i *)Block = *v14;
si128 = v14[1];
v14[1].m128i_i64[0] = 0;
v14[1].m128i_i64[1] = 15;
v14->m128i_i8[0] = 0;
}
sub_14003D310((__int64)v27);
goto LABEL_65;
}
CString = (char *)GJSpecialColorSelect::textForColorIdx(v5);
v9 = -1;
do
++v9;
while ( CString[v9] );
break;
}
sub_1400405A0(Block, CString, v9);
LABEL_65:
v16 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 1552LL))(a1);
v17 = (cocos2d::CCLabelBMFont *)v16;
if ( v16 )
{
v19 = Block;
if ( si128.m128i_i64[1] > 0xFuLL )
v19 = (void **)Block[0];
(**(void (__fastcall ***)(__int64, void **))(v16 + 360))(v16 + 360, v19);
}
else
{
v18 = Block;
if ( si128.m128i_i64[1] > 0xFuLL )
v18 = (void **)Block[0];
v17 = cocos2d::CCLabelBMFont::create((const char *)v18, (const char *)&qword_140704F78);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v17 + 160LL))(v17);
(*(void (__fastcall **)(__int64, cocos2d::CCLabelBMFont *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v17, 1);
(*(void (__fastcall **)(__int64, cocos2d::CCLabelBMFont *))(*(_QWORD *)a1 + 1560LL))(a1, v17);
}
v20 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 320LL))(a1);
v21 = *(_QWORD *)v17;
v22 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 320LL))(a1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, *v20 * 0.5, (float)(*(float *)(v22 + 4) * 0.5) + v3);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, __int64))(v21 + 184))(v17, v23);
cocos2d::CCLabelBMFont::limitLabelWidth(v17, 30.0, 0.5, 0.0);
sub_14003D310((__int64)Block);
return;
}
if ( v2 == 2062 )
goto LABEL_29;
switch ( v2 )
{
case 1812:
case 1814:
case 1815:
case 1816:
case 1817:
case 1912:
goto LABEL_29;
default:
return;
}
}