//
// sub_7C818 from 0x7c818 to 0x7c8a0 (136 bytes)
//
// 1 xrefs:
// > sub_7BA6C @ 0x7bdc2
//
// 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_7C818(int a1, int a2, int a3, _DWORD *a4)
{
int v7; // r3
int v8; // r2
int v9; // r4
int result; // r0
int v11; // r2
int v12; // r1
int i; // r0
v7 = 13;
v8 = 21;
if ( *(unsigned __int8 *)(a2 + 3) < 0xC0u )
{
v7 = 21;
v8 = 36;
}
if ( (*(_BYTE *)(a2 + 1) & 8) == 0 )
v8 = v7;
v9 = a2 + v8;
if ( sub_BE2BC(a2 + v8, "Xing", 4) )
return 19;
v11 = *(unsigned __int8 *)(v9 + 7);
if ( v11 << 31 )
{
v12 = v9 + 12;
if ( a4 )
{
*a4 = bswap32(*(_DWORD *)(v9 + 8));
*(_BYTE *)(a1 + 404) = 1;
}
}
else
{
v12 = v9 + 8;
}
result = 0;
if ( a3 && (v11 & 4) != 0 )
{
if ( (v11 & 2) != 0 )
v12 += 4;
for ( i = 0; i != 100; ++i )
*(_BYTE *)(a3 + i) = *(_BYTE *)(v12 + i);
*(_BYTE *)(a1 + 405) = 1;
return 0;
}
return result;
}