//
// sub_90BF60 from 0x90bf60 to 0x90c116 (438 bytes)
//
// 1 xrefs:
// > sub_90F434 @ 0x90f79c
//
// 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:04:22 +0000
//
int __fastcall sub_90BF60(int a1, int *a2)
{
int v4; // r0
int v5; // r6
void *v6; // r8
int v7; // r0
void *v8; // r0
int v10; // r0
void *v11; // r7
int v12; // r3
unsigned int *v13; // r6
int v14; // r2
int v15; // r3
int v16; // r3
int v17; // r3
_BOOL4 v18; // r6
int v19; // r0
if ( !a1 )
return 0;
if ( !a2 )
{
if ( !*(_DWORD *)a1 )
{
*(_DWORD *)(a1 + 4) = 0;
*(_DWORD *)a1 = 2;
*(_DWORD *)(a1 + 8) = "NULL VP8Io parameter in VP8Decode().";
return 0;
}
return 0;
}
if ( !*(_DWORD *)(a1 + 4) && !sub_90B718(a1, a2) )
return 0;
v4 = sub_907C0C((char *)a1, a2);
v5 = v4;
if ( v4 )
{
LABEL_6:
v6 = (void *)(a1 + 12);
LABEL_7:
v7 = WebPGetWorkerInterface(v4);
(*(void (__fastcall **)(int))(v7 + 20))(a1 + 124);
sub_9067D0(*(_DWORD **)(a1 + 2344));
v8 = *(void **)(a1 + 2288);
*(_DWORD *)(a1 + 2344) = 0;
WebPSafeFree(v8);
*(_DWORD *)(a1 + 2288) = 0;
*(_DWORD *)(a1 + 2292) = 0;
memset(v6, 0, 0x1Cu);
*(_DWORD *)(a1 + 4) = 0;
return 0;
}
v10 = sub_907E2C(a1, a2);
v11 = (void *)(a1 + 12);
if ( !v10 )
{
LABEL_9:
v6 = v11;
LABEL_10:
v4 = sub_907DE0(a1, (int)a2);
goto LABEL_7;
}
v12 = *(_DWORD *)(a1 + 308);
*(_DWORD *)(a1 + 2300) = 0;
if ( v12 > 0 )
{
v11 = (void *)(a1 + 12);
v6 = (void *)(a1 + 12);
while ( 1 )
{
v13 = (unsigned int *)(a1 + 28 * (v5 & (*(_DWORD *)(a1 + 312) - 1)) + 316);
if ( !sub_90A144((unsigned int *)(a1 + 12), a1) )
{
if ( *(_DWORD *)a1 )
goto LABEL_9;
*(_DWORD *)a1 = 7;
*(_DWORD *)(a1 + 4) = 0;
*(_DWORD *)(a1 + 8) = "Premature end-of-partition0 encountered.";
goto LABEL_10;
}
if ( *(_DWORD *)(a1 + 288) > *(_DWORD *)(a1 + 2296) )
{
while ( sub_90BBA4((_DWORD *)a1, v13) )
{
v14 = *(_DWORD *)(a1 + 288);
v15 = *(_DWORD *)(a1 + 2296) + 1;
*(_DWORD *)(a1 + 2296) = v15;
if ( v15 >= v14 )
goto LABEL_25;
}
if ( !*(_DWORD *)a1 )
{
*(_DWORD *)a1 = 7;
*(_DWORD *)(a1 + 4) = 0;
*(_DWORD *)(a1 + 8) = "Premature end-of-file encountered.";
goto LABEL_10;
}
goto LABEL_9;
}
LABEL_25:
v16 = *(_DWORD *)(a1 + 2256);
*(_BYTE *)(v16 - 2) = 0;
*(_BYTE *)(v16 - 1) = 0;
*(_BYTE *)(a1 + 2248) = 0;
*(_BYTE *)(a1 + 2249) = 0;
*(_BYTE *)(a1 + 2250) = 0;
*(_BYTE *)(a1 + 2251) = 0;
*(_DWORD *)(a1 + 2296) = 0;
v10 = sub_907B14((_DWORD *)a1, a2);
if ( !v10 )
break;
v17 = *(_DWORD *)(a1 + 308);
v5 = *(_DWORD *)(a1 + 2300) + 1;
*(_DWORD *)(a1 + 2300) = v5;
if ( v5 >= v17 )
goto LABEL_27;
}
if ( *(_DWORD *)a1 )
goto LABEL_9;
*(_DWORD *)a1 = 6;
*(_DWORD *)(a1 + 4) = 0;
*(_DWORD *)(a1 + 8) = "Output aborted.";
goto LABEL_10;
}
LABEL_27:
if ( *(int *)(a1 + 148) > 0 )
{
v19 = WebPGetWorkerInterface(v10);
v18 = (*(int (__fastcall **)(int))(v19 + 8))(a1 + 124) != 0;
}
else
{
v18 = 1;
}
v4 = sub_907DE0(a1, (int)a2);
if ( (v4 & v18) == 0 )
goto LABEL_6;
*(_DWORD *)(a1 + 4) = 0;
return 1;
}