//
// EmoteSprite::characterCount from 0x1004dcbdc to 0x1004dcc2c (80 bytes)
//
// 3 xrefs:
// > sub_10026E0A0 @ 0x10026e0e0
// > EmoteSprite::effectiveLength @ 0x1004dccd8
// > NewThreadPopup::textChanged @ 0x10050b8e8
//
// 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 11:06:35 +0000
//
__int64 __fastcall EmoteSprite::characterCount(__int64 result)
{
__int64 v1; // x9
int v2; // w10
char *v3; // x8
char v4; // t1
v1 = *(unsigned __int8 *)(result + 23);
v2 = (char)v1;
if ( (v1 & 0x80u) != 0LL )
v1 = *(_QWORD *)(result + 8);
if ( !v1 )
return 0;
v3 = (char *)result;
LODWORD(result) = 0;
if ( v2 < 0 )
v3 = *(char **)v3;
do
{
v4 = *v3++;
if ( (v4 & 0xC0) == 0x80 )
result = (unsigned int)result;
else
result = (unsigned int)(result + 1);
--v1;
}
while ( v1 );
return result;
}