//
// sub_C70538 from 0xc70538 to 0xc706dc (420 bytes)
//
// 5 xrefs:
// > sub_C706DC @ 0xc7093c
// > sub_C70D58 @ 0xc70f70
// > WebPGetInfo @ 0xc71638
// > WebPGetFeaturesInternal @ 0xc71e28
// > WebPDecode @ 0xc72304
//
// 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
//
__int64 __fastcall sub_C70538(
unsigned __int8 **a1,
unsigned __int64 *a2,
unsigned __int64 a3,
unsigned __int8 **a4,
_QWORD *a5)
{
unsigned __int64 v5; // x21
unsigned __int8 *v6; // x24
unsigned int v7; // w22
__int64 i; // x20
bool v11; // cc
int v12; // w0
unsigned __int8 *v13; // x1
unsigned __int64 v14; // x19
v5 = *a2;
v6 = *a1;
*a4 = nullptr;
*a5 = 0;
*a1 = v6;
*a2 = v5;
if ( v5 <= 7 )
return 7;
v7 = 22;
for ( i = v6[4] | (v6[5] << 8) | ((v6[6] | (v6[7] << 8)) << 16);
(unsigned int)i <= 0xFFFFFFF6;
i = v6[4] | (v6[5] << 8) | ((v6[6] | (v6[7] << 8)) << 16) )
{
v14 = ((_DWORD)i + 9) & 0xFFFFFFFE;
v7 += v14;
if ( a3 )
{
if ( a3 < v7 )
break;
}
if ( !memcmp(v6, "VP8 ", 4u) )
return 0;
v11 = v14 > v5;
v5 -= v14;
if ( !memcmp(v6, "VP8L", 4u) )
return 0;
if ( v11 )
return 7;
v12 = memcmp(v6, "ALPH", 4u);
v13 = v6 + 8;
v6 += v14;
if ( !v12 )
{
*a4 = v13;
*a5 = i;
}
*a1 = v6;
*a2 = v5;
if ( v5 <= 7 )
return 7;
}
return 3;
}