//
// MusicDownloadManager::onTryUpdateSFXLibraryCompleted from 0x100595420 to 0x10059554c (300 bytes)
//
// 1 xrefs:
// > MusicDownloadManager::tryUpdateSFXLibrary @ 0x100595323
//
// 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 MusicDownloadManager::onTryUpdateSFXLibraryCompleted(
MusicDownloadManager *a1,
cocos2d::extension::CCHttpClient *a2,
cocos2d::extension::CCHttpResponse *a3)
{
double v3; // xmm0_8
unsigned int v5; // r14d
__int64 v6; // rax
unsigned int v7; // r14d
__int64 v8; // rax
char v9; // [rsp+8h] [rbp-28h] BYREF
char v10[15]; // [rsp+9h] [rbp-27h] BYREF
char *v11; // [rsp+18h] [rbp-18h]
MusicDownloadManager::removeDLFromActive(a1, "v_sfx_l");
if ( a3 && a3->_succeed )
{
GameToolbox::getResponse((__int64)&v9, (__int64)a3, v3);
if ( (v9 & 1) != 0 )
{
if ( atoi(v11) <= a1->m_sfxLibraryVersion )
goto LABEL_5;
}
else if ( atoi(v10) <= a1->m_sfxLibraryVersion )
{
LABEL_5:
if ( (unsigned int)sub_100720070(a1->m_musicDownloadDelegates) )
{
v5 = 0;
do
{
v6 = sub_1007200C0(a1->m_musicDownloadDelegates, v5);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(v6 + 320) + 72LL))(*(_QWORD *)(v6 + 320), 4);
++v5;
}
while ( v5 < (unsigned int)sub_100720070(a1->m_musicDownloadDelegates) );
}
goto LABEL_15;
}
MusicDownloadManager::downloadSFXLibrary(a1);
LABEL_15:
if ( (v9 & 1) != 0 )
operator delete(v11);
return;
}
if ( (unsigned int)sub_100720070(a1->m_musicDownloadDelegates) )
{
v7 = 0;
do
{
v8 = sub_1007200C0(a1->m_musicDownloadDelegates, v7);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(v8 + 320) + 72LL))(*(_QWORD *)(v8 + 320), 3);
++v7;
}
while ( v7 < (unsigned int)sub_100720070(a1->m_musicDownloadDelegates) );
}
}