//
// EmoteSprite::effectiveLength from 0x3f4060 to 0x3f40fc (156 bytes)
//
// 25 xrefs:
// > CommentCell::loadFromComment @ 0x432e4e
// > CommentCell::loadFromComment @ 0x432e5e
// > EditLevelLayer::textChanged @ 0x4a07ae
// > ShareLevelLayer::init @ 0x4a41ba
// > ShareLevelLayer::init @ 0x4a41ca
// > InfoLayer::init @ 0x53f5a0
// > InfoLayer::init @ 0x53f5ac
// > ShareCommentLayer::updateCharCountLabel @ 0x540d44
// > ShareCommentLayer::onShare @ 0x540fee
// > FriendRequestPopup::loadFromGJFriendRequest @ 0x5db83a
// > FriendRequestPopup::loadFromGJFriendRequest @ 0x5db84a
// > SetTextPopup::onClose @ 0x5dc2f0
// > ShareListLayer::init @ 0x6d771c
// > ShareListLayer::init @ 0x6d7732
// > ThreadViewPopup::updateComposeCount @ 0x74889e
// > NewThreadPopup::textChanged @ 0x748d20
// > ThreadViewPopup::insertShareToken @ 0x751b76
// > NewThreadPopup::insertShareToken @ 0x751e80
// > ThreadDescPopup::onSave @ 0x7547ea
// > NewThreadPopup::onSend @ 0x754d46
// > NewThreadPopup::applyMode @ 0x756064
// > ThreadViewPopup::measureBody @ 0x75b2e2
// > ThreadViewPopup::onSend @ 0x75dc26
// > EmotePickerPopup::canAddEmote @ 0x779030
// > SoundPackDescPopup::onSave @ 0x7859cc
//
// 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 11:47:16 +0000
//
int __fastcall EmoteSprite::effectiveLength(unsigned __int8 *a1, int a2, int a3, int a4)
{
int v5; // r5
int i; // r2
char *v7; // r1
void *v9; // [sp+0h] [bp-10h] BYREF
int v10; // [sp+4h] [bp-Ch]
int v11; // [sp+8h] [bp-8h]
int v12; // [sp+Ch] [bp-4h]
v12 = a4;
v9 = nullptr;
v10 = 0;
v11 = 0;
EmoteSprite::parseTokens(a1, (int)&v9, a2);
v5 = EmoteSprite::characterCount(a1);
for ( i = 0; i != -1431655765 * ((v10 - (int)v9) >> 2); ++i )
{
v7 = (char *)v9 + 12 * i;
v5 -= *((_DWORD *)v7 + 1) - 1;
}
if ( v9 )
{
v10 -= 12 * ((715827883 * ((unsigned int)(v10 - (_DWORD)v9) >> 2)) & 0x3FFFFFFF);
operator delete(v9);
}
return v5;
}