//
// sub_180080300 from 0x180080300 to 0x18008036c (108 bytes)
//
// 2 xrefs:
// > cocos2d::CCImage::_initWithPngData @ 0x18007e8a2
// > ??> @ 0x1801bf19c
//
// This function is hookable on this platform (idp: pc, 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 11:22:02 +0000
//
void *__fastcall sub_180080300(__int64 a1, void *a2, size_t a3)
{
__int64 io_ptr; // rbx
__int64 v7; // rax
void *result; // rax
io_ptr = png_get_io_ptr();
v7 = *(int *)(io_ptr + 12);
if ( (int)v7 + (int)a3 > *(_DWORD *)(io_ptr + 8) )
{
png_error(a1, "pngReaderCallback failed");
JUMPOUT(0x18008036BLL);
}
result = memcpy(a2, (const void *)(*(_QWORD *)io_ptr + v7), a3);
*(_DWORD *)(io_ptr + 12) += a3;
return result;
}