//
// InvitesPopup::threadUpdateFinished from 0x1400f98c0 to 0x1400f9bd0 (784 bytes)
//
// 2 xrefs:
// > ??> @ 0x14072af80
// > ??> @ 0x1409153ec
//
// This function is hookable on this platform (idp: pc, 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:26:39 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall InvitesPopup::threadUpdateFinished(__int64 a1, int a2, __int64 a3, double a4)
{
char v6; // cl
__int64 v7; // rdx
__int64 v8; // rsi
cocos2d::CCArray *v9; // rcx
unsigned int v10; // ebx
struct cocos2d::CCObject *v11; // rax
cocos2d::CCArray *v12; // rcx
int v13; // ebp
signed int i; // r14d
__int64 v15; // rdx
__int64 v16; // r8
int v17; // ebx
__int64 v18; // rax
__int64 *v19; // rdi
__int64 *v20; // rsi
char v21; // cl
const char *v22; // rdx
size_t v23; // r8
__int64 v24; // rbx
__int64 v25; // rdx
__int64 v26; // r8
__int64 v27; // rax
__int64 v28; // rax
cocos2d::CCObject *v29; // rax
signed int v30; // ebx
cocos2d::CCArray *v31; // rax
struct cocos2d::CCObject *v32; // rax
__int64 v33; // rcx
int v34; // eax
__int128 v35; // [rsp+30h] [rbp-68h] BYREF
__int64 v36; // [rsp+40h] [rbp-58h]
__int64 v37; // [rsp+48h] [rbp-50h]
__int128 v38; // [rsp+50h] [rbp-48h] BYREF
__int64 v39; // [rsp+60h] [rbp-38h]
__int64 v40; // [rsp+68h] [rbp-30h]
void *v41; // [rsp+A0h] [rbp+8h]
void *v42; // [rsp+A0h] [rbp+8h]
if ( a2 == *(_DWORD *)(a1 + 32) )
{
v6 = *(_BYTE *)(a1 + 36);
v7 = 9 - (unsigned int)(v6 != 0);
if ( (_DWORD)a3 == (_DWORD)v7 )
{
*(_DWORD *)(a1 + 32) = 0;
*(_BYTE *)(a1 + 36) = 0;
if ( v6 )
{
v8 = a1 - 776;
v9 = *(cocos2d::CCArray **)(a1 - 776 + 792);
if ( v9 )
{
v10 = 0;
if ( (int)cocos2d::CCArray::count(v9) > 0 )
{
while ( 1 )
{
v11 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(v8 + 792), v10);
v12 = *(cocos2d::CCArray **)(v8 + 792);
if ( *((_DWORD *)v11 + 14) == a2 )
break;
if ( (int)++v10 >= (int)cocos2d::CCArray::count(v12) )
goto LABEL_10;
}
cocos2d::CCArray::removeObjectAtIndex(v12, v10, 1);
}
LABEL_10:
v13 = 0;
for ( i = 0; i < (int)cocos2d::CCArray::count(*(cocos2d::CCArray **)(v8 + 792)); ++i )
{
v17 = v13++;
if ( *((_BYTE *)cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(v8 + 792), i) + 329) )
v13 = v17;
}
v18 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v41 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v41);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v18 = *(_QWORD *)&qword_14090BFB0;
}
*(_DWORD *)(v18 + 548) = v13;
InvitesPopup::buildRows(a1 - 776, v15, v16, a4);
}
v19 = (__int64 *)(a1 + 24);
if ( *v19 )
{
v20 = *(__int64 **)(cocos2d::CCDirector::sharedDirector(v9) + 272);
v21 = *(_BYTE *)(*v19 + 320);
v35 = 0;
v36 = 0;
v37 = 15;
LOBYTE(v35) = 0;
v22 = "Joined group chat";
if ( v21 )
v22 = "Request accepted";
v38 = 0;
v39 = 0;
v40 = 0;
v23 = -1;
do
++v23;
while ( v22[v23] );
sub_14003D230(&v38, v22, v23);
v24 = *v20;
v27 = TextAlertPopup::create(&v38, v25, v26, 150, &v35);
(*(void (__fastcall **)(__int64 *, __int64, __int64))(v24 + 456))(v20, v27, 1000);
v28 = *v19;
if ( *(_BYTE *)(*v19 + 320) )
{
*(_BYTE *)(v28 + 321) = 0;
*(_DWORD *)(*v19 + 324) = 0;
}
else
{
++*(_DWORD *)(v28 + 200);
}
v29 = ThreadViewPopup::create(*v19);
(*(void (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v29 + 1064LL))(v29);
}
}
else
{
v30 = 0;
v31 = *(cocos2d::CCArray **)(a1 + 16);
if ( v31 )
{
while ( v30 < (int)cocos2d::CCArray::count(v31) )
{
v32 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 16), v30);
if ( *((_DWORD *)v32 + 14) == a2 )
{
*((_BYTE *)v32 + 329) = 1;
break;
}
++v30;
v31 = *(cocos2d::CCArray **)(a1 + 16);
if ( !v31 )
break;
}
}
v33 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v42 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v42);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v33 = *(_QWORD *)&qword_14090BFB0;
}
v34 = *(_DWORD *)(v33 + 548);
if ( v34 > 0 )
*(_DWORD *)(v33 + 548) = v34 - 1;
InvitesPopup::buildRows(a1 - 776, v7, a3, a4);
v19 = (__int64 *)(a1 + 24);
}
if ( *v19 )
{
cocos2d::CCObject::release((cocos2d::CCObject *)*v19);
*v19 = 0;
}
}
}
}