//
// cocos2d::cc_utf8_find_last_not_char from 0xd8d824 to 0xd8d878 (84 bytes)
//
// 2 xrefs:
// > cocos2d::CCLabelBMFont::updateLabel @ 0xd575e8
// > ??> @ 0x90328
//
// 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 13:08:17 +0000
//
__int64 __fastcall cocos2d::cc_utf8_find_last_not_char(__int64 *a1, unsigned __int16 a2)
{
__int64 v2; // x4
__int64 result; // x0
int v4; // w3
unsigned __int16 *v5; // x1
int v6; // t1
v2 = *a1;
result = (unsigned int)((a1[1] - *a1) >> 1) - 1;
if ( (int)result >= 0 )
{
v4 = *(unsigned __int16 *)(v2 + 2LL * (int)result);
if ( v4 == a2 )
{
v5 = (unsigned __int16 *)(v2 + 2LL * (int)result - 2);
do
{
result = (unsigned int)(result - 1);
if ( (_DWORD)result == -1 )
break;
v6 = *v5--;
}
while ( v6 == v4 );
}
}
return result;
}