//
// sub_50A6C from 0x50a6c to 0x50aa2 (54 bytes)
//
// 4 xrefs:
// > sub_50AA4 @ 0x50b2a
// > sub_50AA4 @ 0x50bf0
// > sub_50C14 @ 0x50c38
// > sub_50CA4 @ 0x50cc2
//
// 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
//
int __fastcall sub_50A6C(int a1, int a2)
{
int v4; // r0
unsigned int v5; // r2
bool v6; // zf
int result; // r0
v4 = fcntl(a1, 3);
if ( v4 == -1 )
return 43;
v5 = v4 & 0xFFFFF7FF;
if ( a2 )
v5 = v4 | 0x800;
v6 = fcntl(a1, 4, v5) == -1;
result = 0;
if ( v6 )
return 43;
return result;
}