//
// cocos2d::CCLabelBMFont::createFontChars from 0x180049430 to 0x180049ca0 (2160 bytes)
//
// 4 xrefs:
// > cocos2d::CCLabelBMFont::setFntFile @ 0x18004e20d
// > cocos2d::CCLabelBMFont::setString @ 0x18004e4cc
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bbb54
//
// 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:21:42 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall cocos2d::CCLabelBMFont::createFontChars(cocos2d::CCLabelBMFont *this)
{
unsigned __int16 v2; // di
const unsigned __int16 *v3; // rdx
__int64 v4; // r13
int v5; // ebx
cocos2d *v6; // rcx
unsigned int v7; // r14d
__int64 v8; // r8
__int64 v9; // rdx
_WORD *v10; // rcx
int v11; // eax
int v12; // ebx
__int64 v13; // rcx
unsigned int v14; // r12d
unsigned int v15; // r14d
__int64 v16; // rax
__int64 *v17; // r8
__int64 v18; // rdx
char v19; // r11
__int64 v20; // kr00_8
int v21; // r15d
__int64 v22; // r10
int v23; // r8d
unsigned int v24; // edx
unsigned int v25; // ecx
int v26; // r8d
unsigned int v27; // edx
unsigned int v28; // ecx
int v29; // r8d
unsigned __int64 v30; // rax
__int64 v31; // r11
unsigned __int64 v32; // rdx
__int64 v33; // rbx
__int64 v34; // rbx
__int64 v35; // rax
cocos2d::CCDirector *v36; // rax
float ContentScaleFactor; // xmm0_4
float v38; // xmm8_4
cocos2d::CCDirector *v39; // rax
float v40; // xmm0_4
float v41; // xmm7_4
cocos2d::CCDirector *v42; // rax
float v43; // xmm0_4
float v44; // xmm6_4
cocos2d::CCDirector *v45; // rax
float v46; // xmm0_4
cocos2d::CCRect *v47; // rax
__int64 v48; // rax
__int64 v49; // rdx
cocos2d::CCFontSprite *v50; // rdi
float v51; // xmm8_4
cocos2d::CCFontSprite *v52; // rax
float v53; // xmm6_4
cocos2d::CCDirector *v54; // rax
float v55; // xmm6_4
cocos2d::CCDirector *v56; // rax
__int64 v57; // rax
float v58; // xmm7_4
float v59; // xmm6_4
cocos2d::CCDirector *v60; // rax
float v61; // xmm0_4
cocos2d::CCDirector *v62; // rax
float v63; // xmm0_4
float v64; // xmm6_4
cocos2d::CCDirector *v65; // rax
float v66; // xmm0_4
void (__fastcall *v67)(cocos2d::CCFontSprite *, float *); // rbx
float *v68; // rax
int v69; // eax
float v70; // xmm1_4
float v71; // xmm0_4
cocos2d::CCDirector *v72; // rax
float v73; // xmm0_4
float v74; // xmm6_4
cocos2d::CCDirector *v75; // rax
float v76; // xmm0_4
void (__fastcall *v77)(cocos2d::CCLabelBMFont *, float *); // rbx
float *v78; // rax
float v79; // [rsp+38h] [rbp-99h] BYREF
float v80; // [rsp+3Ch] [rbp-95h]
float v81; // [rsp+40h] [rbp-91h] BYREF
float v82; // [rsp+44h] [rbp-8Dh]
float v83; // [rsp+48h] [rbp-89h] BYREF
float v84; // [rsp+4Ch] [rbp-85h]
int v85; // [rsp+50h] [rbp-81h]
_BYTE v86[8]; // [rsp+54h] [rbp-7Dh] BYREF
float v87; // [rsp+5Ch] [rbp-75h]
float v88; // [rsp+60h] [rbp-71h]
__int16 v89; // [rsp+64h] [rbp-6Dh]
__int16 v90; // [rsp+66h] [rbp-6Bh]
__int16 v91; // [rsp+68h] [rbp-69h]
int v92; // [rsp+70h] [rbp-61h]
float v93[2]; // [rsp+78h] [rbp-59h] BYREF
__int64 *v94; // [rsp+80h] [rbp-51h]
cocos2d::CCFontSprite *v95; // [rsp+88h] [rbp-49h]
float v96; // [rsp+90h] [rbp-41h] BYREF
_BYTE v97[88]; // [rsp+98h] [rbp-39h] BYREF
int v98; // [rsp+138h] [rbp+67h] BYREF
int v99; // [rsp+140h] [rbp+6Fh]
int v100; // [rsp+148h] [rbp+77h]
unsigned int v101; // [rsp+150h] [rbp+7Fh]
v99 = 0;
v2 = -1;
cocos2d::cc_timeval::operator=(&v79, dword_1801B23D0);
v4 = 0;
v100 = 0;
v5 = 1;
v6 = *((cocos2d **)this + 47);
if ( v6 )
{
v7 = cocos2d::cc_wcslen(v6, v3);
v101 = v7;
if ( v7 )
{
v8 = *((_QWORD *)this + 58);
v94 = *(__int64 **)(v8 + 128);
v9 = v7 - 1;
if ( v7 != 1 )
{
v10 = *((_WORD **)this + 47);
do
{
v11 = v5 + 1;
if ( *v10 != 10 )
v11 = v5;
v5 = v11;
++v10;
--v9;
}
while ( v9 );
}
v92 = v5 * *(_DWORD *)(v8 + 64);
v12 = *(_DWORD *)(v8 + 64) * (v5 - 1);
v98 = v12;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)&v81);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v86);
v14 = 0;
do
{
v15 = *(unsigned __int16 *)(*((_QWORD *)this + 47) + v4);
if ( v15 == 10 )
{
v99 = 0;
v12 -= *(_DWORD *)(*((_QWORD *)this + 58) + 64LL);
v98 = v12;
}
else
{
v16 = *v94;
v17 = *(__int64 **)(*v94 + 8);
v18 = *v94;
v19 = *((_BYTE *)v17 + 25);
if ( !v19 )
{
v13 = *(_QWORD *)(*v94 + 8);
do
{
if ( *(_DWORD *)(v13 + 28) >= v15 )
v18 = v13;
else
v13 += 16;
v13 = *(_QWORD *)v13;
}
while ( !*(_BYTE *)(v13 + 25) );
}
if ( *(_BYTE *)(v18 + 25) || v15 < *(_DWORD *)(v18 + 28) || v18 == v16 )
{
v20 = v13;
v13 = (int)(v15 - 97);
switch ( *(_WORD *)(*((_QWORD *)this + 47) + v4) )
{
case 'a':
LOWORD(v15) = 65;
goto LABEL_47;
case 'b':
LOWORD(v15) = 66;
goto LABEL_47;
case 'c':
LOWORD(v15) = 67;
goto LABEL_47;
case 'd':
LOWORD(v15) = 68;
goto LABEL_47;
case 'e':
LOWORD(v15) = 69;
goto LABEL_47;
case 'f':
LOWORD(v15) = 70;
goto LABEL_47;
case 'g':
LOWORD(v15) = 71;
goto LABEL_47;
case 'h':
LOWORD(v15) = 72;
goto LABEL_47;
case 'i':
LOWORD(v15) = 73;
goto LABEL_47;
case 'j':
LOWORD(v15) = 74;
goto LABEL_47;
case 'k':
LOWORD(v15) = 75;
goto LABEL_47;
case 'l':
LOWORD(v15) = 76;
goto LABEL_47;
case 'm':
LOWORD(v15) = 77;
goto LABEL_47;
case 'n':
LOWORD(v15) = 78;
goto LABEL_47;
case 'o':
LOWORD(v15) = 79;
goto LABEL_47;
case 'p':
LOWORD(v15) = 80;
goto LABEL_47;
case 'q':
LOWORD(v15) = 81;
goto LABEL_47;
case 'r':
LOWORD(v15) = 82;
goto LABEL_47;
case 's':
LOWORD(v15) = 83;
goto LABEL_47;
case 't':
LOWORD(v15) = 84;
goto LABEL_47;
case 'u':
LOWORD(v15) = 85;
goto LABEL_47;
case 'v':
LOWORD(v15) = 86;
goto LABEL_47;
case 'w':
LOWORD(v15) = 87;
goto LABEL_47;
case 'x':
LOWORD(v15) = 88;
goto LABEL_47;
case 'y':
LOWORD(v15) = 89;
goto LABEL_47;
case 'z':
LOWORD(v15) = 90;
LABEL_47:
if ( (_WORD)v15 != *(_WORD *)(*((_QWORD *)this + 47) + v4) )
{
v13 = *v94;
if ( !v19 )
{
do
{
if ( *((_DWORD *)v17 + 7) >= (unsigned int)(unsigned __int16)v15 )
v13 = (__int64)v17;
else
v17 += 2;
v17 = (__int64 *)*v17;
}
while ( !*((_BYTE *)v17 + 25) );
}
if ( !*(_BYTE *)(v13 + 25)
&& (unsigned int)(unsigned __int16)v15 >= *(_DWORD *)(v13 + 28)
&& v13 != v16 )
{
break;
}
}
goto LABEL_80;
default:
v13 = v20;
goto LABEL_80;
}
}
v21 = *((_DWORD *)this + 132) + cocos2d::CCLabelBMFont::kerningAmountForFirst(this, v2, v15);
v13 = *((_QWORD *)this + 58);
v22 = *(_QWORD *)(v13 + 56);
if ( v22 )
{
v23 = ((v15 & 0xFF00) + 17973517 + (unsigned __int8)v15) ^ 0x7F76D;
v24 = (v23 << 8) ^ (-1622558010 - v23);
v25 = (v24 >> 13) ^ (-17973517 - v24 - v23);
v26 = (v25 >> 12) ^ (v23 - v25 - v24);
v27 = (v26 << 16) ^ (v24 - v26 - v25);
v28 = (v27 >> 5) ^ (v25 - v27 - v26);
v29 = (v28 >> 3) ^ (v26 - v28 - v27);
v30 = (v29 << 10) ^ (v27 - v29 - v28);
v31 = *(_QWORD *)(v22 + 32);
v32 = (v30 >> 15) ^ (v28 - (unsigned int)v30 - v29);
v13 = (unsigned int)(*(_DWORD *)(v31 + 8) - 1);
v33 = *(_QWORD *)(*(_QWORD *)v31 + 16 * (v13 & v32));
if ( v33 )
{
v13 = *(_QWORD *)(v31 + 32);
v34 = v33 - v13;
if ( v34 )
{
while ( *(_DWORD *)(v34 + 80) != 4 || **(_DWORD **)(v34 + 72) != (unsigned __int16)v15 )
{
v35 = *(_QWORD *)(v34 + 64);
if ( v35 )
{
v34 = v35 - v13;
if ( v35 != v13 )
continue;
}
goto LABEL_79;
}
v85 = *(_DWORD *)(v34 + 4);
cocos2d::CCRect::operator=((__int64)v86, v34 + 8);
v89 = *(_WORD *)(v34 + 24);
v90 = *(_WORD *)(v34 + 26);
v91 = *(_WORD *)(v34 + 28);
cocos2d::CCRect::operator=((__int64)&v81, (__int64)v86);
v36 = cocos2d::CCDirector::sharedDirector();
ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v36);
v38 = v84 / ContentScaleFactor;
v39 = cocos2d::CCDirector::sharedDirector();
v40 = cocos2d::CCDirector::getContentScaleFactor(v39);
v41 = v83 / v40;
v42 = cocos2d::CCDirector::sharedDirector();
v43 = cocos2d::CCDirector::getContentScaleFactor(v42);
v44 = v82 / v43;
v45 = cocos2d::CCDirector::sharedDirector();
v46 = cocos2d::CCDirector::getContentScaleFactor(v45);
v47 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)v97, v81 / v46, v44, v41, v38);
cocos2d::CCRect::operator=((__int64)&v81, (__int64)v47);
v81 = v81 + *((float *)this + 119);
v82 = v82 + *((float *)this + 120);
v48 = (*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *, _QWORD))(*(_QWORD *)this + 472LL))(this, v14);
v50 = (cocos2d::CCFontSprite *)v48;
if ( v48 )
{
LOBYTE(v49) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v48 + 336LL))(v48, v49);
v51 = (float)v21;
}
else
{
v52 = (cocos2d::CCFontSprite *)sub_1800E4AC0(0x288u);
v95 = v52;
if ( v52 )
v50 = cocos2d::CCFontSprite::CCFontSprite(v52);
else
v50 = nullptr;
*((_DWORD *)v50 + 161) = v14;
v51 = (float)v21;
v53 = (float)v89;
v54 = cocos2d::CCDirector::sharedDirector();
*((float *)v50 + 150) = (float)(v53 / cocos2d::CCDirector::getContentScaleFactor(v54)) + (float)v21;
v55 = (float)((float)*(int *)(*((_QWORD *)this + 58) + 64LL) - v88) * 0.5;
v56 = cocos2d::CCDirector::sharedDirector();
*((float *)v50 + 151) = v55 / cocos2d::CCDirector::getContentScaleFactor(v56);
if ( *((_BYTE *)this + 507) )
v57 = *((_QWORD *)this + 65);
else
v57 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 41) + 88LL))(*((_QWORD *)this + 41));
(*(void (__fastcall **)(cocos2d::CCFontSprite *, __int64, float *))(*(_QWORD *)v50 + 896LL))(
v50,
v57,
&v81);
if ( *((_BYTE *)this + 507) )
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 64), v50);
else
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, cocos2d::CCFontSprite *, _QWORD, _QWORD))(*(_QWORD *)this + 448LL))(
this,
v50,
v14,
v14);
cocos2d::CCObject::release(v50);
(*(void (__fastcall **)(__int64, _QWORD))(*((_QWORD *)v50 + 40) + 48LL))(
(__int64)v50 + 320,
*((unsigned __int8 *)this + 506));
(*(void (__fastcall **)(__int64, char *))(*((_QWORD *)v50 + 40) + 80LL))(
(__int64)v50 + 320,
(char *)this + 498);
(*(void (__fastcall **)(__int64, _QWORD))(*((_QWORD *)v50 + 40) + 104LL))(
(__int64)v50 + 320,
*((unsigned __int8 *)this + 496));
}
(*(void (__fastcall **)(cocos2d::CCFontSprite *, float *, _QWORD, float *))(*(_QWORD *)v50 + 984LL))(
v50,
&v81,
0,
&v83);
v58 = (float)(*(_DWORD *)(*((_QWORD *)this + 58) + 64LL) - v90) + (float)v98;
v59 = v84 * 0.5;
v60 = cocos2d::CCDirector::sharedDirector();
v61 = cocos2d::CCDirector::getContentScaleFactor(v60);
kmVec2Fill(
v93,
(float)((float)((float)v89 + (float)v99) + (float)(v87 * 0.5)) + v51,
v58 - (float)(v61 * v59));
v62 = cocos2d::CCDirector::sharedDirector();
v63 = cocos2d::CCDirector::getContentScaleFactor(v62);
v64 = v93[1] / v63;
v65 = cocos2d::CCDirector::sharedDirector();
v66 = cocos2d::CCDirector::getContentScaleFactor(v65);
v67 = *(void (__fastcall **)(cocos2d::CCFontSprite *, float *))(*(_QWORD *)v50 + 184LL);
v68 = kmVec2Fill(&v96, v93[0] / v66, v64);
v67(v50, v68);
v99 += v21 + v91;
v2 = v15;
v69 = v99;
if ( v100 >= v99 )
v69 = v100;
v100 = v69;
}
}
LABEL_79:
v12 = v98;
}
}
LABEL_80:
++v14;
v4 += 2;
}
while ( v14 < v101 );
v70 = (float)v91;
v71 = (float)v100;
if ( v87 > v70 )
v71 = (float)(v71 + v87) - v70;
v79 = v71;
v80 = (float)v92;
}
}
v72 = cocos2d::CCDirector::sharedDirector();
v73 = cocos2d::CCDirector::getContentScaleFactor(v72);
v74 = v80 / v73;
v75 = cocos2d::CCDirector::sharedDirector();
v76 = cocos2d::CCDirector::getContentScaleFactor(v75);
v77 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, float *))(*(_QWORD *)this + 312LL);
v78 = kmVec2Fill((float *)&v98, v79 / v76, v74);
v77(this, v78);
}