//
// EmoteSprite::characterCount from 0x6df054 to 0x6df0a8 (84 bytes)
//
// 4 xrefs:
// > EmoteSprite::effectiveLength @ 0x6e0fec
// > ShareCommentLayer::updateCharCountLabel @ 0x90e3f0
// > NewThreadPopup::textChanged @ 0xc67f28
// > ??> @ 0x1003d8
//
// 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 12:51:36 +0000
//
__int64 __fastcall EmoteSprite::characterCount(__int64 a1)
{
unsigned __int64 v1; // x1
unsigned int v2; // w3
__int64 v3; // x2
char v4; // w2
v1 = 0;
v2 = 0;
while ( 1 )
{
v3 = a1 + 1;
if ( (*(_BYTE *)a1 & 1) == 0 )
break;
if ( v1 >= *(_QWORD *)(a1 + 8) )
return v2;
v3 = *(_QWORD *)(a1 + 16);
LABEL_4:
v4 = *(_BYTE *)(v3 + v1++);
if ( (v4 & 0xC0) != 0x80 )
++v2;
}
if ( v1 < *(_BYTE *)a1 >> 1 )
goto LABEL_4;
return v2;
}