//
// MusicDownloadManager::onGetCustomContentURLCompleted from 0x10058ac30 to 0x10058ad50 (288 bytes)
//
// 1 xrefs:
// > MusicDownloadManager::handleIt @ 0x10058a6c5
//
// 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
//
__int64 __fastcall MusicDownloadManager::onGetCustomContentURLCompleted(__int64 a1, unsigned __int8 *a2)
{
const std::string::value_type *v2; // r14
unsigned __int64 v3; // rcx
size_t v4; // rdx
__int64 result; // rax
unsigned int v6; // r14d
__int64 v7; // rax
unsigned int v8; // r14d
__int64 v9; // rax
_WORD __s2[23]; // [rsp+1h] [rbp-2Fh] BYREF
MusicDownloadManager::removeDLFromActive((MusicDownloadManager *)a1, "get_c_url");
strcpy((char *)__s2, "-1");
v2 = (const std::string::value_type *)(a2 + 1);
v3 = *a2 >> 1;
if ( (*a2 & 1) != 0 )
{
v2 = *((const std::string::value_type **)a2 + 2);
v3 = *((_QWORD *)a2 + 1);
}
v4 = 2;
if ( v3 < 2 )
v4 = v3;
if ( (v3 != 2) | (memcmp(v2, __s2, v4) != 0) )
{
std::string::assign((std::string *)(a1 + 368), v2);
result = sub_100720070(*(_QWORD *)(a1 + 336));
if ( (_DWORD)result )
{
v8 = 0;
do
{
v9 = sub_1007200C0(*(_QWORD *)(a1 + 336), v8);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(v9 + 320) + 64LL))(*(_QWORD *)(v9 + 320), 2);
++v8;
result = sub_100720070(*(_QWORD *)(a1 + 336));
}
while ( v8 < (unsigned int)result );
}
}
else
{
result = sub_100720070(*(_QWORD *)(a1 + 336));
if ( (_DWORD)result )
{
v6 = 0;
do
{
v7 = sub_1007200C0(*(_QWORD *)(a1 + 336), v6);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(v7 + 320) + 72LL))(*(_QWORD *)(v7 + 320), 2);
++v6;
result = sub_100720070(*(_QWORD *)(a1 + 336));
}
while ( v6 < (unsigned int)result );
}
}
return result;
}