//
// MusicDownloadManager::getAllMusicTags from 0x82a8f4 to 0x82aa9c (424 bytes)
//
// 2 xrefs:
// > MusicSearchResult::createTagFilterObjects @ 0x8321c4
// > ??> @ 0x49fb0
//
// 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 *MusicDownloadManager::getAllMusicTags(MusicDownloadManager *a1, OptionsObjectDelegate *a2)
{
std::_rb_tree_base *p_m_header; // x22
__int64 v5; // x0
std::_rb_tree_base *m_left; // x19
cocos2d::CCArray *i; // x21
unsigned int v8; // w28
OptionsObjectDelegate *v9; // x4
cocos2d::CCObject *v10; // x28
void *v11; // x0
unsigned int *v12; // x1
int v13; // w2
__int64 v15; // [xsp+0h] [xbp+0h] BYREF
__int64 v16; // [xsp+70h] [xbp+70h] BYREF
p_m_header = &a1->m_musicTags.m_header;
v5 = cocos2d::CCArray::createWithCapacity((cocos2d::CCArray *)LODWORD(a1->m_musicTags.m_nodecount), _stack_chk_guard);
m_left = a1->m_musicTags.m_header.m_left;
for ( i = (cocos2d::CCArray *)v5; m_left != p_m_header; m_left = (std::_rb_tree_base *)sub_CFAB14(m_left) )
{
while ( 1 )
{
v8 = *(_DWORD *)&m_left[1].m_isblack;
sub_D18D28(&v16);
v10 = (cocos2d::CCObject *)OptionsObject::create(
(OptionsObject *)v8,
0,
(unsigned __int8)&v15 + 112,
(std::string)a2,
v9);
v11 = (void *)(v16 - 24);
if ( (__int64 *)(v16 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v12 = (unsigned int *)(v16 - 8);
do
v13 = __ldaxr(v12);
while ( __stlxr(v13 - 1, v12) );
}
else
{
v13 = *(_DWORD *)(v16 - 8);
*(_DWORD *)(v16 - 8) = v13 - 1;
}
if ( v13 <= 0 )
break;
}
cocos2d::CCArray::addObject(i, v10);
m_left = (std::_rb_tree_base *)sub_CFAB14(m_left);
if ( m_left == p_m_header )
goto LABEL_10;
}
operator delete(v11);
cocos2d::CCArray::addObject(i, v10);
}
LABEL_10:
if ( (unsigned int)cocos2d::CCArray::count(i) > 1 )
qsort(i->data->arr, i->data->num, 8u, (int (*)(const void *, const void *))optionsStrCompare);
return i;
}