//
// png_set_gamma from 0x6593ac to 0x6594a2 (246 bytes)
//
// 0 xrefs:
//
// 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
//
int __fastcall png_set_gamma(int a1, double a2, double a3)
{
double v4; // d7
_BOOL4 v6; // r3
double v7; // d9
double v8; // r0
_BOOL4 v9; // r3
Elf32_Sym *v10; // s16
double v11; // r0
v4 = a2;
v6 = a2 > 0.0;
if ( v4 >= 128.0 )
v6 = 0;
v7 = a3;
if ( v6 )
v4 = v4 * 100000.0;
v8 = floor(v4 + 0.5);
if ( v8 > 2147483650.0 || v8 < -2147483650.0 )
goto LABEL_14;
v9 = a3 > 0.0;
if ( a3 >= 128.0 )
v9 = 0;
v10 = (Elf32_Sym *)(int)v8;
if ( v9 )
v7 = a3 * 100000.0;
v11 = floor(v7 + 0.5);
if ( v11 > 2147483650.0 || v11 < -2147483650.0 )
LABEL_14:
png_fixed_error(a1, (int)"gamma value");
return png_set_gamma_fixed(a1, v10, (char *)(int)v11);
}