//
// sub_884818 from 0x884818 to 0x8848be (166 bytes)
//
// 3 xrefs:
// > jpeg_start_decompress @ 0x8848ea
// > jpeg_start_decompress @ 0x884952
// > jpeg_start_output @ 0x884aaa
//
// 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:13 +0000
//
int __fastcall sub_884818(int a1)
{
unsigned int v2; // r3
int v3; // r2
unsigned int v4; // r7
int v5; // r2
int result; // r0
int v7; // r3
if ( *(_DWORD *)(a1 + 20) != 204 )
{
(**(void (***)(void))(a1 + 444))();
*(_DWORD *)(a1 + 140) = 0;
*(_DWORD *)(a1 + 20) = 204;
}
if ( *(_DWORD *)(*(_DWORD *)(a1 + 444) + 8) )
{
v2 = *(_DWORD *)(a1 + 140);
do
{
while ( *(_DWORD *)(a1 + 116) <= v2 )
{
(*(void (__fastcall **)(int))(*(_DWORD *)(a1 + 444) + 4))(a1);
(**(void (__fastcall ***)(int))(a1 + 444))(a1);
v5 = *(_DWORD *)(a1 + 444);
*(_DWORD *)(a1 + 140) = 0;
v2 = 0;
if ( !*(_DWORD *)(v5 + 8) )
goto LABEL_10;
}
v3 = *(_DWORD *)(a1 + 8);
v4 = v2;
if ( v3 )
{
*(_DWORD *)(v3 + 4) = v2;
*(_DWORD *)(*(_DWORD *)(a1 + 8) + 8) = *(_DWORD *)(a1 + 116);
(**(void (***)(void))(a1 + 8))();
v4 = *(_DWORD *)(a1 + 140);
}
(*(void (__fastcall **)(int, _DWORD, int, _DWORD))(*(_DWORD *)(a1 + 448) + 4))(a1, 0, a1 + 140, 0);
v2 = *(_DWORD *)(a1 + 140);
}
while ( v2 != v4 );
return 0;
}
else
{
LABEL_10:
result = 1;
if ( *(_DWORD *)(a1 + 68) )
v7 = 206;
else
v7 = 205;
*(_DWORD *)(a1 + 20) = v7;
}
return result;
}