//
// jpeg_write_raw_data from 0x8771d8 to 0x877278 (160 bytes)
//
// 0 xrefs:
//
// 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:03 +0000
//
int __fastcall jpeg_write_raw_data(_DWORD *a1, int a2, unsigned int a3)
{
unsigned int v6; // r3
int v7; // r2
int v8; // r3
unsigned int v9; // r5
int result; // r0
if ( a1[5] != 102 )
{
*(_DWORD *)(*a1 + 20) = 21;
*(_DWORD *)(*a1 + 24) = a1[5];
(*(void (__fastcall **)(_DWORD *))*a1)(a1);
}
v6 = a1[66];
if ( v6 >= a1[8] )
{
*(_DWORD *)(*a1 + 20) = 126;
(*(void (__fastcall **)(_DWORD *, int))(*a1 + 4))(a1, -1);
return 0;
}
else
{
v7 = a1[2];
if ( v7 )
{
*(_DWORD *)(v7 + 4) = v6;
*(_DWORD *)(a1[2] + 8) = a1[8];
(*(void (__fastcall **)(_DWORD *))a1[2])(a1);
}
v8 = a1[98];
if ( *(_DWORD *)(v8 + 12) )
(*(void (__fastcall **)(_DWORD *))(v8 + 4))(a1);
v9 = a1[71] * a1[69];
if ( v9 > a3 )
{
*(_DWORD *)(*a1 + 20) = 24;
(*(void (__fastcall **)(_DWORD *))*a1)(a1);
}
result = (*(int (__fastcall **)(_DWORD *, int))(a1[101] + 4))(a1, a2);
if ( result )
{
result = v9;
a1[66] += v9;
}
}
return result;
}