//
// sub_10039887C from 0x10039887c to 0x1003988f8 (124 bytes)
//
// 2 xrefs:
// > cocos2d::CCLabelBMFont::setString @ 0x1003987c4
// > cocos2d::CCLabelBMFont::setString @ 0x1003987dc
//
// 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 11:03:42 +0000
//
_WORD *__fastcall sub_10039887C(_WORD *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;
}