//
// sub_1800B81C0 from 0x1800b81c0 to 0x1800b822e (110 bytes)
//
// 1 xrefs:
// > sub_1800357C0 @ 0x1800359c3
//
// 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 sub_1800B81C0(char *a1)
{
char v1; // al
int v2; // edx
char *v3; // r8
v1 = *a1;
v2 = 0;
v3 = a1;
if ( !*a1 )
return (unsigned int)((v2 - 1) >> 31);
while ( !v2 )
{
if ( v1 < 0 )
{
if ( (v1 & 0xE0) == 0xC0 )
{
v2 = 2;
}
else if ( (v1 & 0xF0) == 0xE0 )
{
v2 = 3;
}
else
{
if ( (v1 & 0xF8) != 0xF0 )
return 0;
v2 = 4;
}
}
else
{
v2 = 1;
}
LABEL_12:
v1 = *++v3;
--v2;
if ( !v1 )
return (unsigned int)((v2 - 1) >> 31);
}
if ( (v1 & 0xC0) == 0x80 )
goto LABEL_12;
return 0;
}