//
// sub_1002FBF54 from 0x1002fbf54 to 0x1002fbfd0 (124 bytes)
//
// 2 xrefs:
// > cocos2d::CCLabelBMFont::setString @ 0x1002fbe9c
// > cocos2d::CCLabelBMFont::setString @ 0x1002fbeb4
//
// 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
//
_WORD *__fastcall sub_1002FBF54(const unsigned __int16 *a1)
{
int v2; // w0
int v3; // w19
size_t v4; // x0
_WORD *v5; // x0
_WORD *v6; // x20
if ( a1 )
{
v2 = cocos2d::cc_wcslen(a1);
v3 = v2;
if ( v2 < -1 )
v4 = -1;
else
v4 = 2LL * (unsigned int)(v2 + 1);
v5 = operator new[](v4);
v6 = v5;
if ( v3 >= 1 )
memcpy(v5, a1, (unsigned int)(2 * v3));
}
else
{
v6 = operator new[](2u);
v3 = 0;
}
v6[v3] = 0;
return v6;
}