//
// png_calculate_crc from 0x64d290 to 0x64d2c2 (50 bytes)
//
// 36 xrefs:
// > png_push_crc_finish @ 0x652534
// > png_push_crc_finish @ 0x65257a
// > png_push_read_IDAT @ 0x6530c0
// > png_push_read_IDAT @ 0x653112
// > png_crc_read @ 0x65c69c
// > png_read_chunk_header @ 0x65e9d6
// > png_write_chunk_start @ 0x66411e
// > png_write_chunk_data @ 0x66414e
// > png_write_chunk @ 0x6641da
// > png_write_IHDR @ 0x66435e
// > png_write_PLTE @ 0x66450c
// > png_compress_IDAT @ 0x66469a
// > png_compress_IDAT @ 0x6647e6
// > png_write_IEND @ 0x6648fa
// > png_write_gAMA_fixed @ 0x664974
// > png_write_sRGB @ 0x6649ea
// > png_write_iCCP @ 0x664ac8
// > png_write_sPLT @ 0x664be2
// > png_write_sBIT @ 0x664d76
// > png_write_cHRM_fixed @ 0x664e66
// > png_write_tRNS @ 0x664f2a
// > png_write_tRNS @ 0x664f8a
// > png_write_tRNS @ 0x665010
// > png_write_bKGD @ 0x6650c0
// > png_write_bKGD @ 0x66513e
// > png_write_bKGD @ 0x6651c0
// > png_write_hIST @ 0x66527c
// > png_write_tEXt @ 0x665340
// > png_write_zTXt @ 0x665454
// > png_write_iTXt @ 0x665614
// > png_write_iTXt @ 0x665716
// > png_write_oFFs @ 0x665840
// > png_write_pCAL @ 0x665928
// > png_write_sCAL_s @ 0x665acc
// > png_write_pHYs @ 0x665b70
// > png_write_tIME @ 0x665c1e
//
// 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
//
_DWORD *__fastcall png_calculate_crc(_DWORD *result, int a2, int a3)
{
_DWORD *v3; // r4
if ( (result[119] & 0x20000000) != 0 )
{
if ( (result[78] & 0x300) == 0x300 )
return result;
}
else if ( (result[78] & 0x800) != 0 )
{
return result;
}
if ( a3 )
{
v3 = result;
result = (_DWORD *)crc32(result[128], a2, a3);
v3[128] = result;
}
return result;
}