//
// sub_7322C from 0x7322c to 0x732da (174 bytes)
//
// 1 xrefs:
// > sub_73AD8 @ 0x74776
//
// 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_7322C(int a1)
{
int v1; // r1
int v2; // r2
int v3; // r4
int *v4; // r3
int v5; // r5
int v6; // r4
int v7; // r4
int v8; // r2
v1 = *(_DWORD *)(a1 + 4);
switch ( *(_BYTE *)(a1 + 265) )
{
case 0:
case 3:
v2 = *(_DWORD *)(a1 + 240);
v3 = byte_E8024[v2];
goto LABEL_5;
case 1:
v2 = *(_DWORD *)(a1 + 240);
v3 = (128 - v2) >> 1;
LABEL_5:
*(_DWORD *)(v1 + 60) = v3;
v4 = (int *)(v1 + 60);
break;
case 2:
v2 = *(_DWORD *)(a1 + 240);
v4 = (int *)(v1 + 60);
if ( v2 <= 127 )
v3 = 64;
else
v3 = -64;
*v4 = v3;
break;
default:
v2 = *(_DWORD *)(a1 + 240);
v4 = (int *)(v1 + 60);
v3 = *(_DWORD *)(v1 + 60);
break;
}
v5 = (*(unsigned __int8 *)(a1 + 245) * v3) >> 5;
*(_DWORD *)(v1 + 60) = v5;
v6 = *(_DWORD *)(v1 + 48);
if ( v2 < 0 )
{
if ( ((v6 - v5) & 0x8000) != 0 )
{
*v4 = v6;
v5 = v6;
}
v7 = -v5;
}
else
{
if ( v5 + v6 < 65 )
goto LABEL_17;
v7 = 64 - v6;
}
*v4 = v7;
LABEL_17:
v8 = v2 + *(unsigned __int8 *)(a1 + 244);
if ( v8 > 255 )
v8 -= 256;
*(_DWORD *)(a1 + 240) = v8;
*(_BYTE *)(v1 + 36) |= 4u;
return 0;
}