//
// MessageThreadsPage::threadListFinished from 0x1004f6ea0 to 0x1004f73a4 (1284 bytes)
//
// 2 xrefs:
// > sub_1004F7818 @ 0x1004f781c
// > ??> @ 0x100994ff8
//
// 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:48 +0000
//
void __fastcall MessageThreadsPage::threadListFinished(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5)
{
__int64 v5; // x19
int v6; // w1
char v7; // w2
__int64 v12; // x25
__int64 v13; // x0
int v14; // w23
__int64 v15; // x0
int v16; // w26
int v17; // w0
unsigned int v18; // w28
__int64 v19; // x27
__int64 v20; // x0
__int64 v21; // x26
int v22; // w8
size_t v23; // x2
__int64 v24; // x10
int v25; // w9
const void *v26; // x0
const void *v27; // x1
int v28; // w8
size_t v29; // x2
__int64 v30; // x10
int v31; // w9
const void *v32; // x0
const void *v33; // x1
int v34; // w8
size_t v35; // x2
__int64 v36; // x10
int v37; // w9
const void *v38; // x0
const void *v39; // x1
int v40; // w8
size_t v41; // x2
__int64 v42; // x10
int v43; // w9
const void *v44; // x0
const void *v45; // x1
unsigned int i; // w24
const std::string *v47; // x25
std::string *v48; // x0
__int64 v49; // x0
__int64 v50; // x22
void *v51; // x0
__int64 CString; // x0
__int64 v53; // [xsp+20h] [xbp-60h]
int v54; // [xsp+2Ch] [xbp-54h]
v5 = a1;
if ( *(_BYTE *)(a1 + 928) == 1 )
{
*(_BYTE *)(a1 + 928) = 0;
v6 = *(_DWORD *)(a1 + 840);
v7 = 0;
LABEL_3:
sub_1004F5C34(a1, v6, v7);
return;
}
v12 = *(unsigned __int8 *)(a1 + 929);
*(_BYTE *)(a1 + 929) = 0;
v13 = GameLevelManager::sharedState();
sub_1004F5BD0((unsigned int *)v5, (float)*(int *)(v13 + 480));
if ( a2 )
{
v14 = sub_1002E757C(a2);
if ( !(_DWORD)v12 )
goto LABEL_96;
}
else
{
v14 = 0;
if ( !(_DWORD)v12 )
{
LABEL_96:
sub_1004F73A4(v5, a2, a3, a4, a5, v12);
return;
}
}
if ( !*(_QWORD *)(v5 + 688) || v14 < 1 )
goto LABEL_96;
v15 = *(_QWORD *)(v5 + 800);
v53 = v15;
if ( v15 )
{
v16 = sub_1002E757C(v15);
if ( a2 )
{
LABEL_12:
v17 = sub_1002E757C(a2);
goto LABEL_15;
}
}
else
{
v16 = 0;
if ( a2 )
goto LABEL_12;
}
v17 = 0;
LABEL_15:
v54 = v16;
if ( v16 != v17 )
goto LABEL_96;
if ( v16 >= 1 )
{
v18 = 0;
do
{
v19 = sub_1002E75A0(v53, v18);
v20 = sub_1002E75A0(a2, v18);
if ( *(_DWORD *)(v19 + 56) != *(_DWORD *)(v20 + 56) )
goto LABEL_96;
v21 = v20;
if ( *(_DWORD *)(v19 + 112) != *(_DWORD *)(v20 + 112)
|| *(_DWORD *)(v19 + 116) != *(_DWORD *)(v20 + 116)
|| *(_DWORD *)(v19 + 168) != *(_DWORD *)(v20 + 168)
|| *(unsigned __int8 *)(v19 + 204) != *(unsigned __int8 *)(v20 + 204)
|| *(unsigned __int8 *)(v19 + 265) != *(unsigned __int8 *)(v20 + 265)
|| *(_DWORD *)(v19 + 268) != *(_DWORD *)(v20 + 268)
|| *(unsigned __int8 *)(v19 + 274) != *(unsigned __int8 *)(v20 + 274)
|| *(unsigned __int8 *)(v19 + 264) != *(unsigned __int8 *)(v20 + 264)
|| *(_DWORD *)(v19 + 200) != *(_DWORD *)(v20 + 200)
|| *(_DWORD *)(v19 + 208) != *(_DWORD *)(v20 + 208) )
{
goto LABEL_96;
}
v22 = *(char *)(v19 + 111);
if ( v22 >= 0 )
v23 = *(unsigned __int8 *)(v19 + 111);
else
v23 = *(_QWORD *)(v19 + 96);
v24 = *(unsigned __int8 *)(v20 + 111);
v25 = (char)v24;
if ( (v24 & 0x80u) != 0LL )
v24 = *(_QWORD *)(v20 + 96);
if ( v23 != v24 )
goto LABEL_96;
v26 = v22 >= 0 ? (const void *)(v19 + 88) : *(const void **)(v19 + 88);
v27 = v25 >= 0 ? (const void *)(v21 + 88) : *(const void **)(v21 + 88);
if ( memcmp(v26, v27, v23) )
goto LABEL_96;
v28 = *(char *)(v19 + 87);
if ( v28 >= 0 )
v29 = *(unsigned __int8 *)(v19 + 87);
else
v29 = *(_QWORD *)(v19 + 72);
v30 = *(unsigned __int8 *)(v21 + 87);
v31 = (char)v30;
if ( (v30 & 0x80u) != 0LL )
v30 = *(_QWORD *)(v21 + 72);
if ( v29 != v30 )
goto LABEL_96;
v32 = v28 >= 0 ? (const void *)(v19 + 64) : *(const void **)(v19 + 64);
v33 = v31 >= 0 ? (const void *)(v21 + 64) : *(const void **)(v21 + 64);
if ( memcmp(v32, v33, v29) )
goto LABEL_96;
v34 = *(char *)(v19 + 239);
if ( v34 >= 0 )
v35 = *(unsigned __int8 *)(v19 + 239);
else
v35 = *(_QWORD *)(v19 + 224);
v36 = *(unsigned __int8 *)(v21 + 239);
v37 = (char)v36;
if ( (v36 & 0x80u) != 0LL )
v36 = *(_QWORD *)(v21 + 224);
if ( v35 != v36 )
goto LABEL_96;
v38 = v34 >= 0 ? (const void *)(v19 + 216) : *(const void **)(v19 + 216);
v39 = v37 >= 0 ? (const void *)(v21 + 216) : *(const void **)(v21 + 216);
if ( memcmp(v38, v39, v35) )
goto LABEL_96;
v40 = *(char *)(v19 + 263);
if ( v40 >= 0 )
v41 = *(unsigned __int8 *)(v19 + 263);
else
v41 = *(_QWORD *)(v19 + 248);
v42 = *(unsigned __int8 *)(v21 + 263);
v43 = (char)v42;
if ( (v42 & 0x80u) != 0LL )
v42 = *(_QWORD *)(v21 + 248);
if ( v41 != v42 )
goto LABEL_96;
v44 = v40 >= 0 ? (const void *)(v19 + 240) : *(const void **)(v19 + 240);
v45 = v43 >= 0 ? (const void *)(v21 + 240) : *(const void **)(v21 + 240);
if ( memcmp(v44, v45, v41)
|| *(_DWORD *)(v19 + 308) != *(_DWORD *)(v21 + 308)
|| *(_DWORD *)(v19 + 312) != *(_DWORD *)(v21 + 312)
|| *(_DWORD *)(v19 + 316) != *(_DWORD *)(v21 + 316)
|| *(_DWORD *)(v19 + 320) != *(_DWORD *)(v21 + 320)
|| *(_DWORD *)(v19 + 324) != *(_DWORD *)(v21 + 324)
|| *(_DWORD *)(v19 + 328) != *(_DWORD *)(v21 + 328) )
{
goto LABEL_96;
}
}
while ( v54 != ++v18 );
}
*(_DWORD *)(v5 + 844) = a3;
if ( (int)a5 >= 1 )
*(_DWORD *)(v5 + 832) = (int)a4 / (int)a5;
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(v5 + 712) + 344LL))(*(_QWORD *)(v5 + 712), (int)a4 > 0);
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(v5 + 720) + 344LL))(
*(_QWORD *)(v5 + 720),
v14 + (int)a4 < (int)a3);
for ( i = 0; i != v14; ++i )
{
v47 = (const std::string *)sub_1002E75A0(a2, i);
v48 = (std::string *)sub_1002E75A0(*(_QWORD *)(v5 + 800), i);
std::string::operator=(v48 + 6, v47 + 6);
}
v49 = *(_QWORD *)(v5 + 936);
if ( v49 )
CustomListView::reloadAll(v49);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v5 + 704) + 344LL))(*(_QWORD *)(v5 + 704), 0);
v50 = *(_QWORD *)(v5 + 792);
v51 = sub_1003065B0("%i to %i of %i", (int)a4 + 1, v14 + (int)a4, a3);
CString = cocos2d::CCString::getCString((__int64)v51);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v50 + 928LL))(v50, CString);
sub_1004F5F28(v5);
if ( *(_BYTE *)(v5 + 930) == 1 )
{
*(_BYTE *)(v5 + 930) = 0;
v6 = *(_DWORD *)(v5 + 832);
v7 = *(_QWORD *)(v5 + 688) != 0;
a1 = v5;
goto LABEL_3;
}
}