//
// getUTF8StringLength from 0xb1c5dc to 0xb1c688 (172 bytes)
//
// 2 xrefs:
// > cocos2d::getCharacterCountInUTF8String @ 0xb1d084
// > ??> @ 0xa7aa8
//
// 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
//
__int64 __fastcall getUTF8StringLength(const char *a1)
{
const char *v1; // x19
unsigned int v2; // w20
signed __int64 v3; // x0
const char *v4; // x21
int v5; // w1
__int64 v6; // x2
char *v7; // x0
v1 = a1;
v2 = 0;
v3 = strlen(a1);
if ( v3 )
{
v4 = &v1[v3];
if ( &v1[v3] == v1 )
return 0;
v5 = byte_F1C6F0[*(unsigned __int8 *)v1] + 1;
v6 = v5;
if ( v5 <= v3 )
{
v2 = 0;
do
{
v7 = (char *)v1;
v1 += v6;
++v2;
if ( !(unsigned __int8)sub_B1BED4(v7, v5) )
break;
if ( v4 == v1 )
return v2;
v5 = byte_F1C6F0[*(unsigned __int8 *)v1] + 1;
v6 = v5;
}
while ( v5 <= v4 - v1 );
return 0;
}
}
return v2;
}