//
// sub_6DB960 from 0x6db960 to 0x6dbaa8 (328 bytes)
//
// 1 xrefs:
// > sub_6DBAA8 @ 0x6dbb94
//
// 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
//
int __fastcall sub_6DB960(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;
}