//
// Slerp2D from 0x5a6d9c to 0x5a6eac (272 bytes)
//
// 4 xrefs:
// > PlayerObject::updateShipRotation @ 0x6257f4
// > PlayerObject::updateRotation @ 0x625ab0
// > PlayerObject::updateRotation @ 0x625af4
// > ??> @ 0x5c8e0
//
// 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
//
float __fastcall Slerp2D(float a1, float a2, float a3)
{
float v3; // s11
float v4; // s8
float v6; // s10
float v7; // s11
float v8; // s12
float v9; // s9
float v10; // s0
float v11; // s8
float v12; // s8
float v13; // s0
double v14; // d0
float v16; // s14
float v17; // s13
v3 = a1 * 0.5;
v4 = a2 * 0.5;
v6 = cosf(a1 * 0.5);
v7 = sinf(v3);
v8 = cosf(v4);
v9 = sinf(v4);
v10 = (float)(v7 * v9) + (float)(v6 * v8);
if ( v10 < 0.0 )
{
v10 = -v10;
v11 = 1.0;
v9 = -v9;
v8 = -v8;
if ( (float)(1.0 - v10) <= 0.0001 )
goto LABEL_3;
LABEL_6:
v16 = acosf(v10);
v17 = sinf(v16);
v12 = sinf(v16 * (float)(v11 - a3)) / v17;
v13 = sinf(a3 * v16) / v17;
goto LABEL_4;
}
v11 = 1.0;
if ( (float)(1.0 - v10) > 0.0001 )
goto LABEL_6;
LABEL_3:
v12 = v11 - a3;
v13 = a3;
LABEL_4:
v14 = atan2((float)((float)(v13 * v9) + (float)(v7 * v12)), (float)((float)(v13 * v8) + (float)(v6 * v12)));
return v14 + v14;
}