//
// png_write_image from 0xbe7920 to 0xbe79a0 (128 bytes)
//
// 4 xrefs:
// > cocos2d::CCImage::_saveImageToPNG @ 0xb0ca74
// > cocos2d::CCImage::_saveImageToPNG @ 0xb0ce1c
// > png_write_png @ 0xbe8f10
// > ??> @ 0x44178
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__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;
}