//
// tk::spline::deriv from 0xbb2d2c to 0xbb2eb4 (392 bytes)
//
// 1 xrefs:
// > ??> @ 0xff478
//
// 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:02:56 +0000
//
double __fastcall tk::spline::deriv(tk::spline *this, int a2, double a3)
{
__int64 v5; // x21
__int64 v6; // x20
unsigned __int64 closest; // x0
double v8; // d0
__int64 v10; // x20
v5 = *(_QWORD *)this;
v6 = *((_QWORD *)this + 1);
closest = tk::spline::find_closest(this, a3);
v8 = a3 - *(double *)(*(_QWORD *)this + 8 * closest);
if ( a3 >= **(double **)this )
{
v10 = ((v6 - v5) >> 3) - 1;
if ( a3 <= *(double *)(*(_QWORD *)this + 8 * v10) )
{
switch ( a2 )
{
case 2:
return *(double *)(*((_QWORD *)this + 9) + 8 * closest)
+ *(double *)(*((_QWORD *)this + 9) + 8 * closest)
+ *(double *)(*((_QWORD *)this + 12) + 8 * closest) * 6.0 * v8;
case 3:
return *(double *)(*((_QWORD *)this + 12) + 8 * closest) * 6.0;
case 1:
return *(double *)(*((_QWORD *)this + 6) + 8 * closest)
+ (*(double *)(*((_QWORD *)this + 9) + 8 * closest)
+ *(double *)(*((_QWORD *)this + 9) + 8 * closest)
+ *(double *)(*((_QWORD *)this + 12) + 8 * closest) * 3.0 * v8)
* v8;
default:
return 0.0;
}
}
else if ( a2 == 1 )
{
return *(double *)(*((_QWORD *)this + 6) + 8 * v10)
+ (*(double *)(*((_QWORD *)this + 9) + 8 * v10) + *(double *)(*((_QWORD *)this + 9) + 8 * v10)) * v8;
}
else
{
if ( a2 != 2 )
return 0.0;
return *(double *)(*((_QWORD *)this + 9) + 8 * v10) + *(double *)(*((_QWORD *)this + 9) + 8 * v10);
}
}
else if ( a2 == 1 )
{
return **((double **)this + 6) + (*((double *)this + 15) + *((double *)this + 15)) * v8;
}
else
{
if ( a2 != 2 )
return 0.0;
return *((double *)this + 15) + *((double *)this + 15);
}
}