//
// sub_1001ACA10 from 0x1001aca10 to 0x1001acafc (236 bytes)
//
// 3 xrefs:
// > sub_1001ACAFC @ 0x1001acb4c
// > sub_1001ACB84 @ 0x1001acbf0
// > sub_1001ACD44 @ 0x1001acdb8
//
// 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
//
bool __fastcall sub_1001ACA10(unsigned __int8 *a1, int a2)
{
__int64 v2; // x8
unsigned __int8 *v3; // x9
int v4; // t1
int v5; // t1
unsigned int v6; // w9
unsigned int v7; // w8
v2 = 0;
v3 = &a1[a2];
if ( a2 <= 2 )
{
if ( a2 == 1 )
{
v7 = *a1;
goto LABEL_16;
}
if ( a2 != 2 )
return v2;
LABEL_9:
if ( (char)*(v3 - 1) > -65 )
return 0;
v6 = *(v3 - 1);
v7 = *a1;
if ( v7 <= 0xEF )
{
if ( v7 != 224 )
{
if ( v7 == 237 )
{
if ( v6 <= 0x9F )
{
v7 = 237;
return v7 < 0xF5;
}
return 0;
}
goto LABEL_16;
}
if ( v6 >= 0xA0 )
{
v7 = 224;
return v7 < 0xF5;
}
return 0;
}
if ( v7 == 240 )
{
if ( v6 >= 0x90 )
{
v7 = 240;
return v7 < 0xF5;
}
return 0;
}
if ( v7 == 244 )
{
if ( v6 <= 0x8F )
{
v7 = 244;
return v7 < 0xF5;
}
return 0;
}
LABEL_16:
if ( (char)v7 >= -62 )
return v7 < 0xF5;
return 0;
}
if ( a2 == 3 )
{
LABEL_8:
v5 = (char)*--v3;
if ( v5 > -65 )
return 0;
goto LABEL_9;
}
if ( a2 == 4 )
{
v4 = (char)*--v3;
if ( v4 > -65 )
return 0;
goto LABEL_8;
}
return v2;
}