//
// cocos2d::CCLabelBMFont::setString from 0x1006ab120 to 0x1006ab2c2 (418 bytes)
//
// 2 xrefs:
// > ??> @ 0x100b6ab30
// > ??> @ 0x100b87090
//
// 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 12:35:21 +0000
//
__int64 __fastcall cocos2d::CCLabelBMFont::setString(_QWORD *a1, const void *a2, int a3)
{
char v3; // r14
void *v5; // r15
int v6; // r12d
size_t v7; // rdi
_WORD *v8; // rax
_WORD *v9; // r13
int v10; // r12d
size_t v11; // rdi
_WORD *v12; // rax
_WORD *v13; // r13
__int64 v14; // rdi
__int64 v15; // rax
unsigned int *v16; // rax
_QWORD *v17; // r15
unsigned __int64 v18; // r12
__int64 result; // rax
v3 = a3;
if ( a3 )
{
v5 = (void *)a1[51];
if ( a2 )
{
v6 = cocos2d::cc_wcslen(a2);
v7 = -1;
if ( v6 >= -1 )
v7 = 2LL * (unsigned int)(v6 + 1);
v8 = operator new[](v7);
v9 = v8;
if ( v6 > 0 )
memcpy(v8, a2, (unsigned int)(2 * v6));
}
else
{
v9 = operator new[](2u);
v6 = 0;
}
v9[v6] = 0;
a1[51] = v9;
if ( !v5 )
goto LABEL_18;
LABEL_17:
operator delete[](v5);
goto LABEL_18;
}
v5 = (void *)a1[47];
if ( a2 )
{
v10 = cocos2d::cc_wcslen(a2);
v11 = -1;
if ( v10 >= -1 )
v11 = 2LL * (unsigned int)(v10 + 1);
v12 = operator new[](v11);
v13 = v12;
if ( v10 > 0 )
memcpy(v12, a2, (unsigned int)(2 * v10));
}
else
{
v13 = operator new[](2u);
v10 = 0;
}
v13[v10] = 0;
a1[47] = v13;
if ( v5 )
goto LABEL_17;
LABEL_18:
v14 = a1[26];
if ( v14 )
{
if ( (unsigned int)sub_1007FEF90(v14) )
{
v15 = a1[26];
if ( v15 )
{
v16 = *(unsigned int **)(v15 + 56);
if ( *v16 )
{
v17 = *((_QWORD **)v16 + 2);
v18 = (unsigned __int64)&v17[*v16 - 1];
do
{
if ( !*v17 )
break;
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)*v17 + 344LL))(*v17, 0);
++v17;
}
while ( (unsigned __int64)v17 <= v18 );
}
}
}
}
result = cocos2d::CCLabelBMFont::createFontChars((__int64)a1);
if ( v3 )
return (*(__int64 (__fastcall **)(_QWORD *))(*a1 + 960LL))(a1);
return result;
}