//
// sub_1004FA610 from 0x1004fa610 to 0x1004fa6ec (220 bytes)
//
// 8 xrefs:
// > sub_1005130D4 @ 0x100513140
// > sub_1005130D4 @ 0x1005131a0
// > sub_1005130D4 @ 0x100513204
// > sub_1005130D4 @ 0x100513280
// > sub_1005132F4 @ 0x100513360
// > sub_1005132F4 @ 0x1005133c0
// > sub_1005132F4 @ 0x100513424
// > sub_1005132F4 @ 0x1005134a0
//
// 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_1004FA610(
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 = (float)(1.0 - v21.__cosval) * v17;
*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;
}