//
// _clearfp from 0x180142120 to 0x18014218e (110 bytes)
//
// 2 xrefs:
// > feholdexcept @ 0x180141534
// > ??> @ 0x180203d1c
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 10:55:05 +0000
//
unsigned int __cdecl clearfp()
{
char fpsr; // bl
unsigned int v1; // r9d
int v2; // r8d
int v3; // ecx
int v4; // edx
fpsr = get_fpsr();
fclrf();
v1 = 0;
if ( (fpsr & 0x3F) != 0 )
{
v2 = (16 * (fpsr & 1)) | 8;
if ( (fpsr & 4) == 0 )
v2 = 16 * (fpsr & 1);
v3 = v2 | 4;
if ( (fpsr & 8) == 0 )
v3 = v2;
v4 = v3 | 2;
if ( (fpsr & 0x10) == 0 )
v4 = v3;
v1 = v4 | 1;
if ( (fpsr & 0x20) == 0 )
v1 = v4;
if ( (fpsr & 2) != 0 )
v1 |= 0x80000u;
}
return v1;
}