//
// SFXBrowser::onSelectAll from 0x6c8a2c to 0x6c8b4a (286 bytes)
//
// 0 xrefs:
//
// 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:56:57 +0000
//
char **__fastcall SFXBrowser::onSelectAll(char **this, cocos2d::CCObject *a2)
{
int **v2; // r8
int v3; // r3
int v4; // r3
char *v5; // r9
int v6; // r5
int v7; // r7
int v8; // r4
_DWORD *v9; // r3
int *v10; // r7
int *v11; // r5
int v12; // r4
int v13; // t1
_DWORD *v14; // r0
int i; // r5
int v16; // r1
int *v17; // r3
CCMenuItemToggler *v18; // r0
MusicDownloadManager *v19; // r0
int v20; // [sp+0h] [bp-18h] BYREF
char *v21; // [sp+8h] [bp-10h] BYREF
char *v22; // [sp+Ch] [bp-Ch]
char *v23; // [sp+10h] [bp-8h]
v2 = (int **)this;
v3 = (int)*(this + 136);
if ( v3 && *(_DWORD *)(v3 + 104) == 4 )
{
v4 = *(_DWORD *)(v3 + 56);
v21 = nullptr;
v22 = nullptr;
v23 = nullptr;
if ( v4 )
{
v9 = *(_DWORD **)(v4 + 52);
if ( *v9 )
{
v10 = (int *)v9[3];
v11 = &v10[*v9 - 1];
while ( v10 <= v11 )
{
v13 = *v10++;
v12 = v13;
if ( !v13 )
break;
if ( *(int *)(v12 + 72) > 1 )
{
v19 = (MusicDownloadManager *)MusicDownloadManager::sharedState((MusicDownloadManager *)this);
this = (char **)MusicDownloadManager::getCustomSFXObject(v19, *(_DWORD *)(v12 + 72));
if ( (char **)v12 == this )
{
if ( v22 == v23 )
{
std::vector::__push_back_slow_path((int)&v21, (_DWORD *)(v12 + 72));
}
else
{
if ( v22 )
*(_DWORD *)v22 = *(_DWORD *)(v12 + 72);
v22 += 4;
}
}
}
}
}
}
v5 = v21;
if ( v21 != v22 )
{
v6 = 0;
v7 = 1;
v8 = (v22 - v21) >> 2;
while ( v6 != v8 && v7 )
{
v14 = std::__tree::__count_unique(v2 + 172, &v5[4 * v6++]);
v7 = (int)v14;
if ( v14 )
v7 = 1;
}
for ( i = 0; i != v8; ++i )
{
v16 = 4 * i;
if ( v7 )
std::__tree::__erase_unique(v2 + 172, &v21[v16]);
else
std::__tree::__emplace_unique_key_args(
(int)&v20,
(int)(v2 + 172),
(int *)&v21[v16],
&v21[v16]);
}
SFXBrowser::updateSelectionUI((GameManager *)v2);
v17 = v2[138];
if ( v17 )
{
v18 = (CCMenuItemToggler *)v17[110];
if ( v18 )
CustomListView::reloadAll(v18);
}
}
return std::__vector_base::~__vector_base(&v21);
}
return this;
}