//
// uv_decode from 0x6da18c to 0x6da2fc (368 bytes)
//
// 3 xrefs:
// > LogLuv24toXYZ @ 0x6da3c8
// > sub_6DA6D4 @ 0x6da770
// > ??> @ 0x5850c
//
// 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 uv_decode(double *a1, double *a2, unsigned int a3)
{
int v4; // r5
int v6; // [sp+10h] [bp-14h]
int v7; // [sp+14h] [bp-10h]
if ( a3 > 0x3FA0 )
return -1;
v7 = 0;
v6 = 163;
while ( v6 - v7 > 1 )
{
v4 = a3 - *((__int16 *)&unk_ABD124 + 4 * ((v7 + v6) >> 1) + 3);
if ( v4 <= 0 )
{
if ( v4 >= 0 )
{
v7 = (v7 + v6) >> 1;
break;
}
v6 = (v7 + v6) >> 1;
}
else
{
v7 = (v7 + v6) >> 1;
}
}
*a1 = *((float *)&unk_ABD124 + 2 * v7)
+ ((double)(int)(a3 - *((__int16 *)&unk_ABD124 + 4 * v7 + 3)) + 0.5) * 0.00350000011;
*a2 = ((double)v7 + 0.5) * 0.00350000011 + 0.0169399995;
return 0;
}