//
// __nesf2 from 0xdc350 to 0xdc3b4 (100 bytes)
//
// 6 xrefs:
// > j___nesf2 @ 0xe34a8
// > ??> @ 0x271c
// > ??> @ 0x4a3c
// > ??> @ 0x509c
// > j___nesf2 @ 0xe34a8
// > ??> @ 0xe7294
//
// 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
//
// Alternative name is '__cmpsf2'
// Alternative name is '__eqsf2'
int __fastcall _nesf2(int result, int a2)
{
int v2; // r2
unsigned int v3; // r3
bool v4; // zf
bool v5; // cf
bool v6; // zf
bool v7; // nf
bool v8; // cc
v2 = 2 * result;
v3 = 2 * a2;
v4 = (2 * result) >> 24 == -1;
if ( (2 * result) >> 24 != -1 )
v4 = (int)v3 >> 24 == -1;
if ( v4 && (v2 >> 24 == -1 && result << 9 || (int)v3 >> 24 == -1 && a2 << 9) )
return 1;
v5 = 0;
v6 = (v2 | (v3 >> 1)) == 0;
v8 = 0;
v7 = ((v2 | (v3 >> 1)) & 0x80000000) != 0;
if ( v2 | (v3 >> 1) )
{
v6 = result == a2;
v8 = 0;
v7 = (result ^ a2) < 0;
}
if ( !v7 )
{
v5 = v2 >= v3;
result = v2 - v3;
v6 = v2 == v3;
v8 = v2 > v3;
}
if ( v8 )
result = a2 >> 31;
if ( !v5 )
result = ~(a2 >> 31);
if ( !v6 )
return result | 1;
return result;
}