//
// 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 (idp: arm, 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 12:13:53 +0000
//
__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;
}