//
// ThreadSearchPopup::onSearch from 0x753538 to 0x75379e (614 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:58:53 +0000
//
int __fastcall ThreadSearchPopup::onSearch(ThreadSearchPopup *this, cocos2d::CCObject *a2)
{
int v3; // r2
int v4; // r1
unsigned __int8 *v5; // r2
unsigned __int8 *v6; // r1
unsigned __int8 *v7; // r0
unsigned __int8 *v8; // r7
int v9; // r12
unsigned int v10; // r2
char *v11; // r1
int v12; // r3
char *v13; // r3
int v14; // t1
int v15; // r3
int v16; // r0
unsigned int v17; // r1
char *v18; // r2
cocos2d::CCDirector *v19; // r0
unsigned int v20; // r3
int v21; // r1
char *v22; // r0
char v23; // r0
int v24; // r8
int *v25; // r7
void (__fastcall *v26)(int, cocos2d::CCNode *, int); // r9
int *v27; // r6
cocos2d::CCNode *v28; // r0
GameLevelManager *v29; // r0
cocos2d::CCDirector *v30; // r0
int v31; // r8
void (__fastcall *v32)(int, cocos2d::CCNode *, int); // r9
cocos2d::CCNode *v33; // r0
int v34; // r7
int v36; // [sp+Ch] [bp-50h] BYREF
unsigned int v37; // [sp+10h] [bp-4Ch]
char *v38; // [sp+14h] [bp-48h]
int v39; // [sp+18h] [bp-44h] BYREF
unsigned int v40; // [sp+1Ch] [bp-40h]
char *v41; // [sp+20h] [bp-3Ch]
int v42[3]; // [sp+24h] [bp-38h] BYREF
int v43[3]; // [sp+30h] [bp-2Ch] BYREF
int v44[3]; // [sp+3Ch] [bp-20h] BYREF
int v45[3]; // [sp+48h] [bp-14h] BYREF
v3 = *((_DWORD *)this + 179);
if ( v3 )
{
CCTextInputNode::getString((CCTextInputNode *)&v36, v3);
}
else
{
v36 = 0;
v37 = 0;
v38 = nullptr;
std::string::__init(&v36, &unk_B6B226, 0);
}
if ( (v36 & 1) != 0 )
{
v4 = v37;
v5 = (unsigned __int8 *)v38;
if ( !v37 )
{
v10 = -1;
LABEL_17:
v11 = v38;
v12 = v37;
goto LABEL_18;
}
}
else
{
v4 = (int)(unsigned __int8)v36 >> 1;
if ( !v4 )
{
v10 = -1;
goto LABEL_46;
}
v5 = (unsigned __int8 *)&v36 + 1;
}
v6 = &v5[v4];
v7 = v5;
while ( 1 )
{
v8 = v7;
if ( v7 == v6 )
break;
v9 = *v7++;
if ( v9 != 32 )
{
v10 = v8 - v5;
goto LABEL_14;
}
}
v10 = -1;
LABEL_14:
if ( (v36 & 1) != 0 )
goto LABEL_17;
LABEL_46:
v12 = (int)(unsigned __int8)v36 >> 1;
v11 = (char *)&v36 + 1;
LABEL_18:
v13 = &v11[v12];
while ( v13 != v11 )
{
v14 = (unsigned __int8)*--v13;
if ( v14 != 32 )
{
v15 = v13 - v11;
goto LABEL_23;
}
}
v15 = -1;
LABEL_23:
if ( v10 == -1 )
{
v39 = 0;
v40 = 0;
v41 = nullptr;
std::string::__init(&v39, &unk_B6B226, 0);
}
else
{
std::string::basic_string(&v39, (unsigned __int8 *)&v36, v10, v15 + 1 - v10);
}
if ( (v36 & 1) != 0 )
{
*v38 = 0;
v37 = 0;
}
else
{
LOWORD(v36) = 0;
}
std::string::reserve(&v36, 0);
v16 = v39;
v17 = v40;
v18 = v41;
v39 = 0;
v40 = 0;
v41 = nullptr;
v36 = v16;
v37 = v17;
v38 = v18;
v19 = (cocos2d::CCDirector *)std::string::~string((int)&v39);
v20 = 0;
v21 = 0;
while ( (v36 & 1) != 0 )
{
if ( v20 >= v37 )
goto LABEL_38;
v22 = v38;
LABEL_35:
v23 = v22[v20++];
v19 = (cocos2d::CCDirector *)(v23 & 0xC0);
if ( v19 != (cocos2d::CCDirector *)&dword_80 )
++v21;
}
if ( v20 < (int)(unsigned __int8)v36 >> 1 )
{
v22 = (char *)&v36 + 1;
goto LABEL_35;
}
LABEL_38:
if ( v21 <= 1 )
{
v24 = *(_DWORD *)(cocos2d::CCDirector::sharedDirector(v19) + 220);
v25 = v42;
v26 = *(void (__fastcall **)(int, cocos2d::CCNode *, int))(*(_DWORD *)v24 + 232);
memset(v42, 0, sizeof(v42));
std::string::__init(v42, "Enter at least 2 characters", 0x1Bu);
memset(v43, 0, sizeof(v43));
v27 = v43;
std::string::__init(v43, &unk_B6B226, 0);
v28 = TextAlertPopup::create((int)v42, (cocos2d::CCDelayTime *)0x3F000000, 0.6, 150, (int)v43);
v26(v24, v28, 1000);
goto LABEL_42;
}
v29 = (GameLevelManager *)GameLevelManager::sharedState(v19);
v30 = (cocos2d::CCDirector *)(GameLevelManager::getTimeLeft(v29, "threadSearch", 3.0) - 1);
if ( (unsigned int)v30 > 2 )
{
v34 = *((_DWORD *)this + 178);
(*(void (__fastcall **)(ThreadSearchPopup *, _DWORD))(*(_DWORD *)this + 684))(this, 0);
ThreadViewPopup::startSearch(v34, (unsigned __int8 *)&v36);
}
else
{
v31 = *(_DWORD *)(cocos2d::CCDirector::sharedDirector(v30) + 220);
v25 = v44;
v32 = *(void (__fastcall **)(int, cocos2d::CCNode *, int))(*(_DWORD *)v31 + 232);
memset(v44, 0, sizeof(v44));
std::string::__init(v44, "Please wait", 0xBu);
memset(v45, 0, sizeof(v45));
v27 = v45;
std::string::__init(v45, &unk_B6B226, 0);
v33 = TextAlertPopup::create((int)v44, (cocos2d::CCDelayTime *)0x3F000000, 0.6, 150, (int)v45);
v32(v31, v33, 1000);
LABEL_42:
std::string::~string((int)v27);
std::string::~string((int)v25);
}
return std::string::~string((int)&v36);
}