//
// cocos2d::cc_utf16_vec_from_utf16_str from 0x5ea5d8 to 0x5ea668 (144 bytes)
//
// 1 xrefs:
// > cocos2d::CCLabelBMFont::updateLabel @ 0x5cd7a4
//
// 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
//
std::vector *cocos2d::cc_utf16_vec_from_utf16_str(
std::vector *__return_ptr retstr,
const unsigned __int16 *a2)
{
int v4; // r0
int v5; // r5
int v6; // r8
unsigned __int16 *m_finish; // r3
unsigned int v8; // r0
int v9; // r10
char *v10; // r6
unsigned __int16 *m_start; // r0
unsigned __int16 *v12; // r1
int v13; // r3
unsigned __int16 *v14; // r11
v4 = cocos2d::cc_wcslen(a2);
v5 = 0;
retstr->m_start = nullptr;
retstr->m_finish = nullptr;
retstr->m_reserveEnd = nullptr;
v6 = v4;
while ( v5 < v6 )
{
m_finish = retstr->m_finish;
if ( m_finish == retstr->m_reserveEnd )
{
v8 = std::vector::_M_check_len(retstr, 1u, (int)"vector::_M_emplace_back_aux");
v9 = 2 * v8;
if ( v8 )
{
if ( v8 >= 0x80000000 )
sub_772FB4(v8);
v8 = operator new(2 * v8);
}
v10 = (char *)v8;
m_start = retstr->m_start;
v12 = retstr->m_finish;
v13 = (char *)v12 - (char *)retstr->m_start;
if ( &v10[v13] )
*(_WORD *)&v10[v13] = a2[v5];
v14 = (unsigned __int16 *)(std::__copy_move::__copy_m(
m_start,
(int)v12,
v10)
+ 2);
if ( retstr->m_start )
operator delete(retstr->m_start);
retstr->m_start = (unsigned __int16 *)v10;
retstr->m_finish = v14;
retstr->m_reserveEnd = (unsigned __int16 *)&v10[v9];
}
else
{
if ( m_finish )
*m_finish = a2[v5];
retstr->m_finish = m_finish + 1;
}
++v5;
}
return retstr;
}