//
// jinit_arith_decoder from 0x88572c to 0x8857a6 (122 bytes)
//
// 2 xrefs:
// > jinit_master_decompress @ 0x88f9ac
// > jpeg_read_coefficients @ 0x890b48
//
// 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
//
char *__fastcall jinit_arith_decoder(int a1)
{
int v2; // r4
char *result; // r0
int v4; // r2
void *v5; // r3
int v6; // r4
v2 = (**(int (***)(void))(a1 + 4))();
*(_DWORD *)(a1 + 468) = v2;
*(_DWORD *)(v2 + 8) = nullsub_23;
*(_DWORD *)v2 = sub_884B34;
memset((void *)(v2 + 60), 0, 0x40u);
result = (char *)memset((void *)(v2 + 124), 0, 0x40u);
*(_BYTE *)(v2 + 188) = 113;
if ( *(_DWORD *)(a1 + 224) )
{
result = (char *)(**(int (__fastcall ***)(int, int, _DWORD))(a1 + 4))(a1, 1, *(_DWORD *)(a1 + 36) << 8);
v4 = *(_DWORD *)(a1 + 36);
v5 = result;
*(_DWORD *)(a1 + 160) = result;
if ( v4 > 0 )
{
v6 = 0;
do
{
++v6;
result = (char *)memset(v5, 255, 0x100u);
v5 = result + 256;
}
while ( *(_DWORD *)(a1 + 36) > v6 );
}
}
return result;
}