//
// tk::spline::deriv from 0x5948c8 to 0x5949d6 (270 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
//
__int64 __fastcall tk::spline::deriv(tk::spline *this, int a2, double a3)
{
int v5; // r5
int v6; // r7
unsigned int v8; // r0
double v9; // d6
double v10; // d7
double *v11; // r3
double v12; // d5
unsigned int v13; // r3
double v14; // d5
double v15; // d7
double v16; // d7
v5 = *((_DWORD *)this + 1);
v6 = *(_DWORD *)this;
v8 = 8 * tk::spline::find_closest((double **)this, a3);
v9 = a3 - *(double *)(*(_DWORD *)this + v8);
if ( a3 < *(double *)*(_DWORD *)this )
{
if ( a2 != 1 )
{
if ( a2 == 2 )
{
v10 = *((double *)this + 8);
LABEL_13:
v16 = v10 + v10;
return *(_QWORD *)&v16;
}
goto LABEL_20;
}
v11 = *((double **)this + 6);
v12 = *((double *)this + 8) + *((double *)this + 8);
LABEL_11:
v15 = *v11;
goto LABEL_12;
}
v13 = ((v5 - v6) & 0xFFFFFFF8) - 8;
if ( a3 > *(double *)(*(_DWORD *)this + v13) )
{
if ( a2 != 1 )
{
if ( a2 == 2 )
{
v10 = *(double *)(v13 + *((_DWORD *)this + 9));
goto LABEL_13;
}
LABEL_20:
v16 = 0.0;
return *(_QWORD *)&v16;
}
v14 = *(double *)(*((_DWORD *)this + 9) + v13);
v11 = (double *)(v13 + *((_DWORD *)this + 6));
v12 = v14 + v14;
goto LABEL_11;
}
switch ( a2 )
{
case 2:
v12 = *(double *)(*((_DWORD *)this + 12) + v8) * 6.0;
v15 = *(double *)(v8 + *((_DWORD *)this + 9)) + *(double *)(v8 + *((_DWORD *)this + 9));
break;
case 3:
v16 = *(double *)(v8 + *((_DWORD *)this + 12)) * 6.0;
return *(_QWORD *)&v16;
case 1:
v12 = *(double *)(*((_DWORD *)this + 9) + v8)
+ *(double *)(*((_DWORD *)this + 9) + v8)
+ *(double *)(*((_DWORD *)this + 12) + v8) * 3.0 * v9;
v15 = *(double *)(v8 + *((_DWORD *)this + 6));
break;
default:
goto LABEL_20;
}
LABEL_12:
v16 = v15 + v12 * v9;
return *(_QWORD *)&v16;
}