//
// sub_F50158 from 0xf50158 to 0xf501f8 (160 bytes)
//
// 0 xrefs:
//
// 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:13:17 +0000
//
__int64 __fastcall sub_F50158(__int64 result)
{
__int64 v1; // x19
__int64 v2; // x8
__int64 v3; // x0
__int64 v4; // x0
v1 = result;
v2 = *(_QWORD *)(result + 8) + *(_QWORD *)(**(_QWORD **)(result + 8) - 24LL);
if ( *(_QWORD *)(v2 + 40) )
{
if ( !*(_DWORD *)(v2 + 32) && (*(_BYTE *)(v2 + 9) & 0x20) != 0 )
{
result = std::uncaught_exception();
if ( (result & 1) == 0 )
{
v3 = *(_QWORD *)(*(_QWORD *)(v1 + 8) + *(_QWORD *)(**(_QWORD **)(v1 + 8) - 24LL) + 40LL);
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 48LL))(v3);
if ( (_DWORD)result == -1 )
{
v4 = *(_QWORD *)(v1 + 8) + *(_QWORD *)(**(_QWORD **)(v1 + 8) - 24LL);
return std::ios_base::clear(v4, *(_DWORD *)(v4 + 32) | 1u);
}
}
}
}
return result;
}