//
// sub_D7CA40 from 0xd7ca40 to 0xd7cabc (124 bytes)
//
// 2 xrefs:
// > cocos2d::CCImage::_initWithPngData @ 0xd7cf08
// > cocos2d::CCImage::_initWithPngData @ 0xd7cf10
//
// 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:08:08 +0000
//
__int64 __fastcall sub_D7CA40(__int64 a1, void *a2, size_t a3)
{
__int64 io_ptr; // x0
int v6; // w3
__int64 v7; // x19
__int64 result; // x0
io_ptr = png_get_io_ptr();
v6 = *(_DWORD *)(io_ptr + 12);
v7 = io_ptr;
if ( v6 + (int)a3 > *(_DWORD *)(io_ptr + 8) )
png_error(a1, "pngReaderCallback failed");
memcpy(a2, (const void *)(*(_QWORD *)io_ptr + v6), a3);
result = *(unsigned int *)(v7 + 12);
*(_DWORD *)(v7 + 12) = result + a3;
return result;
}