//
// cocos2d::cc_utf8_trim_ws from 0x7f519a to 0x7f51f6 (92 bytes)
//
// 3 xrefs:
// > cocos2d::CCLabelBMFont::updateLabel @ 0x7d3fa6
// > cocos2d::CCLabelBMFont::updateLabel @ 0x7d40ba
// > cocos2d::CCLabelBMFont::updateLabel @ 0x7d410e
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:01:08 +0000
//
_DWORD *__fastcall cocos2d::cc_utf8_trim_ws(_DWORD *result, unsigned __int16 a2)
{
_DWORD *v2; // r5
int v3; // r4
int v4; // r4
unsigned __int16 v5; // r1
int v6; // r6
int v7; // r7
cocos2d *v8; // r0
int v9; // r2
int v10; // r3
int v11; // r2
v2 = result;
v3 = (result[1] - *result) >> 1;
if ( v3 > 0 )
{
v4 = v3 - 1;
result = (_DWORD *)cocos2d::isspace_unicode((cocos2d *)*(unsigned __int16 *)(*result + 2 * v4), a2);
if ( result )
{
v6 = 2 * v4 - 2;
do
{
v7 = v4;
if ( v6 == -2 )
break;
--v4;
v8 = (cocos2d *)*(unsigned __int16 *)(*v2 + v6);
v6 -= 2;
result = (_DWORD *)cocos2d::isspace_unicode(v8, v5);
}
while ( result );
v9 = v2[1];
if ( v7 < (v9 - *v2) >> 1 )
{
v10 = *v2 + 2 * v7;
if ( v10 != v9 )
{
while ( 1 )
{
v11 = v2[1];
if ( v10 == v11 )
break;
v2[1] = v11 - 2;
}
}
}
}
}
return result;
}