//
// sub_180048F90 from 0x180048f90 to 0x180049062 (210 bytes)
//
// 3 xrefs:
// > cocos2d::CCLabelBMFont::setString @ 0x18004e436
// > cocos2d::CCLabelBMFont::setString @ 0x18004e44e
// > ??> @ 0x1801bbaf4
//
// 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:41 +0000
//
char *__fastcall sub_180048F90(cocos2d *Src, const unsigned __int16 *a2)
{
int v3; // esi
__int64 v4; // rax
char *v5; // r14
int v6; // ebx
__int64 v7; // rdx
unsigned __int64 v8; // rax
signed __int64 v9; // rdi
char *v10; // rcx
__int64 v11; // rdx
if ( Src )
v3 = cocos2d::cc_wcslen(Src, a2);
else
v3 = 0;
v4 = sub_1800E4C6C(saturated_mul(v3 + 1LL, 2u));
v5 = (char *)v4;
v6 = 0;
if ( v3 >= 8 )
{
v7 = v3 - 1;
v8 = v4 + 2 * v7;
if ( v5 > (char *)Src + 2 * v7 || v8 < (unsigned __int64)Src )
{
memcpy(v5, Src, 2LL * v3);
do
++v6;
while ( v6 < v3 );
}
}
if ( v6 < (__int64)v3 )
{
v9 = Src - (cocos2d *)v5;
v10 = &v5[2 * v6];
v11 = v3 - (__int64)v6;
do
{
*(_WORD *)v10 = *(_WORD *)&v10[v9];
v10 += 2;
--v11;
}
while ( v11 );
}
*(_WORD *)&v5[2 * v3] = 0;
return v5;
}