//
// MusicSearchResult::applyArtistFilters from 0x100599710 to 0x100599930 (544 bytes)
//
// 1 xrefs:
// > MusicSearchResult::updateObjects_1 @ 0x10059a0d2
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
cocos2d::CCArray *__fastcall MusicSearchResult::applyArtistFilters(MusicSearchResult *a1, cocos2d::CCArray *a2)
{
cocos2d::CCArray *v2; // rbx
cocos2d::CCArray *v4; // rdi
cocos2d::CCArray *v5; // r15
cocos2d::CCArray *m_artistFilterObjects; // rax
cocos2d::ccArray *data; // rax
cocos2d::CCObject **arr; // r13
cocos2d::CCObject *v9; // r14
char *v10; // r12
cocos2d::CCArray *v11; // rax
cocos2d::ccArray *v12; // rax
cocos2d::CCObject **v13; // r14
unsigned __int64 v14; // r12
cocos2d::CCObject **v16; // [rsp+8h] [rbp-38h]
MusicSearchResult *v17; // [rsp+10h] [rbp-30h]
v2 = a2;
v4 = a2;
if ( (unsigned int)sub_100720070(a2) )
{
v5 = (cocos2d::CCArray *)sub_10071F9E0(a2, a2);
a1->m_artistFilter = 0;
m_artistFilterObjects = a1->m_artistFilterObjects;
if ( m_artistFilterObjects )
{
data = m_artistFilterObjects->data;
if ( data->num )
{
v17 = a1;
arr = data->arr;
v16 = &arr[data->num - 1];
do
{
v9 = *arr;
if ( !*arr )
break;
if ( BYTE4(v9[1].__vftable) == 1 )
{
v17->m_artistFilter = 1;
if ( !qword_1009A2C38 )
{
v10 = (char *)operator new(0x230u);
cocos2d::CCNode::CCNode((__int64)v10);
*(_QWORD *)v10 = off_100970158;
*((_QWORD *)v10 + 40) = off_1009704D8;
*((_OWORD *)v10 + 28) = 0;
*(_OWORD *)(v10 + 328) = 0;
*(_OWORD *)(v10 + 344) = 0;
*((_DWORD *)v10 + 90) = 0;
*((_OWORD *)v10 + 23) = 0;
*((_OWORD *)v10 + 24) = 0;
*((_OWORD *)v10 + 25) = 0;
v10[416] = 0;
*(_OWORD *)(v10 + 424) = 0;
*((_QWORD *)v10 + 55) = v10 + 448;
*((_OWORD *)v10 + 30) = 0;
*((_OWORD *)v10 + 31) = 0;
*((_QWORD *)v10 + 58) = 0;
*(_QWORD *)(v10 + 471) = 0;
*((_DWORD *)v10 + 128) = 1065353216;
*(_OWORD *)(v10 + 520) = 0;
*(_OWORD *)(v10 + 536) = 0;
*((_DWORD *)v10 + 138) = 1065353216;
qword_1009A2C38 = (__int64)v10;
v4 = (cocos2d::CCArray *)v10;
MusicDownloadManager::init((MusicDownloadManager *)v10);
}
v11 = MusicDownloadManager::filterMusicByArtistID((MusicDownloadManager *)v4, (int)v9[1].__vftable, a2);
if ( v11 )
{
v12 = v11->data;
if ( v12->num )
{
v13 = v12->arr;
v14 = (unsigned __int64)&v13[v12->num - 1];
do
{
if ( !*v13 )
break;
v4 = v5;
sub_10071FCD0(v5, *v13++);
}
while ( (unsigned __int64)v13 <= v14 );
}
}
}
++arr;
}
while ( arr <= v16 );
if ( v17->m_artistFilter )
return v5;
}
}
}
return v2;
}