//
// MusicDownloadManager::filterMusicByArtistID from 0x1005947e0 to 0x1005949ff (543 bytes)
//
// 2 xrefs:
// > MusicSearchResult::applyArtistFilters @ 0x1005998b9
// > MusicSearchResult::updateFutureCount @ 0x100599daa
//
// 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
//
// local variable allocation has failed, the output may be wrong!
cocos2d::CCArray *__fastcall MusicDownloadManager::filterMusicByArtistID(
MusicDownloadManager *a1,
int a2,
cocos2d::CCArray *a3)
{
cocos2d::CCArray *v5; // r14
cocos2d::ccArray *data; // rax
cocos2d::CCObject **arr; // r12
unsigned __int64 v8; // r13
cocos2d::CCObject *v9; // rsi
unsigned __int64 v10; // rdi
unsigned __int64 v11; // r9
unsigned __int64 v12; // rcx
__int64 **v13; // rax
__int64 *v14; // r8
unsigned __int64 v15; // rdi
unsigned __int64 v16; // rax
__int64 v17; // rax
v5 = (cocos2d::CCArray *)sub_10071F9E0(a1, *(_QWORD *)&a2);
if ( a3 )
{
data = a3->data;
if ( data->num )
{
arr = data->arr;
v8 = (unsigned __int64)&arr[data->num - 1];
do
{
v9 = *arr;
if ( !*arr )
return v5;
if ( v9[8].m_nTag == a2 )
{
LABEL_4:
sub_10071FCD0(v5, v9);
goto LABEL_5;
}
v10 = *(_QWORD *)&v9[10].m_uID;
if ( !v10 )
goto LABEL_5;
v11 = (0x101010101010101LL
* ((((v10 - ((v10 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v10 - ((v10 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((v10 - ((v10 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v10 - ((v10 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v11 > 1 )
{
v12 = a2;
if ( v10 > a2 )
goto LABEL_15;
if ( (v10 | a2) >> 32 )
{
v12 = a2 % v10;
LABEL_15:
v13 = *((__int64 ***)&v9[10].copyWithZone + v12);
if ( !v13 )
goto LABEL_5;
goto LABEL_16;
}
v12 = a2 % (unsigned int)v10;
v13 = *((__int64 ***)&v9[10].copyWithZone + v12);
if ( !v13 )
goto LABEL_5;
}
else
{
v12 = a2 & (v10 - 1);
v13 = *((__int64 ***)&v9[10].copyWithZone + v12);
if ( !v13 )
goto LABEL_5;
}
LABEL_16:
v14 = *v13;
if ( *v13 )
{
if ( (unsigned int)v11 < 2 )
{
v15 = v10 - 1;
while ( 1 )
{
v17 = v14[1];
if ( v17 == a2 )
{
if ( *((_DWORD *)v14 + 4) == a2 )
goto LABEL_4;
}
else if ( (v15 & v17) != v12 )
{
goto LABEL_5;
}
v14 = (__int64 *)*v14;
if ( !v14 )
goto LABEL_5;
}
}
while ( 1 )
{
v16 = v14[1];
if ( v16 == a2 )
{
if ( *((_DWORD *)v14 + 4) == a2 )
goto LABEL_4;
goto LABEL_20;
}
if ( v16 < v10 )
goto LABEL_25;
if ( (v10 | v16) >> 32 )
break;
if ( (unsigned int)v16 % (unsigned int)v10 != v12 )
goto LABEL_5;
LABEL_20:
v14 = (__int64 *)*v14;
if ( !v14 )
goto LABEL_5;
}
v16 %= v10;
LABEL_25:
if ( v16 != v12 )
goto LABEL_5;
goto LABEL_20;
}
LABEL_5:
++arr;
}
while ( (unsigned __int64)arr <= v8 );
}
}
return v5;
}