//
// sub_61878 from 0x61878 to 0x618d4 (92 bytes)
//
// 4 xrefs:
// > sub_618D4 @ 0x61994
// > sub_618D4 @ 0x61ad0
// > sub_61AF0 @ 0x61b30
// > sub_61BE8 @ 0x61c1c
//
// 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
//
__int64 __fastcall sub_61878(int a1, char a2)
{
int v4; // w0
unsigned int v5; // w19
__int64 v6; // x2
v4 = fcntl(a1, 3);
v5 = 43;
if ( v4 != -1 )
{
if ( (a2 & 1) != 0 )
v6 = v4 | 0x800u;
else
v6 = v4 & 0xFFFFF7FF;
if ( fcntl(a1, 4, v6) == -1 )
return 43;
else
return 0;
}
return v5;
}