//
// cocos2d::cc_utf8_trim_ws from 0x1001ad11c to 0x1001ad200 (228 bytes)
//
// 3 xrefs:
// > cocos2d::CCLabelBMFont::updateLabel @ 0x1002fc60c
// > cocos2d::CCLabelBMFont::updateLabel @ 0x1002fc714
// > cocos2d::CCLabelBMFont::updateLabel @ 0x1002fc7a4
//
// 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
//
void __fastcall cocos2d::cc_utf8_trim_ws(std::vector *a1)
{
std::__vector_base::pointer end; // x21
std::__vector_base::pointer begin; // x22
unsigned __int64 v3; // x20
unsigned __int64 v4; // x24
unsigned int v5; // w23
__int64 v7; // x25
bool v8; // w0
__int64 v9; // x8
size_t v10; // x21
begin = a1->__begin_;
end = a1->__end_;
v3 = (char *)end - (char *)a1->__begin_;
v4 = v3 >> 1;
v5 = (v3 >> 1) - 1;
if ( (int)(v3 >> 1) < 1 || !cocos2d::isspace_unicode(begin[v5]) )
return;
if ( (_DWORD)v4 == 1 )
{
v5 = 0;
LABEL_12:
v9 = v3 & 0x1FFFFFFFELL;
if ( 2LL * v5 != (v3 & 0x1FFFFFFFELL) )
{
v10 = (char *)end - ((char *)begin + v9);
if ( v10 )
memmove(&begin[v5], (char *)begin + v9, v10);
a1->__end_ = (unsigned __int16 *)((char *)&begin[v5] + v10);
}
return;
}
v7 = (unsigned int)(v4 - 2);
if ( cocos2d::isspace_unicode(begin[(unsigned int)v7]) )
{
v5 = v4 - 1;
while ( v7 >= 1 )
{
v8 = cocos2d::isspace_unicode(begin[v7 - 1]);
--v5;
--v7;
if ( !v8 )
goto LABEL_11;
}
v5 = 0;
}
LABEL_11:
if ( (int)v5 < (int)v4 )
goto LABEL_12;
}