//
// sub_8EB520 from 0x8eb520 to 0x8eb668 (328 bytes)
//
// 1 xrefs:
// > sub_8EB668 @ 0x8eb754
//
// 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 12:04:11 +0000
//
int __fastcall sub_8EB520(unsigned __int16 *a1)
{
int v1; // r3
int v2; // r3
int v4; // [sp+Ch] [bp-8h]
v1 = (8 * a1[22]) | a1[23];
if ( v1 == 132 )
goto LABEL_17;
if ( v1 > 132 )
{
if ( v1 == 259 )
{
v4 = 0;
goto LABEL_20;
}
if ( v1 > 259 )
{
if ( v1 != 260 )
goto LABEL_19;
}
else if ( v1 < 257 )
{
goto LABEL_19;
}
v4 = 2;
goto LABEL_20;
}
if ( v1 == 68 )
goto LABEL_18;
if ( v1 <= 68 )
{
if ( v1 != 65 )
goto LABEL_19;
LABEL_18:
v4 = 3;
goto LABEL_20;
}
if ( (unsigned int)(v1 - 129) <= 1 )
{
LABEL_17:
v4 = 1;
goto LABEL_20;
}
LABEL_19:
v4 = -1;
LABEL_20:
v2 = a1[29];
if ( v2 == 1 )
{
if ( v4 != 2 )
return -1;
}
else if ( v2 == 3 )
{
if ( v4 == 2 )
return -1;
}
else
{
return -1;
}
return v4;
}