//
// sub_1004F5774 from 0x1004f5774 to 0x1004f5ac4 (848 bytes)
//
// 1 xrefs:
// > MessageThreadsPage::init @ 0x1004f4cc8
//
// 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:47 +0000
//
void __fastcall sub_1004F5774(__int64 a1)
{
int v2; // w0
int v3; // w20
__int64 v4; // x0
int v5; // w26
signed int v6; // w21
int v7; // w22
int v8; // w23
int v9; // w25
__int64 v10; // x0
const char *v11; // x8
void *v12; // x0
const std::string::value_type *CString; // x0
std::string::size_type size; // x8
const char *v15; // x8
void *v16; // x0
const std::string::value_type *v17; // x0
std::string::size_type v18; // x8
const char *v19; // x8
void *v20; // x0
const std::string::value_type *v21; // x0
std::string::size_type v22; // x8
const char *v23; // x8
void *v24; // x0
const std::string::value_type *v25; // x0
char *v26; // x1
void *v27; // x0
void **v28; // x1
std::string::size_type v29; // x2
std::string *v30; // x1
__int64 *v31; // x19
void *v32[2]; // [xsp+10h] [xbp-A0h] BYREF
char v33; // [xsp+27h] [xbp-89h]
void *__p[2]; // [xsp+28h] [xbp-88h] BYREF
unsigned __int8 v35; // [xsp+3Fh] [xbp-71h]
std::string v36; // [xsp+40h] [xbp-70h] BYREF
std::string v37; // [xsp+58h] [xbp-58h] BYREF
v2 = sub_1004F5EB4(a1);
if ( v2 )
{
v3 = v2;
v4 = *(_QWORD *)(a1 + 800);
if ( v4 )
{
if ( (int)sub_1002E757C(v4) < 1 )
{
memset(&v37, 0, sizeof(v37));
}
else
{
v5 = 0;
v6 = 0;
v7 = 0;
v8 = 0;
v9 = 0;
do
{
v10 = sub_1002E75A0(*(_QWORD *)(a1 + 800), v6);
if ( *(_BYTE *)(v10 + 304) == 1 )
{
if ( *(_BYTE *)(v10 + 264) == 1 )
{
if ( *(_BYTE *)(v10 + 265) == 1 )
++v9;
else
++v5;
}
else if ( *(_DWORD *)(v10 + 268) == 8 )
{
++v7;
}
else
{
++v8;
}
}
++v6;
}
while ( v6 < (int)sub_1002E757C(*(_QWORD *)(a1 + 800)) );
memset(&v37, 0, sizeof(v37));
if ( v5 > 0 )
{
if ( v5 == 1 )
v11 = "";
else
v11 = "s";
v12 = sub_1003065B0(
"%i DM%s will be cleared. Your message history will be permanently deleted.",
v5,
v11);
CString = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v12);
std::string::append(&v37, CString);
}
if ( v9 >= 1 )
{
size = HIBYTE(v37.__r_.__value_.__r.__words[2]);
if ( (v37.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
size = v37.__r_.__value_.__l.__size_;
if ( size )
std::string::append(&v37, "\n");
if ( v9 == 1 )
v15 = "";
else
v15 = "s";
v16 = sub_1003065B0("%i pending request%s will be cancelled.", v9, v15);
v17 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v16);
std::string::append(&v37, v17);
}
if ( v8 >= 1 )
{
v18 = HIBYTE(v37.__r_.__value_.__r.__words[2]);
if ( (v37.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v18 = v37.__r_.__value_.__l.__size_;
if ( v18 )
std::string::append(&v37, "\n");
if ( v8 == 1 )
v19 = "";
else
v19 = "s";
v20 = sub_1003065B0(
"You will leave %i group chat%s. You can only rejoin if you are invited back.",
v8,
v19);
v21 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v20);
std::string::append(&v37, v21);
}
if ( v7 >= 1 )
{
v22 = HIBYTE(v37.__r_.__value_.__r.__words[2]);
if ( (v37.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v22 = v37.__r_.__value_.__l.__size_;
if ( v22 )
std::string::append(&v37, "\n");
if ( v7 == 1 )
v23 = "";
else
v23 = "s";
v24 = sub_1003065B0(
"%i group chat%s you were removed from will disappear from your inbox. You will no longer be able t"
"o read or report them.",
v7,
v23);
v25 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v24);
std::string::append(&v37, v25);
}
}
if ( v3 == 1 )
{
v26 = "Delete this conversation?";
}
else
{
v27 = sub_1003065B0("Delete %i conversations?", v3);
v26 = (char *)cocos2d::CCString::getCString((__int64)v27);
}
sub_100009900(&v36, v26);
std::operator+(__p, "\n", &v37);
if ( (v35 & 0x80u) == 0 )
v28 = __p;
else
v28 = (void **)__p[0];
if ( (v35 & 0x80u) == 0 )
v29 = v35;
else
v29 = (std::string::size_type)__p[1];
std::string::append(&v36, (const std::string::value_type *)v28, v29);
if ( (char)v35 < 0 )
operator delete(__p[0]);
if ( (v36.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v30 = &v36;
else
v30 = (std::string *)v36.__r_.__value_.__r.__words[0];
sub_100009900(v32, (char *)v30);
v31 = (__int64 *)FLAlertLayer::create_1(
a1 + 672,
(__int64)"Delete",
(__int64)v32,
(__int64)"Back",
(__int64)"Delete",
300.0);
if ( v33 < 0 )
operator delete(v32[0]);
ButtonSprite::updateBGImage(v31[77], (__int64)"GJ_button_06.png");
(*(void (__fastcall **)(__int64 *, __int64))(*v31 + 72))(v31, 2);
(*(void (__fastcall **)(__int64 *))(*v31 + 1312))(v31);
if ( SHIBYTE(v36.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v36.__r_.__value_.__l.__data_);
if ( SHIBYTE(v37.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v37.__r_.__value_.__l.__data_);
}
}
}