//
// png_push_crc_finish from 0x862580 to 0x862636 (182 bytes)
//
// 1 xrefs:
// > png_process_some_data @ 0x86327e
//
// 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:02:44 +0000
//
void __fastcall png_push_crc_finish(_DWORD *a1)
{
unsigned int v2; // r3
unsigned int v3; // r2
unsigned int v4; // r5
int v5; // r0
unsigned int v6; // r1
unsigned int v7; // r5
unsigned int v8; // r1
int v9; // r3
unsigned int v10; // r0
v2 = a1[171];
if ( !v2 )
{
v3 = a1[174];
LABEL_3:
if ( v3 <= 3 )
{
png_push_save_buffer((int)a1);
}
else
{
png_crc_finish(a1, 0);
a1[176] = 1;
}
return;
}
v4 = a1[172];
if ( v4 )
{
if ( v4 >= v2 )
v4 = a1[171];
png_calculate_crc(a1, a1[166], v4);
v2 = a1[171] - v4;
v5 = a1[166];
v3 = a1[174] - v4;
v6 = a1[172] - v4;
a1[171] = v2;
a1[174] = v3;
a1[172] = v6;
a1[166] = v4 + v5;
if ( !v2 )
goto LABEL_3;
}
v7 = a1[175];
if ( v7 )
{
if ( v7 >= v2 )
v7 = v2;
png_calculate_crc(a1, a1[168], v7);
v8 = a1[171] - v7;
v9 = a1[168];
v3 = a1[174] - v7;
v10 = a1[175] - v7;
a1[171] = v8;
a1[174] = v3;
a1[175] = v10;
a1[168] = v9 + v7;
if ( !v8 )
goto LABEL_3;
}
}