//
// sub_1004FAE64 from 0x1004fae64 to 0x1004faf10 (172 bytes)
//
// 3 xrefs:
// > sub_1004F9AE0 @ 0x1004f9b08
// > sub_1004FAE60 @ 0x1004fae60
// > ThreadViewPopup::threadMessagesFailed @ 0x1004fe98c
//
// 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 11:06:50 +0000
//
__int64 __fastcall sub_1004FAE64(__int64 result)
{
__int64 v1; // x19
__int64 v2; // x8
unsigned int v3; // w8
char v4; // w8
if ( !*(_QWORD *)(result + 1040) )
{
v1 = result;
if ( (*(_BYTE *)(result + 790) & 1) == 0 )
{
result = sub_1004FAA54(result, 0, 0);
if ( (_DWORD)result )
{
*(_BYTE *)(v1 + 1168) = 0;
*(_BYTE *)(v1 + 789) = 0;
*(_DWORD *)(v1 + 784) = 0;
*(_OWORD *)(v1 + 1176) = 0u;
v2 = *(_QWORD *)(v1 + 752);
if ( *(_BYTE *)(v2 + 264) == 1 && (v3 = *(_DWORD *)(v2 + 268) - 2, v3 < 6) && ((0x2Du >> v3) & 1) != 0 )
v4 = 1;
else
v4 = *(_BYTE *)(v1 + 790);
sub_1004FB318(v1, v4 & 1);
return sub_1004FA9F4(v1);
}
}
}
return result;
}