//
// sub_88C728 from 0x88c728 to 0x88c89e (374 bytes)
//
// 2 xrefs:
// > sub_88E344 @ 0x88e466
// > sub_88E530 @ 0x88e85e
//
// 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:03:18 +0000
//
int __fastcall sub_88C728(unsigned __int8 *a1, _BYTE *a2, unsigned int a3, int a4)
{
int v4; // r3
unsigned __int8 *v6; // r4
int v7; // r2
int v8; // r5
int result; // r0
int v10; // r2
int v11; // r2
bool v12; // zf
int v13; // r2
_DWORD *v14; // r2
int v15; // r3
int v16; // r1
__int16 v17; // r2
int v18; // [sp+4h] [bp-8h]
int v19; // [sp+4h] [bp-8h]
v4 = a4 + a3;
v6 = a1;
if ( a3 <= 0xD )
{
if ( a3 <= 5 || *a2 != 74 || a2[1] != 70 )
goto LABEL_3;
v10 = (unsigned __int8)a2[2];
LABEL_12:
if ( v10 == 88 && a2[3] == 88 && !a2[4] )
{
v11 = (unsigned __int8)a2[5];
if ( v11 == 17 )
{
v7 = *(_DWORD *)a1;
v8 = 111;
}
else if ( v11 == 19 )
{
v7 = *(_DWORD *)a1;
v8 = 112;
}
else
{
v12 = v11 == 16;
v7 = *(_DWORD *)a1;
if ( !v12 )
{
*(_DWORD *)(v7 + 20) = 91;
*(_DWORD *)(*(_DWORD *)a1 + 24) = (unsigned __int8)a2[5];
*(_DWORD *)(*(_DWORD *)a1 + 28) = v4;
return (*(int (__fastcall **)(unsigned __int8 *, int))(*(_DWORD *)v6 + 4))(a1, 1);
}
v8 = 110;
}
LABEL_4:
*(_DWORD *)(v7 + 20) = v8;
a1 = v6;
*(_DWORD *)(*(_DWORD *)v6 + 24) = v4;
return (*(int (__fastcall **)(unsigned __int8 *, int))(*(_DWORD *)v6 + 4))(a1, 1);
}
LABEL_3:
v7 = *(_DWORD *)a1;
v8 = 79;
goto LABEL_4;
}
if ( *a2 != 74 || a2[1] != 70 )
goto LABEL_3;
v10 = (unsigned __int8)a2[2];
if ( v10 != 73 )
goto LABEL_12;
if ( a2[3] != 70 || a2[4] )
goto LABEL_3;
*((_DWORD *)a1 + 71) = 1;
v13 = (unsigned __int8)a2[5];
a1[288] = v13;
a1[289] = a2[6];
a1[290] = a2[7];
*((_WORD *)a1 + 146) = (unsigned __int8)a2[9] + ((unsigned __int8)a2[8] << 8);
*((_WORD *)a1 + 147) = (unsigned __int8)a2[11] + ((unsigned __int8)a2[10] << 8);
if ( (unsigned int)(v13 - 1) > 1 )
{
v18 = v4;
*(_DWORD *)(*(_DWORD *)a1 + 20) = 122;
*(_DWORD *)(*(_DWORD *)a1 + 24) = a1[288];
*(_DWORD *)(*(_DWORD *)a1 + 28) = a1[289];
(*(void (__fastcall **)(unsigned __int8 *, int))(*(_DWORD *)a1 + 4))(a1, -1);
v4 = v18;
}
v14 = *(_DWORD **)v6;
v19 = v4;
v14[6] = v6[288];
v14[7] = v6[289];
v14[8] = *((unsigned __int16 *)v6 + 146);
v14[9] = *((unsigned __int16 *)v6 + 147);
v14[10] = v6[290];
*(_DWORD *)(*(_DWORD *)v6 + 20) = 89;
result = (*(int (__fastcall **)(unsigned __int8 *, int))(*(_DWORD *)v6 + 4))(v6, 1);
v15 = v19;
v16 = (unsigned __int8)a2[13] | (unsigned __int8)a2[12];
if ( v16 )
{
*(_DWORD *)(*(_DWORD *)v6 + 20) = 92;
*(_DWORD *)(*(_DWORD *)v6 + 24) = (unsigned __int8)a2[12];
*(_DWORD *)(*(_DWORD *)v6 + 28) = (unsigned __int8)a2[13];
result = (*(int (__fastcall **)(unsigned __int8 *, int))(*(_DWORD *)v6 + 4))(v6, 1);
LOWORD(v16) = (unsigned __int8)a2[12];
v17 = (unsigned __int8)a2[13];
v15 = v19;
}
else
{
v17 = 0;
}
v4 = v15 - 14;
if ( 3 * (__int16)v16 * v17 != v4 )
{
v7 = *(_DWORD *)v6;
v8 = 90;
goto LABEL_4;
}
return result;
}