//
// sub_1800B81C0 from 0x1800b81c0 to 0x1800b822e (110 bytes)
//
// 1 xrefs:
// > sub_1800357C0 @ 0x1800359c3
//
// This function is hookable on this platform (idp: pc, 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 10:53:59 +0000
//
__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;
}