//
// LabelGameObject::updatePreviewLabel from 0x100388d88 to 0x100388ff4 (620 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::resetGroupCounters @ 0x1001fc9f0
// > GJBaseGameLayer::resetGroupCounters @ 0x1001fca68
// > SetItemIDLayer::updateEditorLabel @ 0x10041a498
//
// 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
//
void __fastcall LabelGameObject::updatePreviewLabel(LabelGameObject *a1)
{
int m_shownSpecial; // w8
cocos2d::CCLabelBMFont *v3; // x0
_QWORD *v4; // x1
void *v5; // x0
cocos2d::CCLabelBMFont *v6; // x0
_QWORD *v7; // x1
cocos2d::CCLabelBMFont *m_label; // x0
void **v9; // x1
char *v10; // x1
__int128 v11; // kr00_16
cocos2d::CCLabelBMFont *v12; // x0
void **v13; // x1
void *v14[2]; // [xsp+8h] [xbp-2A8h] BYREF
char v15; // [xsp+1Fh] [xbp-291h]
void *__p[2]; // [xsp+20h] [xbp-290h] BYREF
char v17; // [xsp+37h] [xbp-279h]
_QWORD v18[2]; // [xsp+38h] [xbp-278h] BYREF
char v19; // [xsp+4Fh] [xbp-261h]
_QWORD v20[2]; // [xsp+50h] [xbp-260h] BYREF
char v21; // [xsp+67h] [xbp-249h]
unsigned int m_itemID; // [xsp+6Ch] [xbp-244h] BYREF
__int128 v23; // [xsp+70h] [xbp-240h] BYREF
char *__s; // [xsp+80h] [xbp-230h]
_BYTE v25[512]; // [xsp+88h] [xbp-228h] BYREF
m_shownSpecial = a1->m_shownSpecial;
switch ( m_shownSpecial )
{
case -3:
sub_100009900(__p, "C:AT");
if ( !a1->m_updateLabel )
{
m_label = a1->m_label;
if ( m_label )
{
m_label->m_nExtraKerning = a1->m_kerning;
if ( v17 >= 0 )
v9 = __p;
else
v9 = (void **)__p[0];
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))m_label->setString)(m_label, v9);
}
a1->m_labelDirty = 0;
}
if ( v17 < 0 )
{
v5 = __p[0];
goto LABEL_31;
}
break;
case -2:
sub_100009900(v18, "C:GP");
if ( !a1->m_updateLabel )
{
v6 = a1->m_label;
if ( v6 )
{
v6->m_nExtraKerning = a1->m_kerning;
if ( v19 >= 0 )
v7 = v18;
else
v7 = (_QWORD *)v18[0];
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD *))v6->setString)(v6, v7);
}
a1->m_labelDirty = 0;
}
if ( v19 < 0 )
{
v5 = (void *)v18[0];
goto LABEL_31;
}
break;
case -1:
sub_100009900(v20, "C:GT");
if ( !a1->m_updateLabel )
{
v3 = a1->m_label;
if ( v3 )
{
v3->m_nExtraKerning = a1->m_kerning;
if ( v21 >= 0 )
v4 = v20;
else
v4 = (_QWORD *)v20[0];
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD *))v3->setString)(v3, v4);
}
a1->m_labelDirty = 0;
}
if ( v21 < 0 )
{
v5 = (void *)v20[0];
LABEL_31:
operator delete(v5);
}
break;
default:
v23 = xmmword_1006350E0;
__s = v25;
if ( a1->m_isTimeCounter )
v10 = "T:";
else
v10 = "C:";
sub_10000CB18((__int64 *)&v23, v10, 0);
m_itemID = a1->m_itemID;
sub_100009A40((int)&v23, m_itemID, (int)&m_itemID);
v11 = v23;
if ( *((_QWORD *)&v23 + 1) < (unsigned __int64)(v23 + 1) )
sub_100009ED4((__int64)&v23, v23 + 1);
__s[v11] = 0;
sub_100009900(v14, __s);
if ( !a1->m_updateLabel )
{
v12 = a1->m_label;
if ( v12 )
{
v12->m_nExtraKerning = a1->m_kerning;
if ( v15 >= 0 )
v13 = v14;
else
v13 = (void **)v14[0];
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v12->setString)(v12, v13);
}
a1->m_labelDirty = 0;
}
if ( v15 < 0 )
operator delete(v14[0]);
if ( __s != v25 && __s )
operator delete[](__s);
break;
}
}