//
// png_write_image from 0x8721cc to 0x87220e (66 bytes)
//
// 3 xrefs:
// > cocos2d::CCImage::_saveImageToPNG @ 0x7ebf6c
// > cocos2d::CCImage::_saveImageToPNG @ 0x7ebf9c
// > png_write_png @ 0x8732da
//
// 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:59 +0000
//
int __fastcall png_write_image(int result, int a2)
{
int v2; // r6
int v4; // r9
unsigned int v5; // r3
int v6; // r7
int v7; // r5
unsigned int i; // r4
void *v9; // t1
if ( result )
{
v2 = result;
result = png_set_interlace_handling(result);
v4 = result;
if ( result > 0 )
{
v5 = *(_DWORD *)(v2 + 452);
v6 = 0;
do
{
if ( v5 )
{
v7 = a2 - 4;
for ( i = 0; i < v5; ++i )
{
v9 = *(void **)(v7 + 4);
v7 += 4;
result = png_write_row(v2, v9);
v5 = *(_DWORD *)(v2 + 452);
}
}
++v6;
}
while ( v6 != v4 );
}
}
return result;
}