//
// MusicSearchResult::getFilesMatchingSearch from 0x56f8f8 to 0x56fbe8 (752 bytes)
//
// 3 xrefs:
// > SFXSearchResult::updateObjects @ 0x571452
// > SFXSearchResult::updateObjects @ 0x5716ee
// > MusicSearchResult::updateObjects @ 0x5753d2
//
// 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:52:36 +0000
//
cocos2d::CCArray *__fastcall MusicSearchResult::getFilesMatchingSearch(cocos2d::CCArray *a1, int a2, int a3)
{
int v6; // r11
cocos2d::CCArray *v7; // r10
int v8; // r6
unsigned __int8 *v9; // r3
char *v10; // r3
unsigned __int8 *v11; // r2
int v12; // r0
int v13; // r4
unsigned __int8 *v14; // r3
char *v15; // r4
int v16; // t1
_DWORD *v18; // r3
int *v19; // r7
int v20; // r5
int v21; // t1
int v22; // r6
unsigned __int8 *v23; // r12
unsigned int v24; // r6
unsigned __int8 *v25; // r3
unsigned int v26; // r2
unsigned __int8 *v27; // r6
int v28; // r6
unsigned __int8 *v29; // r12
unsigned int v30; // r6
unsigned __int8 *v31; // r3
unsigned int v32; // r2
unsigned __int8 *v33; // r6
int v34; // r6
unsigned __int8 *v35; // r12
unsigned int v36; // r6
unsigned __int8 *v37; // r3
unsigned int v38; // r2
unsigned __int8 *v39; // r6
unsigned __int8 *v40; // r12
unsigned int v41; // r6
unsigned __int8 *v42; // r3
unsigned int v43; // r2
unsigned __int8 *v44; // r6
_BOOL4 v45; // r6
int v46; // [sp+14h] [bp-38h]
int *v47; // [sp+18h] [bp-34h]
unsigned __int8 *v48; // [sp+1Ch] [bp-30h]
unsigned __int8 *v49; // [sp+1Ch] [bp-30h]
unsigned __int8 *v50; // [sp+1Ch] [bp-30h]
unsigned __int8 *v51; // [sp+1Ch] [bp-30h]
unsigned __int8 *v52[2]; // [sp+24h] [bp-28h] BYREF
int v53; // [sp+2Ch] [bp-20h] BYREF
unsigned int v54; // [sp+30h] [bp-1Ch]
unsigned __int8 *v55; // [sp+34h] [bp-18h]
unsigned __int8 v56; // [sp+38h] [bp-14h] BYREF
char v57; // [sp+39h] [bp-13h] BYREF
unsigned int v58; // [sp+3Ch] [bp-10h]
unsigned __int8 *v59; // [sp+40h] [bp-Ch]
v6 = 0;
v7 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
std::string::basic_string(&v53, a3);
if ( (v53 & 1) != 0 )
v8 = v54;
else
v8 = (int)(unsigned __int8)v53 >> 1;
while ( v6 != v8 )
{
if ( (v53 & 1) != 0 )
v9 = v55;
else
v9 = (unsigned __int8 *)&v53 + 1;
v10 = (char *)&v9[v6];
if ( (v53 & 1) != 0 )
v11 = v55;
else
v11 = (unsigned __int8 *)&v53 + 1;
v12 = v11[v6++];
*v10 = tolower(v12);
}
v46 = *((_DWORD *)a1 + 19);
if ( (v53 & 1) != 0 )
{
v13 = v54;
if ( !v54 )
goto LABEL_22;
v14 = v55;
}
else
{
v13 = (int)(unsigned __int8)v53 >> 1;
if ( !v13 )
goto LABEL_22;
v14 = (unsigned __int8 *)&v53 + 1;
}
v15 = (char *)&v14[v13];
while ( v14 != (unsigned __int8 *)v15 )
{
v16 = *v14++;
if ( (unsigned int)(v16 - 48) > 9 )
{
v13 = 0;
goto LABEL_22;
}
}
v13 = 1;
LABEL_22:
if ( a2 )
{
v18 = *(_DWORD **)(a2 + 52);
if ( *v18 )
{
v19 = (int *)v18[3];
v47 = &v19[*v18 - 1];
while ( 1 )
{
do
{
while ( 1 )
{
while ( 1 )
{
if ( v19 > v47 )
goto LABEL_23;
v21 = *v19++;
v20 = v21;
if ( !v21 )
goto LABEL_23;
if ( v46 != 1 )
break;
if ( !*(_BYTE *)(v20 + 68) )
{
if ( *(_BYTE *)(v20 + 69) )
goto LABEL_69;
v22 = *(unsigned __int8 *)(v20 + 88);
if ( (v22 & 1) != 0 )
{
v23 = *(unsigned __int8 **)(v20 + 96);
v24 = *(_DWORD *)(v20 + 92);
}
else
{
v23 = (unsigned __int8 *)(v20 + 89);
v24 = v22 >> 1;
}
if ( (v53 & 1) != 0 )
{
v25 = v55;
v26 = v54;
}
else
{
v26 = (int)(unsigned __int8)v53 >> 1;
v25 = (unsigned __int8 *)&v53 + 1;
}
if ( v24 >= v26 )
{
if ( !v26 )
goto LABEL_69;
v27 = &v23[v24];
v48 = v23;
std::__search(
v52,
v23,
v27,
v25,
&v25[v26],
(int (__fastcall *)(int, _DWORD))std::char_traits::eq);
if ( v52[0] != v27 && v52[0] - v48 != -1 )
goto LABEL_69;
}
}
}
v28 = *(unsigned __int8 *)(v20 + 472);
if ( (v28 & 1) != 0 )
{
v29 = *(unsigned __int8 **)(v20 + 480);
v30 = *(_DWORD *)(v20 + 476);
}
else
{
v29 = (unsigned __int8 *)(v20 + 473);
v30 = v28 >> 1;
}
if ( (v53 & 1) != 0 )
{
v31 = v55;
v32 = v54;
}
else
{
v32 = (int)(unsigned __int8)v53 >> 1;
v31 = (unsigned __int8 *)&v53 + 1;
}
if ( v30 < v32
|| v32
&& ((v33 = &v29[v30],
v49 = v29,
std::__search(
v52,
v29,
v33,
v31,
&v31[v32],
(int (__fastcall *)(int, _DWORD))std::char_traits::eq),
v52[0] == v33)
|| v52[0] - v49 == -1) )
{
v34 = *(unsigned __int8 *)(v20 + 484);
if ( (v34 & 1) != 0 )
{
v35 = *(unsigned __int8 **)(v20 + 492);
v36 = *(_DWORD *)(v20 + 488);
}
else
{
v35 = (unsigned __int8 *)(v20 + 485);
v36 = v34 >> 1;
}
if ( (v53 & 1) != 0 )
{
v37 = v55;
v38 = v54;
}
else
{
v38 = (int)(unsigned __int8)v53 >> 1;
v37 = (unsigned __int8 *)&v53 + 1;
}
if ( v36 < v38 )
break;
if ( v38 )
{
v39 = &v35[v36];
v50 = v35;
std::__search(
v52,
v35,
v39,
v37,
&v37[v38],
(int (__fastcall *)(int, _DWORD))std::char_traits::eq);
if ( v52[0] == v39 || v52[0] - v50 == -1 )
break;
}
}
LABEL_69:
cocos2d::CCArray::addObject(v7, (cocos2d::CCObject *)v20);
}
}
while ( !v13 );
GameToolbox::intToString((GameToolbox *)&v56, *(_DWORD *)(v20 + 264));
if ( (v56 & 1) != 0 )
{
v40 = v59;
v41 = v58;
}
else
{
v41 = (int)v56 >> 1;
v40 = (unsigned __int8 *)&v57;
}
if ( (v53 & 1) != 0 )
{
v42 = v55;
v43 = v54;
}
else
{
v43 = (int)(unsigned __int8)v53 >> 1;
v42 = (unsigned __int8 *)&v53 + 1;
}
if ( v41 < v43 )
goto LABEL_75;
if ( !v43 )
{
v45 = 1;
goto LABEL_68;
}
v44 = &v40[v41];
v51 = v40;
std::__search(
v52,
v40,
v44,
v42,
&v42[v43],
(int (__fastcall *)(int, _DWORD))std::char_traits::eq);
if ( v52[0] == v44 )
LABEL_75:
v45 = 0;
else
v45 = v52[0] == v51;
LABEL_68:
std::string::~string((int)&v56);
if ( v45 )
goto LABEL_69;
}
}
}
LABEL_23:
std::string::~string((int)&v53);
return v7;
}