//
// sub_1062120 from 0x1062120 to 0x1062238 (280 bytes)
//
// 1 xrefs:
// > ??> @ 0x15524a8
//
// 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 13:16:51 +0000
//
__int64 __fastcall sub_1062120(__int64 a1)
{
int v1; // w0
bool v2; // zf
__int64 result; // x0
_DWORD *v4; // x0
CRYPTO_THREAD_write_lock(*(pthread_rwlock_t **)(a1 + 40));
dword_1568514 = 1;
qword_15680B0 = (__int64)fopen("/dev/tty", "r");
if ( qword_15680B0 )
{
qword_15680B8 = (__int64)fopen("/dev/tty", "w");
if ( qword_15680B8 )
goto LABEL_3;
}
else
{
qword_15680B0 = (__int64)&_sF;
qword_15680B8 = (__int64)fopen("/dev/tty", "w");
if ( qword_15680B8 )
goto LABEL_3;
}
qword_15680B8 = (__int64)&_sF + 304;
LABEL_3:
v1 = fileno((FILE *)qword_15680B0);
v2 = tcgetattr(v1, (struct termios *)&qword_15684F0) == -1;
result = 1;
if ( v2 )
{
v4 = (_DWORD *)__errno();
if ( *v4 == 25 || *v4 == 22 )
{
dword_1568514 = 0;
return 1;
}
else
{
return 0;
}
}
return result;
}