//
// png_write_image from 0xe5dae0 to 0xe5db60 (128 bytes)
//
// 4 xrefs:
// > cocos2d::CCImage::_saveImageToPNG @ 0xd7d9d8
// > cocos2d::CCImage::_saveImageToPNG @ 0xd7dd70
// > png_write_png @ 0xe5f0d0
// > ??> @ 0x61018
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:10:21 +0000
//
__int64 __fastcall png_write_image(__int64 result, void **a2)
{
__int64 v2; // x21
int v4; // w24
int v5; // w22
void **v6; // x20
unsigned int i; // w19
void *v8; // t1
v2 = result;
if ( result )
{
result = png_set_interlace_handling(result);
v4 = result;
if ( (int)result > 0 )
{
result = *(unsigned int *)(v2 + 564);
v5 = 0;
do
{
v6 = a2;
for ( i = 0; (unsigned int)result > i; result = *(unsigned int *)(v2 + 564) )
{
v8 = *v6++;
++i;
png_write_row(v2, v8);
}
++v5;
}
while ( v5 != v4 );
}
}
return result;
}