//
// MusicDownloadManager::onGetSongInfoCompleted from 0x975c4c to 0x975e30 (484 bytes)
//
// 2 xrefs:
// > MusicDownloadManager::handleIt @ 0x97cedc
// > ??> @ 0xb61e8
//
// 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:43 +0000
//
__int64 __fastcall MusicDownloadManager::onGetSongInfoCompleted(MusicDownloadManager *a1, __int64 a2, char *a3)
{
const char *v5; // x3
unsigned int v6; // w23
const char *SongInfoKey; // x0
_BOOL4 v8; // w24
_BOOL4 v9; // w24
char v10; // w0
__int64 v11; // x0
__int64 v12; // x1
__int64 *v13; // x1
__int64 *v15; // [xsp+48h] [xbp+48h]
__int64 v16; // [xsp+50h] [xbp+50h] BYREF
__int64 v17; // [xsp+58h] [xbp+58h]
void *v18; // [xsp+60h] [xbp+60h]
v5 = a3 + 1;
if ( (*a3 & 1) != 0 )
v5 = *((const char **)a3 + 2);
v6 = atoi(v5);
SongInfoKey = (const char *)MusicDownloadManager::getSongInfoKey(a1, (const char *)v6);
MusicDownloadManager::removeDLFromActive(a1, SongInfoKey);
v16 = 0;
v17 = 0;
v18 = nullptr;
std::string::__init(&v16, &word_117CE08, 2u);
v8 = sub_95A404(a2, (__int64)&v16);
if ( (v16 & 1) == 0 )
{
if ( !v8 )
goto LABEL_5;
LABEL_15:
MusicDownloadManager::loadSongInfoFailed((__int64)a1, v6, 1u);
return _stack_chk_guard;
}
operator delete(v18);
if ( v8 )
goto LABEL_15;
LABEL_5:
v16 = 0;
v17 = 0;
v18 = nullptr;
std::string::__init(&v16, "-2", 2u);
v9 = sub_95A404(a2, (__int64)&v16);
if ( (v16 & 1) == 0 )
{
if ( !v9 )
goto LABEL_7;
LABEL_17:
MusicDownloadManager::loadSongInfoFailed((__int64)a1, v6, 2u);
return _stack_chk_guard;
}
operator delete(v18);
if ( v9 )
goto LABEL_17;
LABEL_7:
v10 = *(_BYTE *)a2;
v16 = 0;
v17 = 0;
v18 = nullptr;
if ( (v10 & 1) != 0 )
{
std::string::__init(&v16, *(void **)(a2 + 16), *(_QWORD *)(a2 + 8));
}
else
{
v11 = *(_QWORD *)a2;
v12 = *(_QWORD *)(a2 + 8);
v18 = *(void **)(a2 + 16);
v16 = v11;
v17 = v12;
}
v13 = MusicDownloadManager::addSongObjectFromString((__int64)a1, (char *)&v16);
if ( (v16 & 1) != 0 )
{
v15 = v13;
operator delete(v18);
v13 = v15;
}
if ( !v13 )
goto LABEL_15;
MusicDownloadManager::loadSongInfoFinished((cocos2d::CCArray **)a1, (SongInfoObject *)v13);
return _stack_chk_guard;
}