//
// MusicDownloadManager::onTryUpdateMusicLibraryCompleted from 0x968dc4 to 0x968ec4 (256 bytes)
//
// 3 xrefs:
// > ??> @ 0xcab70
// > MusicDownloadManager::tryUpdateMusicLibrary @ 0x968a18
// > ??> @ 0x1545f40
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 12:57:37 +0000
//
__int64 __fastcall MusicDownloadManager::onTryUpdateMusicLibraryCompleted(
MusicDownloadManager *this,
cocos2d::extension::CCHttpClient *a2,
cocos2d::extension::CCHttpResponse *a3)
{
bool v5; // cc
MusicDownloadManager *v6; // x0
__int64 v8[2]; // [xsp+40h] [xbp+40h] BYREF
char *v9; // [xsp+50h] [xbp+50h]
MusicDownloadManager::removeDLFromActive(this, "v_music_l");
if ( !a3 || !*((_BYTE *)a3 + 64) )
{
MusicDownloadManager::musicActionFailed((__int64)this, 5u);
return _stack_chk_guard;
}
GameToolbox::getResponse((__int64)a3, v8);
if ( (v8[0] & 1) != 0 )
{
v5 = atoi(v9) <= *((_DWORD *)this + 128);
v6 = this;
if ( !v5 )
goto LABEL_7;
}
else
{
v5 = atoi((const char *)v8 + 1) <= *((_DWORD *)this + 128);
v6 = this;
if ( !v5 )
{
LABEL_7:
MusicDownloadManager::downloadMusicLibrary(v6);
goto LABEL_8;
}
}
MusicDownloadManager::musicActionFailed((__int64)v6, 6u);
LABEL_8:
if ( (v8[0] & 1) != 0 )
operator delete(v9);
return _stack_chk_guard;
}