//
// uv_decode from 0xc56d78 to 0xc56e4c (212 bytes)
//
// 3 xrefs:
// > sub_C56E60 @ 0xc56f00
// > LogLuv24toXYZ @ 0xc56f84
// > ??> @ 0x3f870
//
// 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
//
__int64 __fastcall uv_decode(double *a1, double *a2, unsigned int a3)
{
int v3; // w6
int v4; // w5
int v5; // w3
float *v6; // x7
int v7; // w4
int v8; // w2
double v9; // d2
unsigned int v10; // w2
if ( a3 > 0x3FA0 )
{
return (unsigned int)-1;
}
else
{
v3 = 0;
v4 = 163;
do
{
v5 = (v3 + v4) >> 1;
v6 = &flt_F4F4F0[2 * v5];
if ( v4 - v3 <= 1 )
{
LABEL_6:
v4 = v3;
v8 = a3 - SHIWORD(flt_F4F4F0[2 * v3 + 1]);
goto LABEL_7;
}
while ( (int)(a3 - *((__int16 *)v6 + 3)) > 0 )
{
v3 = v5;
v7 = v4 - v5;
v5 = (v5 + v4) >> 1;
v6 = &flt_F4F4F0[2 * v5];
if ( v7 <= 1 )
goto LABEL_6;
}
v4 = v5;
}
while ( a3 != *((__int16 *)v6 + 3) );
v8 = 0;
LABEL_7:
v9 = (double)v8;
v10 = 0;
*a1 = flt_F4F4F0[2 * v4] + (v9 + 0.5) * 0.00350000011;
*a2 = ((double)v4 + 0.5) * 0.00350000011 + 0.0169399995;
}
return v10;
}