//
// png_read_finish_row from 0x86f41c to 0x86f4c6 (170 bytes)
//
// 2 xrefs:
// > png_read_row @ 0x865be4
// > png_read_row @ 0x865d12
//
// 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:56 +0000
//
unsigned int __fastcall png_read_finish_row(unsigned int result)
{
unsigned int v1; // r2
unsigned int v2; // r3
unsigned int v3; // r4
int v4; // r2
unsigned int v5; // r5
int v6; // r3
unsigned int v7; // r8
bool v8; // zf
unsigned __int8 *v9; // r7
v1 = *(_DWORD *)(result + 456);
v2 = *(_DWORD *)(result + 472) + 1;
*(_DWORD *)(result + 472) = v2;
if ( v2 >= v1 )
{
v3 = result;
if ( *(_BYTE *)(result + 532) )
{
v4 = *(_DWORD *)(result + 464);
*(_DWORD *)(result + 472) = 0;
memset(*(void **)(result + 480), 0, v4 + 1);
LOBYTE(v5) = *(_BYTE *)(v3 + 533);
do
{
v5 = (unsigned __int8)(v5 + 1);
v9 = (unsigned __int8 *)dword_C215CC + v5;
if ( v5 > 6 )
{
*(_BYTE *)(v3 + 533) = v5;
return (unsigned int)png_read_finish_IDAT((_DWORD *)v3);
}
result = (*(_DWORD *)(v3 + 448) - 1 + v9[244] - (unsigned int)v9[252]) / v9[244];
v6 = *(_DWORD *)(v3 + 316) << 30;
v7 = result;
*(_DWORD *)(v3 + 468) = result;
if ( v6 < 0 )
break;
result = (*(_DWORD *)(v3 + 452) - 1 + v9[260] - (unsigned int)v9[268]) / v9[260];
v8 = v7 == 0;
if ( v7 )
v8 = result == 0;
*(_DWORD *)(v3 + 456) = result;
}
while ( v8 );
*(_BYTE *)(v3 + 533) = v5;
}
else
{
return (unsigned int)png_read_finish_IDAT((_DWORD *)v3);
}
}
return result;
}