//
// cocos2d::CCLabelBMFont::createFontChars from 0xd561cc to 0xd56a70 (2212 bytes)
//
// 3 xrefs:
// > cocos2d::CCLabelBMFont::setString @ 0xd56abc
// > cocos2d::CCLabelBMFont::setFntFile @ 0xd5a030
// > ??> @ 0x4a0e0
//
// This function is hookable on this platform (idp: arm, 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 13:07:44 +0000
//
__int64 __fastcall cocos2d::CCLabelBMFont::createFontChars(cocos2d::CCLabelBMFont *this)
{
const unsigned __int16 *v2; // x1
cocos2d *v3; // x0
__int64 v4; // x20
int v5; // w1
int v6; // w0
int v7; // w2
__int64 v8; // x23
unsigned int v9; // w22
unsigned int v10; // w20
unsigned int v11; // w28
__int64 v12; // x0
int v13; // w1
__int64 v14; // x5
int v15; // w0
unsigned int v16; // w2
unsigned int v17; // w1
__int64 v18; // x27
int v19; // w0
unsigned int v20; // w2
unsigned int v21; // w1
int v22; // w0
__int64 v23; // x0
__int64 v24; // x28
float v25; // s8
float v26; // s8
cocos2d::CCDirector *v27; // x0
void (__fastcall *v28)(cocos2d::CCLabelBMFont *, unsigned int *); // x21
cocos2d::CCDirector *v29; // x0
float v30; // s8
float v31; // s9
cocos2d::CCDirector *v32; // x0
cocos2d::CCDirector *v33; // x0
float v34; // s0
float *v36; // x0
float v37; // s11
cocos2d::CCDirector *v38; // x0
float v39; // s11
float v40; // s8
cocos2d::CCDirector *v41; // x0
cocos2d::CCDirector *v42; // x0
float v43; // s1
float v44; // s9
cocos2d::CCDirector *v45; // x0
cocos2d::CCDirector *v46; // x0
float v47; // s2
float v48; // s8
cocos2d::CCDirector *v49; // x0
cocos2d::CCDirector *v50; // x0
float v51; // s0
float v52; // s2
__int64 (__fastcall *v53)(cocos2d::CCLabelBMFont *, _QWORD); // x2
__int64 v54; // x0
__int64 v55; // x28
float v56; // s12
cocos2d::CCDirector *v57; // x0
float v58; // s8
float v59; // s11
float v60; // s9
cocos2d::CCDirector *v61; // x0
float v62; // s0
float v63; // s9
void (__fastcall *v64)(__int64, unsigned int *); // x20
cocos2d::CCDirector *v65; // x0
float v66; // s9
float v67; // s8
cocos2d::CCDirector *v68; // x0
cocos2d::CCDirector *v69; // x0
float v70; // s0
int v71; // w0
float v72; // s9
void (__fastcall *v73)(cocos2d::CCLabelBMFont *, float *); // x21
cocos2d::CCDirector *v74; // x0
float v75; // s9
float v76; // s8
cocos2d::CCDirector *v77; // x0
cocos2d::CCDirector *v78; // x0
float ContentScaleFactor; // s0
cocos2d::CCDirector *v80; // x0
float v81; // s8
cocos2d::CCDirector *v82; // x0
cocos2d::CCDirector *v83; // x0
float v84; // s8
cocos2d::CCDirector *v85; // x0
float v86; // s0
__int64 v87; // x1
__int64 v88; // x1
unsigned int v89; // [xsp+9Ch] [xbp+9Ch]
int v90; // [xsp+A0h] [xbp+A0h]
float v91; // [xsp+A0h] [xbp+A0h]
__int64 *v92; // [xsp+B8h] [xbp+B8h]
unsigned __int16 v93; // [xsp+C0h] [xbp+C0h]
float v94; // [xsp+C0h] [xbp+C0h]
void (__fastcall *v95)(__int64, __int64, float *); // [xsp+C0h] [xbp+C0h]
__int64 CharacterSet; // [xsp+D0h] [xbp+D0h]
int v97; // [xsp+D8h] [xbp+D8h]
int v98; // [xsp+DCh] [xbp+DCh]
int v99; // [xsp+DCh] [xbp+DCh]
int v100; // [xsp+E0h] [xbp+E0h]
int v101; // [xsp+E4h] [xbp+E4h]
int v102; // [xsp+E8h] [xbp+E8h]
unsigned int v103; // [xsp+F4h] [xbp+F4h] BYREF
float v104; // [xsp+F8h] [xbp+F8h] BYREF
float v105; // [xsp+FCh] [xbp+FCh]
float v106[2]; // [xsp+100h] [xbp+100h] BYREF
float v107; // [xsp+108h] [xbp+108h] BYREF
float v108; // [xsp+10Ch] [xbp+10Ch]
float v109; // [xsp+110h] [xbp+110h] BYREF
float v110; // [xsp+114h] [xbp+114h]
unsigned int v111[4]; // [xsp+118h] [xbp+118h] BYREF
float v112; // [xsp+128h] [xbp+128h] BYREF
float v113; // [xsp+12Ch] [xbp+12Ch] BYREF
float v114; // [xsp+134h] [xbp+134h]
float v115; // [xsp+138h] [xbp+138h]
__int16 v116; // [xsp+13Ch] [xbp+13Ch]
__int16 v117; // [xsp+13Eh] [xbp+13Eh]
__int16 v118; // [xsp+140h] [xbp+140h]
cocos2d::CCSize::CCSize(&v104, (const cocos2d::CCSize *)&unk_1560288);
v3 = *((cocos2d **)this + 47);
if ( !v3 || (v100 = cocos2d::cc_wcslen(v3, v2)) == 0 )
{
v72 = v104;
v73 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, float *))(*(_QWORD *)this + 320LL);
v74 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*(cocos2d::CCDirector **)this);
v75 = v72 / cocos2d::CCDirector::getContentScaleFactor(v74);
v76 = v105;
v78 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v77);
ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v78);
cocos2d::CCSize::CCSize(&v112, v75, v76 / ContentScaleFactor);
v73(this, &v112);
return _stack_chk_guard;
}
CharacterSet = cocos2d::CCBMFontConfiguration::getCharacterSet(*((cocos2d::CCBMFontConfiguration **)this + 56));
if ( v100 == 1 )
{
v5 = 1;
}
else
{
v4 = 0;
v5 = 1;
do
{
v6 = *(unsigned __int16 *)(*((_QWORD *)this + 47) + 2 * v4++);
if ( v6 == 10 )
++v5;
}
while ( v100 - 1 > (unsigned int)v4 );
}
v93 = -1;
v7 = *(_DWORD *)(*((_QWORD *)this + 56) + 64LL);
v92 = (__int64 *)(CharacterSet + 8);
v97 = 0;
v89 = v5 * v7;
v8 = 0;
v101 = v5 * v7 - v7;
v9 = 0;
v102 = 0;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)&v107);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)&v113);
do
{
while ( 1 )
{
v10 = *(unsigned __int16 *)(*((_QWORD *)this + 47) + v8);
if ( v10 != 10 )
break;
v102 = 0;
v101 -= *(_DWORD *)(*((_QWORD *)this + 56) + 64LL);
LABEL_10:
++v9;
v8 += 2;
if ( v100 == v9 )
goto LABEL_20;
}
v111[0] = *(unsigned __int16 *)(*((_QWORD *)this + 47) + v8);
v11 = v10;
if ( v92 == std::__tree::find(CharacterSet, v111) )
{
switch ( v10 )
{
case 'a':
v11 = 65;
LOWORD(v10) = 65;
break;
case 'b':
v11 = 66;
LOWORD(v10) = 66;
break;
case 'c':
v11 = 67;
LOWORD(v10) = 67;
break;
case 'd':
v11 = 68;
LOWORD(v10) = 68;
break;
case 'e':
v11 = 69;
LOWORD(v10) = 69;
break;
case 'f':
v11 = 70;
LOWORD(v10) = 70;
break;
case 'g':
v11 = 71;
LOWORD(v10) = 71;
break;
case 'h':
v11 = 72;
LOWORD(v10) = 72;
break;
case 'i':
v11 = 73;
LOWORD(v10) = 73;
break;
case 'j':
v11 = 74;
LOWORD(v10) = 74;
break;
case 'k':
v11 = 75;
LOWORD(v10) = 75;
break;
case 'l':
v11 = 76;
LOWORD(v10) = 76;
break;
case 'm':
v11 = 77;
LOWORD(v10) = 77;
break;
case 'n':
v11 = 78;
LOWORD(v10) = 78;
break;
case 'o':
v11 = 79;
LOWORD(v10) = 79;
break;
case 'p':
v11 = 80;
LOWORD(v10) = 80;
break;
case 'q':
v11 = 81;
LOWORD(v10) = 81;
break;
case 'r':
v11 = 82;
LOWORD(v10) = 82;
break;
case 's':
v11 = 83;
LOWORD(v10) = 83;
break;
case 't':
v11 = 84;
LOWORD(v10) = 84;
break;
case 'u':
v11 = 85;
LOWORD(v10) = 85;
break;
case 'v':
v11 = 86;
LOWORD(v10) = 86;
break;
case 'w':
v11 = 87;
LOWORD(v10) = 87;
break;
case 'x':
v11 = 88;
LOWORD(v10) = 88;
break;
case 'y':
v11 = 89;
LOWORD(v10) = 89;
break;
case 'z':
v11 = 90;
LOWORD(v10) = 90;
break;
default:
goto LABEL_10;
}
v111[0] = v11;
if ( v92 == std::__tree::find(CharacterSet, v111) )
goto LABEL_10;
}
v98 = cocos2d::CCLabelBMFont::kerningAmountForFirst(this, v93, v10);
v12 = *((_QWORD *)this + 56);
v13 = *((_DWORD *)this + 128);
v103 = v11;
v14 = *(_QWORD *)(v12 + 56);
v90 = v13;
if ( !v14 )
goto LABEL_10;
v15 = ((unsigned __int8)v103 + 17973517 + (HIBYTE(v103) << 24) + (BYTE2(v103) << 16) + (BYTE1(v103) << 8)) ^ 0x7F76D;
v16 = (-1622558010 - v15) ^ (v15 << 8);
v17 = (-17973517 - v15 - v16) ^ (v16 >> 13);
v18 = *(_QWORD *)(v14 + 32);
v19 = (v15 - v16 - v17) ^ (v17 >> 12);
v20 = (v16 - v17 - v19) ^ (v19 << 16);
v21 = (v17 - v19 - v20) ^ (v20 >> 5);
v22 = (v19 - v20 - v21) ^ (v21 >> 3);
v23 = *(_QWORD *)(*(_QWORD *)v18
+ 16LL
* (((v21 - v22 - ((v20 - v21 - v22) ^ (v22 << 10)))
^ (((v20 - v21 - v22) ^ (v22 << 10)) >> 15))
& (*(_DWORD *)(v18 + 8) - 1)));
if ( v23 )
goto LABEL_15;
v24 = 0;
while ( 2 )
{
if ( !v24 )
goto LABEL_10;
if ( *(_DWORD *)(v24 + 80) == 4 && !memcmp(*(const void **)(v24 + 72), &v103, 4u) )
{
v112 = *(float *)(v24 + 4);
v99 = v90 + v98;
cocos2d::CCRect::operator=(&v113, (float *)(v24 + 8));
v116 = *(_WORD *)(v24 + 24);
v117 = *(_WORD *)(v24 + 26);
v118 = *(_WORD *)(v24 + 28);
v36 = cocos2d::CCRect::operator=(&v107, &v113);
v37 = v107;
v38 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v36);
v39 = v37 / cocos2d::CCDirector::getContentScaleFactor(v38);
v40 = v108;
v42 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v41);
v43 = v40 / cocos2d::CCDirector::getContentScaleFactor(v42);
v44 = v109;
v91 = v43;
v46 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v45);
v47 = v44 / cocos2d::CCDirector::getContentScaleFactor(v46);
v48 = v110;
v94 = v47;
v50 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v49);
v51 = cocos2d::CCDirector::getContentScaleFactor(v50);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v111, v39, v91, v94, v48 / v51);
cocos2d::CCRect::operator=(&v107, (float *)v111);
v52 = *((float *)this + 116);
v53 = *(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *, _QWORD))(*(_QWORD *)this + 480LL);
v107 = v107 + *((float *)this + 115);
v108 = v108 + v52;
v54 = v53(this, v9);
v55 = v54;
if ( v54 )
{
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v54 + 344LL))(v54, 1);
v56 = (float)v99;
}
else
{
v55 = operator new(0x288u);
cocos2d::CCSprite::CCSprite((cocos2d::CCSprite *)v55);
*(_DWORD *)(v55 + 596) = 0;
*(_DWORD *)(v55 + 600) = 0;
*(_BYTE *)(v55 + 604) = 0;
*(_QWORD *)v55 = &off_1517D80;
*(_QWORD *)(v55 + 320) = &off_1518268;
*(_QWORD *)(v55 + 344) = &off_15182E8;
*(_DWORD *)(v55 + 628) = 0;
*(_DWORD *)(v55 + 608) = 0;
*(_DWORD *)(v55 + 612) = 0;
*(_DWORD *)(v55 + 616) = 0;
*(_DWORD *)(v55 + 620) = 0;
*(_DWORD *)(v55 + 624) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v55 + 632));
*(_DWORD *)(v55 + 640) = v9;
v80 = (cocos2d::CCDirector *)(unsigned int)v116;
v81 = (float)(int)v80;
v82 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v80);
v56 = (float)v99;
*(float *)(v55 + 596) = (float)(v81 / cocos2d::CCDirector::getContentScaleFactor(v82)) + (float)v99;
v83 = (cocos2d::CCDirector *)*(unsigned int *)(*((_QWORD *)this + 56) + 64LL);
v84 = (float)((float)(int)v83 - v115) * 0.5;
v85 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v83);
v86 = cocos2d::CCDirector::getContentScaleFactor(v85);
v87 = *(_QWORD *)v55;
*(float *)(v55 + 600) = v84 / v86;
if ( *((_BYTE *)this + 491) )
{
(*(void (__fastcall **)(__int64, _QWORD, float *))(v87 + 1016))(v55, *((_QWORD *)this + 63), &v107);
}
else
{
v95 = *(void (__fastcall **)(__int64, __int64, float *))(v87 + 1016);
v88 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 41) + 96LL))(*((_QWORD *)this + 41));
v95(v55, v88, &v107);
}
if ( *((_BYTE *)this + 491) )
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 62), (cocos2d::CCObject *)v55);
else
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, __int64, _QWORD, _QWORD))(*(_QWORD *)this + 472LL))(
this,
v55,
v9,
v9);
cocos2d::CCObject::release((_DWORD *)v55);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v55 + 992LL))(v55, *((unsigned __int8 *)this + 490));
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v55 + 968LL))(v55, (char *)this + 482);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v55 + 920LL))(v55, *((unsigned __int8 *)this + 480));
}
v93 = v10;
(*(void (__fastcall **)(__int64, float *, _QWORD, float *))(*(_QWORD *)v55 + 1144LL))(v55, &v107, 0, &v109);
v57 = (cocos2d::CCDirector *)(unsigned int)(*(_DWORD *)(*((_QWORD *)this + 56) + 64LL) - v117);
v58 = v110 * 0.5;
v59 = (float)v101 + (float)(int)v57;
v60 = (float)((float)((float)v102 + (float)v116) + (float)(v114 * 0.5)) + v56;
v61 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v57);
v62 = cocos2d::CCDirector::getContentScaleFactor(v61);
cocos2d::CCPoint::CCPoint(v106, v60, v59 - (float)(v58 * v62));
v63 = v106[0];
v64 = *(void (__fastcall **)(__int64, unsigned int *))(*(_QWORD *)v55 + 184LL);
v65 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*(cocos2d::CCDirector **)v55);
v66 = v63 / cocos2d::CCDirector::getContentScaleFactor(v65);
v67 = v106[1];
v69 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v68);
v70 = cocos2d::CCDirector::getContentScaleFactor(v69);
cocos2d::CCPoint::CCPoint((float *)v111, v66, v67 / v70);
v64(v55, v111);
v71 = v102 + v118 + v99;
v102 = v71;
if ( v97 >= v71 )
v71 = v97;
v97 = v71;
goto LABEL_10;
}
v23 = *(_QWORD *)(v24 + 64);
if ( v23 )
{
LABEL_15:
v24 = v23 - *(_QWORD *)(v18 + 32);
continue;
}
break;
}
++v9;
v8 += 2;
}
while ( v100 != v9 );
LABEL_20:
v25 = (float)v118;
if ( v25 < v114 )
v26 = (float)(v114 + (float)v97) - v25;
else
v26 = (float)v97;
v104 = v26;
v27 = *(cocos2d::CCDirector **)this;
v28 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, unsigned int *))(*(_QWORD *)this + 320LL);
v105 = (float)v89;
v29 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v27);
v30 = v26 / cocos2d::CCDirector::getContentScaleFactor(v29);
v31 = v105;
v33 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v32);
v34 = cocos2d::CCDirector::getContentScaleFactor(v33);
cocos2d::CCSize::CCSize((float *)v111, v30, v31 / v34);
v28(this, v111);
return _stack_chk_guard;
}