//
// png_set_write_fn from 0xe5c4e4 to 0xe5c530 (76 bytes)
//
// 3 xrefs:
// > cocos2d::CCImage::_saveImageToPNG @ 0xd7d8cc
// > png_create_write_struct_2 @ 0xe5d6fc
// > ??> @ 0xa9510
//
// 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
//
_QWORD *__fastcall png_set_write_fn(
_QWORD *result,
__int64 a2,
size_t (__fastcall *a3)(size_t result, void *ptr, size_t a3),
__int64 (__fastcall *a4)(__int64 result))
{
__int64 v4; // x1
if ( result )
{
result[40] = a2;
if ( !a3 )
a3 = png_default_write_data;
result[38] = a3;
if ( !a4 )
a4 = png_default_flush;
v4 = result[39];
result[91] = a4;
if ( v4 )
{
result[39] = 0;
return (_QWORD *)png_warning(
(__int64)result,
"Can't set both read_data_fn and write_data_fn in the same structure");
}
}
return result;
}