//
// sub_70E24 from 0x70e24 to 0x70ea4 (128 bytes)
//
// 1 xrefs:
// > sub_70360 @ 0x70360
//
// 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_70E24(_DWORD *a1, int a2, unsigned int a3, unsigned int *a4)
{
int v7; // r4
int v8; // r1
unsigned int i; // r1
unsigned int v10; // r0
unsigned int v12; // [sp+8h] [bp-18h] BYREF
int v13; // [sp+Ch] [bp-14h] BYREF
sub_4C6EA(a3, &v13, *(_DWORD *)(a1[1] + 8), *(_DWORD *)(a1[1] + 4));
v7 = sub_BB750(a1[55], a2, 1, v13, &v12);
if ( (v7 & 0xFFFFFFEF) == 0 )
{
v8 = a1[1];
if ( *(_DWORD *)(v8 + 52 * a1[62] + 4) == 1 )
{
for ( i = 0; ; ++i )
{
v10 = v12;
if ( i >= v12 )
break;
*(_BYTE *)(a2 + i) ^= 0x80u;
}
v8 = a1[1];
}
else
{
v10 = v12;
}
sub_4C6A4(v10, a4, *(_DWORD *)(v8 + 8), *(_DWORD *)(v8 + 4));
}
return v7;
}