//
// NewThreadPopup::threadSendFinished from 0x10050c0cc to 0x10050c4f4 (1064 bytes)
//
// 2 xrefs:
// > sub_10050C578 @ 0x10050c57c
// > ??> @ 0x100998a58
//
// 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:07:00 +0000
//
void __fastcall NewThreadPopup::threadSendFinished(__int64 a1, int a2)
{
__int64 v4; // x21
__int64 v5; // x0
int v6; // w22
__int64 v7; // x23
int v8; // w24
int v9; // w25
__int64 v10; // x0
void *v11; // x0
_QWORD *v12; // x0
int v13; // w23
int v14; // w25
void *v15; // x0
const std::string::value_type *CString; // x0
void *v17; // x0
const std::string::value_type *v18; // x0
char *v19; // x0
__int64 v20; // x21
std::string::size_type v21; // x8
_QWORD *v22; // x0
char *v23; // x0
__int64 v24; // x21
int v25; // w8
__int64 v26; // x0
__int64 v27; // x0
__int64 v28; // x0
void *v29; // x0
void **v30; // x8
void *v31; // x1
unsigned __int64 v32; // x2
__int64 v33; // x0
void *v34; // x0
__int128 v35; // [xsp+10h] [xbp-E0h] BYREF
__int64 v36; // [xsp+20h] [xbp-D0h]
void *__p[2]; // [xsp+28h] [xbp-C8h] BYREF
char v38; // [xsp+3Fh] [xbp-B1h]
std::string __dst; // [xsp+40h] [xbp-B0h] BYREF
std::string v40; // [xsp+60h] [xbp-90h] BYREF
void *v41[2]; // [xsp+80h] [xbp-70h] BYREF
char v42; // [xsp+97h] [xbp-59h]
void *v43[2]; // [xsp+98h] [xbp-58h] BYREF
char v44; // [xsp+AFh] [xbp-41h]
if ( *(_BYTE *)(a1 + 736) != 1 )
return;
sub_10050C060(a1, 0);
v4 = *(_QWORD *)(cocos2d::CCDirector::sharedDirector() + 272);
v5 = *(_QWORD *)(a1 + 728);
if ( !v5 )
{
v8 = 0;
v6 = 0;
LABEL_7:
v7 = 0;
goto LABEL_8;
}
v6 = sub_1002E757C(v5);
if ( v6 < 1 )
{
v8 = 0;
goto LABEL_7;
}
v7 = sub_1002E75A0(*(_QWORD *)(a1 + 728), 0);
v8 = 1;
LABEL_8:
v9 = *(unsigned __int8 *)(GameLevelManager::sharedState() + 448);
v10 = GameLevelManager::sharedState();
if ( v9 == 1 )
{
if ( *(_BYTE *)(v10 + 450) == 1 )
{
v11 = sub_100306828();
sub_100306AC0((__int64)v11, "ThreadsChangedNotification", 0);
sub_100009900(v43, "Message request sent");
sub_100009900(v41, "");
v12 = TextAlertPopup::create((__int64)v43, 150, (__int64)v41, 0.5, 0.6);
(*(void (__fastcall **)(__int64, _QWORD *, __int64))(*(_QWORD *)v4 + 464LL))(v4, v12, 1000);
if ( v42 < 0 )
operator delete(v41[0]);
if ( v44 < 0 )
operator delete(v43[0]);
LABEL_55:
sub_10050A1D8((_QWORD *)a1);
return;
}
v19 = sub_1000C5868();
v20 = (__int64)v19;
*((_DWORD *)v19 + 14) = a2;
v19[264] = 1;
*((_DWORD *)v19 + 42) = 2;
if ( v7 )
{
*((_DWORD *)v19 + 15) = *(_DWORD *)(v7 + 376);
if ( (*(char *)(v7 + 343) & 0x80000000) == 0 )
{
*(_OWORD *)&v40.__r_.__value_.__l.__data_ = *(_OWORD *)(v7 + 320);
v21 = *(_QWORD *)(v7 + 336);
LABEL_46:
v40.__r_.__value_.__r.__words[2] = v21;
LABEL_52:
if ( *(char *)(v20 + 87) < 0 )
operator delete(*(void **)(v20 + 64));
*(std::string *)(v20 + 64) = v40;
std::string::operator=((std::string *)(v20 + 88), (const std::string *)(v20 + 64));
v34 = ThreadViewPopup::create(v20);
(*(void (__fastcall **)(void *))(*(_QWORD *)v34 + 1312LL))(v34);
goto LABEL_55;
}
v31 = *(void **)(v7 + 320);
v32 = *(_QWORD *)(v7 + 328);
LABEL_50:
sub_1000097D0(&v40, v31, v32);
goto LABEL_52;
}
*((_DWORD *)v19 + 15) = *(_DWORD *)(a1 + 696);
v30 = (void **)(a1 + 704);
if ( *(char *)(a1 + 727) < 0 )
{
v32 = *(_QWORD *)(a1 + 712);
if ( v32 )
{
v31 = *v30;
goto LABEL_50;
}
}
else if ( *(_BYTE *)(a1 + 727) )
{
*(_OWORD *)&v40.__r_.__value_.__l.__data_ = *(_OWORD *)v30;
v21 = *(_QWORD *)(a1 + 720);
goto LABEL_46;
}
v33 = GameLevelManager::sharedState();
sub_1000A7734(v33, *(_DWORD *)(a1 + 696), (__int64)&v40);
goto LABEL_52;
}
v13 = *(_DWORD *)(v10 + 440);
v14 = *(_DWORD *)(GameLevelManager::sharedState() + 444);
sub_100009900(&v40, "Group chat created");
if ( v13 >= 1 )
{
v15 = sub_1003065B0(" - %i invited", v13);
CString = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v15);
std::string::append(&v40, CString);
}
if ( v14 >= 1 )
{
v17 = sub_1003065B0(" - %i unavailable", v14);
v18 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v17);
std::string::append(&v40, v18);
}
if ( SHIBYTE(v40.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&__dst, v40.__r_.__value_.__l.__data_, v40.__r_.__value_.__l.__size_);
else
__dst = v40;
sub_100009900(__p, "");
v22 = TextAlertPopup::create((__int64)&__dst, 150, (__int64)__p, 0.5, 0.6);
(*(void (__fastcall **)(__int64, _QWORD *, __int64))(*(_QWORD *)v4 + 464LL))(v4, v22, 1000);
if ( v38 < 0 )
operator delete(__p[0]);
if ( SHIBYTE(__dst.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
v23 = sub_1000C5868();
v24 = (__int64)v23;
*((_DWORD *)v23 + 14) = a2;
if ( v8 )
v25 = ((v6 - (v13 + v14)) & ~((v6 - (v13 + v14)) >> 31)) + 1;
else
v25 = 2;
*((_DWORD *)v23 + 42) = v25;
v26 = *(_QWORD *)(a1 + 880);
if ( v26 )
CCTextInputNode::getString(v26, &v35);
else
sub_100009900(&v35, "");
if ( *(char *)(v24 + 111) < 0 )
operator delete(*(void **)(v24 + 88));
*(_OWORD *)(v24 + 88) = v35;
*(_QWORD *)(v24 + 104) = v36;
v27 = GJAccountManager::sharedState();
*(_DWORD *)(v24 + 200) = *(_DWORD *)(v27 + 352) - *(_DWORD *)(v27 + 356);
v28 = *(_QWORD *)(a1 + 888);
if ( v28 )
CCTextInputNode::getString(v28, &v35);
else
sub_100009900(&v35, "");
if ( *(char *)(v24 + 239) < 0 )
operator delete(*(void **)(v24 + 216));
*(_OWORD *)(v24 + 216) = v35;
*(_QWORD *)(v24 + 232) = v36;
std::string::operator=((std::string *)(v24 + 240), (const std::string *)(a1 + 784));
v29 = ThreadViewPopup::create(v24);
(*(void (__fastcall **)(void *))(*(_QWORD *)v29 + 1312LL))(v29);
sub_10050A1D8((_QWORD *)a1);
if ( SHIBYTE(v40.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v40.__r_.__value_.__l.__data_);
}