//
// sub_1004FA6EC from 0x1004fa6ec to 0x1004fa7cc (224 bytes)
//
// 6 xrefs:
// > sub_1005130D4 @ 0x1005131cc
// > sub_1005130D4 @ 0x100513230
// > sub_1005130D4 @ 0x1005132ac
// > sub_1005132F4 @ 0x1005133ec
// > sub_1005132F4 @ 0x100513450
// > sub_1005132F4 @ 0x1005134cc
//
// 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 sub_1004FA6EC(
float a1,
float a2,
float a3,
__int64 a4,
float *a5,
float *a6,
float *a7,
float *a8,
float *a9)
{
float v15; // s1
float v16; // s0
float v17; // s3
float v18; // s4
float v19; // s4
float result; // s0
__float2 v21; // 0:kr00_8.8
v15 = fminf(fmaxf(a2, 10.0), 22000.0);
if ( v15 >= (float)(a1 * 0.49) )
v15 = a1 * 0.49;
v21 = __sincosf_stret((float)(v15 * 6.2832) / a1);
v16 = v21.__sinval / (float)(a3 + a3);
v17 = 1.0 / (float)(v16 + 1.0);
v18 = v17 * (float)-(float)(v21.__cosval + 1.0);
*a6 = v18;
v19 = v18 * -0.5;
*a7 = v19;
*a5 = v19;
*a8 = (float)(v21.__cosval * -2.0) * v17;
result = (float)(1.0 - v16) * v17;
*a9 = result;
return result;
}