//
// MusicSearchResult::updateObjects_1 from 0x10015caa4 to 0x10015cbdc (312 bytes)
//
// 1 xrefs:
// > ??> @ 0x10079b0c8
//
// 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
//
void __fastcall MusicSearchResult::updateObjects_1(MusicSearchResult *a1, AudioSortType a2)
{
MusicDownloadManager *v4; // x0
cocos2d::CCArray *AllMusicObjects; // x21
cocos2d::CCArray *FilesMatchingSearch; // x22
std::size_t size; // x2
cocos2d::CCArray *v8; // x0
cocos2d::CCArray *v9; // x22
cocos2d::ccArray *data; // x8
cocos2d::CCObject **arr; // x0
size_t num; // x1
__int64 (__fastcall *v13)(__int64 *, __int64); // x8
int (__cdecl *v14)(const void *, const void *); // x3
void *__p[2]; // [xsp+0h] [xbp-40h] BYREF
char *longStorage; // [xsp+10h] [xbp-30h]
a1->m_sortType = a2;
v4 = MusicDownloadManager::sharedState();
AllMusicObjects = MusicDownloadManager::getAllMusicObjects(v4, a1->m_songType);
MusicSearchResult::createTagFilterObjects(a1);
MusicSearchResult::createArtistFilterObjects(a1);
if ( a1->m_searchQuery.m_data.m_short.shortStorage.__elems_[22] < 0 )
{
size = a1->m_searchQuery.m_data.m_long.size;
FilesMatchingSearch = AllMusicObjects;
if ( !size )
goto LABEL_8;
sub_1000097D0(__p, (void *)a1->m_searchQuery.m_data.m_long.capacitym1, size);
}
else
{
FilesMatchingSearch = AllMusicObjects;
if ( !a1->m_searchQuery.m_data.m_short.shortStorage.__elems_[22] )
goto LABEL_8;
*(_OWORD *)__p = *(_OWORD *)&a1->m_searchQuery.m_data.m_short.sizex2;
longStorage = a1->m_searchQuery.m_data.m_long.longStorage;
}
FilesMatchingSearch = (cocos2d::CCArray *)MusicSearchResult::getFilesMatchingSearch(a1, AllMusicObjects, __p);
if ( SHIBYTE(longStorage) < 0 )
operator delete(__p[0]);
LABEL_8:
v8 = MusicSearchResult::applyArtistFilters(a1, FilesMatchingSearch);
v9 = MusicSearchResult::applyTagFilters(a1, v8);
MusicSearchResult::updateFutureCount(a1, v9, AllMusicObjects);
if ( (unsigned int)sub_10024A36C(v9) >= 2 )
{
data = v9->data;
arr = data->arr;
num = data->num;
v13 = sub_100152ED4;
if ( a2 == SongOrder )
v13 = sub_100152F00;
if ( a2 )
v14 = (int (__cdecl *)(const void *, const void *))v13;
else
v14 = (int (__cdecl *)(const void *, const void *))sub_100152F2C;
qsort(arr, num, 8u, v14);
}
sub_10015CEE8(a1, v9);
}