//
// tk::spline::find_closest from 0x6dacf0 to 0x6dad4e (94 bytes)
//
// 2 xrefs:
// > tk::spline::operator @ 0x6dad5e
// > tk::spline::deriv @ 0x6dae12
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:57:10 +0000
//
unsigned int __fastcall tk::spline::find_closest(double **this, double a2)
{
double *v4; // r3
int v5; // r2
double *v6; // r4
double v7; // r0
v4 = *this;
v5 = *(this + 1) - *this;
while ( v5 )
{
v6 = &v4[v5 / 2];
if ( a2 < *v6 )
{
v5 /= 2;
}
else
{
v4 = v6 + 1;
v5 += ~(v5 / 2);
}
}
LODWORD(v7) = fmax();
return (unsigned int)v7;
}