//
// sub_BE1A6 from 0xbe1a6 to 0xbe1f2 (76 bytes)
//
// 1 xrefs:
// > sub_82290 @ 0x822dc
//
// 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:41:47 +0000
//
int __fastcall sub_BE1A6(char *a1)
{
int i; // r1
char v2; // r2
for ( i = 0; ; --i )
{
v2 = *a1;
if ( !*a1 )
return (i - 1) >> 31;
if ( !i )
break;
if ( (v2 & 0xC0) != 0x80 )
return 0;
LABEL_14:
++a1;
}
if ( (*a1 & 0x80) == 0 )
{
i = 1;
goto LABEL_14;
}
if ( (v2 & 0xE0) == 0xC0 )
{
i = 2;
goto LABEL_14;
}
if ( (v2 & 0xF0) == 0xE0 )
{
i = 3;
goto LABEL_14;
}
if ( (v2 & 0xF8) == 0xF0 )
{
i = 4;
goto LABEL_14;
}
return 0;
}