//
// ThreadViewPopup::threadSearchFinished from 0x1004fb690 to 0x1004fbc14 (1412 bytes)
//
// 2 xrefs:
// > sub_1004FBC88 @ 0x1004fbc8c
// > ??> @ 0x100995890
//
// 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 ThreadViewPopup::threadSearchFinished(__int64 result, int a2, __int64 a3, char a4)
{
__int64 v6; // x19
__int64 v7; // x0
int v8; // w22
__int64 v9; // x25
_QWORD *v10; // x0
__int64 v11; // x0
__int64 v12; // x0
__int64 v13; // x0
__int64 v14; // x0
__int64 v15; // x0
__int64 v16; // x0
__int64 v17; // x0
__int64 v18; // x0
void *v19; // x24
__int64 v20; // x0
void *v21; // x0
void *v22; // x0
__int64 v23; // x23
__int64 v24; // x0
__int64 v25; // x0
__int64 v26; // x0
__int64 v27; // x0
_QWORD *v28; // x23
unsigned int i; // w24
__int64 v30; // x0
__int64 v31; // x8
signed int v32; // w21
signed int v33; // w21
__int64 v34; // x22
unsigned int j; // w23
__int64 v36; // x24
int v37; // w20
__int64 v38; // x8
__int64 v39; // x21
const char *v40; // x8
const char *v41; // x10
const char *v42; // x9
void *v43; // x0
__int64 CString; // x0
if ( *(_DWORD *)(*(_QWORD *)(result + 752) + 56LL) != a2 )
return result;
v6 = result;
if ( (*(char *)(result + 1135) & 0x8000000000000000LL) != 0 )
{
if ( !*(_QWORD *)(result + 1120) )
return result;
}
else if ( !*(_BYTE *)(result + 1135) )
{
return result;
}
v7 = *(_QWORD *)(result + 832);
if ( v7 )
LoadingCircle::fadeAndRemove(v7);
if ( a3 )
v8 = sub_1002E757C(a3);
else
v8 = 0;
v9 = *(_QWORD *)(GameLevelManager::sharedState() + 536);
if ( (*(_BYTE *)(v6 + 1104) & 1) == 0 )
{
*(_BYTE *)(v6 + 1104) = 1;
*(_QWORD *)(v6 + 1136) = *(_QWORD *)(v6 + 760);
*(_OWORD *)(v6 + 1144) = *(_OWORD *)(v6 + 768);
*(_BYTE *)(v6 + 1160) = *(_BYTE *)(v6 + 788);
*(_DWORD *)(v6 + 1164) = *(_DWORD *)(*(_QWORD *)(v6 + 824) + 436LL);
v10 = sub_1002E736C();
*(_QWORD *)(v6 + 760) = v10;
cocos2d::CCObject::retain((__int64)v10);
sub_1004FACFC((unsigned int *)v6, 0.0);
v11 = *(_QWORD *)(v6 + 1024);
if ( v11 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v11 + 344LL))(v11, 0);
cocos2d::CCNode::unschedule((unsigned int *)v6, (unsigned __int64)sub_1004FE8CC, 0);
v12 = *(_QWORD *)(v6 + 920);
if ( v12 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v12 + 1368LL))(v12, 0);
v13 = *(_QWORD *)(v6 + 928);
if ( v13 )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v13 + 1160LL))(v13, 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v6 + 928) + 344LL))(*(_QWORD *)(v6 + 928), 0);
}
v14 = *(_QWORD *)(v6 + 1016);
if ( v14 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v14 + 344LL))(v14, 0);
v15 = *(_QWORD *)(v6 + 1216);
if ( v15 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v15 + 344LL))(v15, 0);
v16 = *(_QWORD *)(v6 + 1224);
if ( v16 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v16 + 344LL))(v16, 0);
v17 = *(_QWORD *)(v6 + 912);
if ( v17 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v17 + 344LL))(v17, 0);
sub_1004FB318(v6, 1);
v18 = *(_QWORD *)(v6 + 1200);
if ( !v18 )
{
v19 = cocos2d::CCLabelBMFont::create_1("", "bigFont.fnt");
*(_QWORD *)(v6 + 1200) = v19;
v20 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v6 + 1008) + 192LL))(*(_QWORD *)(v6 + 1008));
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v19 + 184LL))(v19, v20);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(v6 + 584) + 464LL))(
*(_QWORD *)(v6 + 584),
*(_QWORD *)(v6 + 1200),
6);
v21 = ButtonSprite::create_1(
(__int64)"Clear",
45,
0,
1,
(__int64)"bigFont.fnt",
(__int64)"GJ_button_04.png",
0.55,
28.0);
v22 = CCMenuItemSpriteExtra::create((__int64)v21, 0, v6, (__int64)sub_1004FAFFC, 0);
*(_QWORD *)(v6 + 1208) = v22;
CCMenuItemSpriteExtra::setSizeMult((__int64)v22, 1.1);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v6 + 552) + 456LL))(
*(_QWORD *)(v6 + 552),
*(_QWORD *)(v6 + 1208));
v23 = *(_QWORD *)(v6 + 1208);
v24 = *(_QWORD *)(v6 + 912);
if ( !v24 )
v24 = *(_QWORD *)(v6 + 1008);
v25 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v24 + 192LL))(v24);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v23 + 184LL))(v23, v25);
v18 = *(_QWORD *)(v6 + 1200);
}
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v18 + 344LL))(v18, 1);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(v6 + 1208) + 344LL))(*(_QWORD *)(v6 + 1208), 1);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(v6 + 1208) + 1056LL))(*(_QWORD *)(v6 + 1208), 1);
v26 = *(_QWORD *)(v6 + 800);
if ( v26 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v26 + 344LL))(v26, 0);
v27 = *(_QWORD *)(v6 + 808);
if ( v27 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v27 + 344LL))(v27, 0);
if ( v9 <= 0 )
goto LABEL_50;
LABEL_37:
v28 = sub_1002E736C();
if ( v8 >= 1 )
{
for ( i = 0; i != v8; ++i )
{
v30 = sub_1002E75A0(a3, i);
v31 = *(_QWORD *)(v6 + 768);
if ( !v31 || *(_QWORD *)(v30 + 56) < v31 )
sub_1002E74E0((__int64)v28);
}
}
if ( (int)sub_1002E757C(*(_QWORD *)(v6 + 760)) >= 1 )
{
v32 = 0;
do
{
sub_1002E75A0(*(_QWORD *)(v6 + 760), v32);
sub_1002E74E0((__int64)v28);
++v32;
}
while ( v32 < (int)sub_1002E757C(*(_QWORD *)(v6 + 760)) );
}
sub_1002E7674(*(_QWORD *)(v6 + 760));
if ( (int)sub_1002E757C((__int64)v28) >= 1 )
{
v33 = 0;
do
{
v34 = *(_QWORD *)(v6 + 760);
sub_1002E75A0((__int64)v28, v33);
sub_1002E74E0(v34);
++v33;
}
while ( v33 < (int)sub_1002E757C((__int64)v28) );
}
goto LABEL_53;
}
if ( v9 > 0 )
goto LABEL_37;
sub_1002E7674(*(_QWORD *)(v6 + 760));
LABEL_50:
if ( v8 >= 1 )
{
for ( j = 0; j != v8; ++j )
{
v36 = *(_QWORD *)(v6 + 760);
sub_1002E75A0(a3, j);
sub_1002E74E0(v36);
}
}
LABEL_53:
*(_BYTE *)(v6 + 788) = a4;
v37 = sub_1002E757C(*(_QWORD *)(v6 + 760));
if ( v37 < 1 )
{
v38 = 0;
*(_QWORD *)(v6 + 768) = 0;
}
else
{
*(_QWORD *)(v6 + 768) = *(_QWORD *)(sub_1002E75A0(*(_QWORD *)(v6 + 760), 0) + 56);
v38 = *(_QWORD *)(sub_1002E75A0(*(_QWORD *)(v6 + 760), v37 - 1) + 56);
}
*(_QWORD *)(v6 + 776) = v38;
v39 = *(_QWORD *)(v6 + 1200);
if ( v39 )
{
v40 = (const char *)(v6 + 1112);
v41 = "";
if ( *(_BYTE *)(v6 + 788) )
v42 = "+";
else
v42 = "";
if ( v37 != 1 )
v41 = "s";
if ( *(char *)(v6 + 1135) < 0 )
v40 = *(const char **)v40;
v43 = sub_1003065B0("%i%s result%s for \"%s\"", v37, v42, v41, v40);
CString = cocos2d::CCString::getCString((__int64)v43);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v39 + 928LL))(v39, CString);
cocos2d::CCLabelBMFont::limitLabelWidth(*(_QWORD *)(v6 + 1200), *(float *)(v6 + 1064) + -8.0, 0.4, 0.2);
}
result = sub_1004FB470(v6, v9 < 1);
if ( !v37 )
{
result = *(_QWORD *)(v6 + 856);
if ( result )
return (*(__int64 (__fastcall **)(__int64, const char *))(*(_QWORD *)result + 928LL))(result, "No results");
}
return result;
}