//
// png_gamma_16bit_correct from 0xe40630 to 0xe4069c (108 bytes)
//
// 15 xrefs:
// > png_gamma_correct @ 0xe406d0
// > png_build_gamma_table @ 0xe40a1c
// > sub_E46918 @ 0xe469c8
// > sub_E46918 @ 0xe469e0
// > sub_E46918 @ 0xe469f8
// > sub_E46ED8 @ 0xe46f4c
// > sub_E46ED8 @ 0xe470d4
// > sub_E47254 @ 0xe47308
// > sub_E47254 @ 0xe47320
// > sub_E47254 @ 0xe47338
// > sub_E47DAC @ 0xe48eac
// > sub_E47DAC @ 0xe48ebc
// > sub_E47DAC @ 0xe48ecc
// > sub_E47DAC @ 0xe492ac
// > ??> @ 0xa38e8
//
// 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:02 +0000
//
__int64 __fastcall png_gamma_16bit_correct(__int64 result, int a2)
{
if ( (unsigned int)(result - 1) <= 0xFFFD )
return (unsigned __int16)vcvtmd_u64_f64(pow((double)(int)result / 65535.0, (double)a2 * 0.00001) * 65535.0 + 0.5);
else
return (unsigned __int16)result;
}