//
// LabelGameObject::createLabel from 0x1406549b0 to 0x140654b94 (484 bytes)
//
// 3 xrefs:
// > LevelEditorLayer::updateLevelFont @ 0x1403fdeb4
// > LabelGameObject::setupCustomSprites @ 0x140654985
// > ??> @ 0x140931664
//
// 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:35:44 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall LabelGameObject::createLabel(__int64 a1, const char *a2)
{
__int64 v4; // rcx
__int64 v5; // rbx
int v6; // eax
int v7; // ebx
cocos2d::CCString *v8; // rax
__int64 *CString; // rax
const char *v10; // rcx
struct cocos2d::CCLabelBMFont *v11; // rdi
__int64 v12; // rbx
__int64 v13; // rax
int v14; // eax
__int64 *v15; // rdi
float v16; // xmm1_4
__int64 v17; // rdi
__int64 v18; // rbx
__int64 v19; // rax
__int64 v20[2]; // [rsp+20h] [rbp-48h] BYREF
v20[1] = (__int64)a2;
if ( *(_QWORD *)(a1 + 1856) )
LabelGameObject::removeLabel(a1);
v4 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v20[0] = (__int64)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v20[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v4 = qword_14090BFD0;
}
v5 = v4;
if ( !v4 )
{
v20[0] = (__int64)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v20[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v4 = qword_14090BFD0;
}
v6 = *(_DWORD *)(v5 + 1024);
v7 = 59;
if ( v6 < 59 )
v7 = v6;
if ( v7 <= 0 )
{
GameManager::loadFont(v4, 0);
CString = &qword_140704F78;
}
else
{
GameManager::loadFont(v4, v7);
v8 = cocos2d::CCString::createWithFormat("gjFont%02d.fnt", v7);
CString = (__int64 *)cocos2d::CCString::getCString(v8);
}
v10 = a2;
if ( *((_QWORD *)a2 + 3) > 0xFu )
v10 = *(const char **)a2;
v11 = cocos2d::CCLabelBMFont::create(v10, CString);
*(_QWORD *)(a1 + 1856) = v11;
v12 = *(_QWORD *)v11;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v20, *(float *)(a1 + 432) * 0.5, *(float *)(a1 + 436) * 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v12 + 184))(v11, v13);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, *(_QWORD *)(a1 + 1856));
v14 = *(_DWORD *)(a1 + 1908);
v15 = *(__int64 **)(a1 + 1856);
if ( v15 )
{
if ( v14 == 1 )
{
v16 = 0.0;
}
else if ( v14 == 2 )
{
v16 = 1.0;
}
else
{
v16 = 0.5;
}
v17 = *v15;
v18 = *(_QWORD *)(a1 + 1856);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v20, v16, 0.5);
(*(void (__fastcall **)(__int64, __int64))(v17 + 288))(v18, v19);
}
*(_BYTE *)(a1 + 1864) = 0;
sub_14003D310((__int64)a2);
}