//
// png_read_image from 0x8670fc to 0x86717e (130 bytes)
//
// 2 xrefs:
// > cocos2d::CCImage::_initWithPngData @ 0x7eba28
// > png_read_png @ 0x86772e
//
// 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:48 +0000
//
int __fastcall png_read_image(int result, void **a2)
{
int v2; // r7
int v4; // r9
int v5; // r6
int i; // r8
void **v7; // r5
int v8; // r4
void *v9; // t1
if ( result )
{
v2 = result;
if ( (*(_DWORD *)(result + 312) & 0x40) != 0 )
{
if ( *(_BYTE *)(result + 532) && (*(_DWORD *)(result + 316) & 2) == 0 )
{
png_warning(result, "Interlace handling should be turned on when using png_read_image");
*(_DWORD *)(v2 + 456) = *(_DWORD *)(v2 + 452);
}
result = png_set_interlace_handling(v2);
v4 = result;
}
else
{
v4 = png_set_interlace_handling(result);
result = png_start_read_image(v2);
}
v5 = *(_DWORD *)(v2 + 452);
if ( v4 > 0 )
{
for ( i = 0; i != v4; ++i )
{
v7 = a2;
v8 = 0;
if ( v5 )
{
do
{
++v8;
v9 = *v7++;
result = png_read_row(v2, v9, nullptr);
}
while ( v8 != v5 );
}
}
}
}
return result;
}