//
// _controlfp_s from 0x180141428 to 0x18014148b (99 bytes)
//
// 2 xrefs:
// > __acrt_fltout @ 0x18013e26f
// > ??> @ 0x180203ca4
//
// 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
//
errno_t __cdecl controlfp_s(unsigned int *CurrentState, unsigned int NewValue, unsigned int Mask)
{
unsigned int v3; // r8d
v3 = Mask & 0xFFF7FFFF;
if ( (v3 & NewValue & 0xFCF0FCE0) != 0 )
{
if ( CurrentState )
*CurrentState = j_common_control87(0, 0);
*errno() = 22;
invalid_parameter_noinfo();
return 22;
}
else
{
if ( CurrentState )
*CurrentState = j_common_control87(NewValue, v3);
else
j_common_control87(NewValue, v3);
return 0;
}
}