//
// sub_1004FA25C from 0x1004fa25c to 0x1004fa8cc (1648 bytes)
//
// 8 xrefs:
// > ThreadViewPopup::init @ 0x1004f8ea0
// > sub_1004FB004 @ 0x1004fb090
// > ThreadViewPopup::threadSendFinished @ 0x1004fd490
// > ThreadViewPopup::threadSendFinished @ 0x1004fd548
// > ThreadViewPopup::threadMessagesFinished @ 0x1004fd898
// > ThreadViewPopup::threadMessagesFinished @ 0x1004fd9e0
// > ThreadViewPopup::threadMessagesFinished @ 0x1004fdafc
// > ThreadOptionsPopup::threadUpdateFinished @ 0x10050de8c
//
// 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_1004FA25C(__int64 result)
{
__int64 v1; // x19
char v2; // w24
__int64 v3; // x0
__int64 v4; // x0
__int64 v5; // x0
__int64 v6; // x0
__int64 v7; // x0
__int64 v8; // x0
__int64 v9; // x0
_QWORD *v10; // x21
__int64 v11; // x8
unsigned int v12; // w8
bool v13; // cc
unsigned int v14; // w8
__int64 v15; // x0
__int64 v16; // x0
__int64 v17; // x20
__int64 v18; // x8
_BOOL4 v19; // w25
char *v20; // x0
const char *v21; // x21
size_t v22; // x2
void *v23; // x22
int v24; // w23
const char *v25; // x1
void *v26; // x0
__int64 v27; // x20
__int64 v28; // x8
const char *CString; // x1
int v30; // w9
void *v31; // x0
const std::string::value_type *v32; // x20
const std::string::value_type *v33; // x1
__int64 v34; // x8
int v35; // w10
const char *v36; // x12
int v37; // w8
const char *v38; // x10
const char *v39; // x11
float v40; // s8
float v41; // s8
__int64 v42; // x20
float v43; // s8
float v44; // s0
void *__p[2]; // [xsp+8h] [xbp-98h] BYREF
char v46; // [xsp+1Fh] [xbp-81h]
void *v47[2]; // [xsp+20h] [xbp-80h] BYREF
char v48; // [xsp+37h] [xbp-69h]
void *__s1[2]; // [xsp+38h] [xbp-68h] BYREF
char v50; // [xsp+4Fh] [xbp-51h]
if ( (*(_BYTE *)(result + 1104) & 1) == 0 )
{
v1 = result;
if ( (*(_BYTE *)(result + 791) & 1) != 0 )
{
LABEL_3:
v2 = 1;
goto LABEL_4;
}
v11 = *(_QWORD *)(result + 752);
if ( (*(_BYTE *)(v11 + 264) & 1) != 0 )
{
if ( (*(_BYTE *)(v11 + 272) & 1) != 0 )
goto LABEL_3;
v12 = *(_DWORD *)(v11 + 268);
v13 = v12 > 7;
v14 = 0xB4u >> v12;
if ( v13 )
v2 = 0;
else
v2 = v14;
}
else
{
if ( *(_DWORD *)(v11 + 268) == 8 )
goto LABEL_3;
v2 = *(_BYTE *)(v11 + 272);
}
LABEL_4:
v3 = *(_QWORD *)(result + 1216);
if ( v3 )
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v3 + 344LL))(v3, (v2 & 1) == 0);
v4 = *(_QWORD *)(v1 + 1224);
if ( v4 )
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v4 + 344LL))(v4, (v2 & 1) == 0);
v5 = *(_QWORD *)(v1 + 1008);
if ( v5 )
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v5 + 344LL))(v5, (v2 & 1) == 0);
v6 = *(_QWORD *)(v1 + 912);
if ( v6 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v6 + 344LL))(v6, ((unsigned __int8)v2 ^ 1) & 1);
v7 = *(_QWORD *)(v1 + 1016);
if ( ((v7 != 0) & (unsigned __int8)v2) == 1 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v7 + 344LL))(v7, 0);
if ( (v2 & 1) != 0 )
{
v8 = *(_QWORD *)(v1 + 920);
if ( v8 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v8 + 1368LL))(v8, 0);
v9 = *(_QWORD *)(v1 + 928);
if ( !v9 )
{
LABEL_27:
v15 = *(_QWORD *)(v1 + 912);
if ( !v15 )
goto LABEL_51;
v16 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v15 + 1072LL))(v15);
v17 = v16;
v18 = *(_QWORD *)(v1 + 752);
v19 = *(_BYTE *)(v18 + 264) == 1 && *(_DWORD *)(v18 + 268) == 1;
v20 = (char *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v16 + 624) + 944LL))(*(_QWORD *)(v16 + 624));
sub_100009900(__s1, v20);
if ( v19 )
v21 = "Req";
else
v21 = "Send";
if ( v19 )
v22 = 3;
else
v22 = 4;
if ( (v50 & 0x8000000000000000LL) != 0 )
{
v23 = __s1[0];
if ( (void *)v22 == __s1[1] )
{
v24 = memcmp(__s1[0], v21, v22);
operator delete(v23);
if ( !v24 )
goto LABEL_51;
}
else
{
operator delete(__s1[0]);
}
}
else if ( v22 == v50 && !memcmp(__s1, v21, v22) )
{
goto LABEL_51;
}
ButtonSprite::setString(v17, v21);
if ( v19 )
v25 = "GJ_button_05.png";
else
v25 = "GJ_button_01.png";
ButtonSprite::updateBGImage(v17, (__int64)v25);
LABEL_51:
if ( !*(_QWORD *)(v1 + 800) )
{
v26 = cocos2d::CCLabelBMFont::create_1("", "goldFont.fnt");
*(_QWORD *)(v1 + 800) = v26;
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v26 + 160LL))(v26, 0.5);
v27 = *(_QWORD *)(v1 + 800);
sub_1000262BC((float *)__s1, *(float *)(v1 + 848), *(float *)(v1 + 1060) + 14.0);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v27 + 184LL))(v27, __s1);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(v1 + 584) + 464LL))(
*(_QWORD *)(v1 + 584),
*(_QWORD *)(v1 + 800),
6);
}
v28 = *(_QWORD *)(v1 + 752);
if ( *(_BYTE *)(v1 + 791) == 1 )
{
if ( *(_BYTE *)(v28 + 272) )
CString = "Locked. Moderator view.";
else
CString = "Moderator view.";
goto LABEL_70;
}
if ( (*(_BYTE *)(v28 + 264) & 1) == 0 && *(_DWORD *)(v28 + 268) == 8 )
{
CString = "You were removed from this group chat.";
goto LABEL_70;
}
if ( (*(_BYTE *)(v28 + 272) & 1) != 0 )
{
CString = "This conversation has been locked.";
goto LABEL_70;
}
v30 = *(_DWORD *)(v28 + 268);
if ( v30 == 5 )
{
v31 = sub_1003065B0("%s has messages turned off.");
}
else
{
if ( v30 != 4 )
{
if ( v30 == 7 )
CString = "You can't message this user.";
else
CString = "Message request pending.";
LABEL_70:
(*(void (__fastcall **)(_QWORD, const char *))(**(_QWORD **)(v1 + 800) + 928LL))(
*(_QWORD *)(v1 + 800),
CString);
cocos2d::CCLabelBMFont::limitLabelWidth(*(_QWORD *)(v1 + 800), *(float *)(v1 + 840) + -40.0, 0.5, 0.3);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v1 + 800) + 344LL))(*(_QWORD *)(v1 + 800), v2 & 1);
if ( !*(_QWORD *)(v1 + 808) )
{
sub_100009900(v47, "");
sub_100009900(__p, "");
*(_QWORD *)(v1 + 808) = InfoAlertButton::create((__int64)v47, (__int64)__p, 0.5);
if ( v46 < 0 )
operator delete(__p[0]);
if ( v48 < 0 )
operator delete(v47[0]);
CCMenuItemSpriteExtra::setSizeMult(*(_QWORD *)(v1 + 808), 1.5);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v1 + 552) + 456LL))(
*(_QWORD *)(v1 + 552),
*(_QWORD *)(v1 + 808));
}
if ( (*(_BYTE *)(v1 + 791) & 1) != 0 )
{
v32 = "You are reading this conversation as a moderator.\n"
"Participants cannot see this and nothing is marked read.";
v33 = "Moderator View";
LABEL_104:
std::string::assign((std::string *)(*(_QWORD *)(v1 + 808) + 504LL), v33);
std::string::assign((std::string *)(*(_QWORD *)(v1 + 808) + 528LL), v32);
v40 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v1 + 800) + 328LL))(*(_QWORD *)(v1 + 800));
v41 = v40 * (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(v1 + 800) + 168LL))(*(_QWORD *)(v1 + 800));
v42 = *(_QWORD *)(v1 + 808);
v43 = (float)((float)(v41 * 0.5)
+ (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(v1 + 800) + 224LL))(*(_QWORD *)(v1 + 800)))
+ 12.0;
v44 = (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(v1 + 800) + 240LL))(*(_QWORD *)(v1 + 800));
sub_1000262BC((float *)__s1, v43, v44);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v42 + 184LL))(v42, __s1);
return (*(__int64 (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v1 + 808) + 344LL))(
*(_QWORD *)(v1 + 808),
v2 & 1);
}
v34 = *(_QWORD *)(v1 + 752);
if ( (*(_BYTE *)(v34 + 264) & 1) != 0 || *(_DWORD *)(v34 + 268) != 8 )
{
if ( (*(_BYTE *)(v34 + 272) & 1) != 0 )
{
v33 = "Conversation Locked";
if ( (*(_BYTE *)(v34 + 264) & 1) != 0 )
goto LABEL_95;
}
else
{
v35 = *(_DWORD *)(v34 + 268);
if ( v35 == 4 )
{
v33 = "Friends Only";
if ( (*(_BYTE *)(v34 + 264) & 1) != 0 )
goto LABEL_95;
}
else
{
v36 = "Request Pending";
if ( v35 == 7 )
v36 = "Blocked";
if ( v35 == 5 )
v33 = "Messages Off";
else
v33 = v36;
if ( (*(_BYTE *)(v34 + 264) & 1) != 0 )
goto LABEL_95;
}
}
}
else
{
v33 = "Removed";
}
if ( *(_DWORD *)(v34 + 268) == 8 )
{
v32 = "The owner removed you from this group chat.\n"
"You can still read messages sent before you were removed.\n"
"You cannot see new messages or send messages.\n"
"You can remove the group chat from the options menu when you are done.";
goto LABEL_104;
}
LABEL_95:
if ( (*(_BYTE *)(v34 + 272) & 1) != 0 )
{
v32 = "A moderator locked this conversation.\nIt can still be read, but no new messages can be sent.";
}
else
{
v37 = *(_DWORD *)(v34 + 268);
v38 = "This user has turned messages off.\nYou can read the conversation but not reply.";
v39 = "Your message was sent as a request.\nYou can write again once they reply.";
if ( v37 == 7 )
v39 = "Messages between you and this user are blocked.";
if ( v37 != 5 )
v38 = v39;
if ( v37 == 4 )
v32 = "This user only accepts messages from friends.\nSend a friend request to message them.";
else
v32 = v38;
}
goto LABEL_104;
}
v31 = sub_1003065B0("%s only accepts messages from friends.");
}
CString = (const char *)cocos2d::CCString::getCString((__int64)v31);
goto LABEL_70;
}
v10 = (_QWORD *)(v1 + 928);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v9 + 1160LL))(v9, 0);
}
else
{
if ( !*(_QWORD *)(v1 + 928) )
goto LABEL_27;
v10 = (_QWORD *)(v1 + 928);
}
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)*v10 + 344LL))(*v10, ((unsigned __int8)v2 ^ 1) & 1);
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)*v10 + 1000LL))(*v10, ((unsigned __int8)v2 ^ 1) & 1);
goto LABEL_27;
}
return result;
}