//
// MusicDownloadManager::linkRowString from 0x95fad8 to 0x95fc78 (416 bytes)
//
// 3 xrefs:
// > SongInfoObject::addSongLink @ 0x965888
// > SongInfoObject::addArtistLink @ 0x965a80
// > ??> @ 0xd5160
//
// 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:31 +0000
//
unsigned __int64 *__usercall MusicDownloadManager::linkRowString@(
MusicDownloadManager *this@,
unsigned __int64 *a2@)
{
char *v5; // x23
unsigned int v6; // w25
unsigned int v7; // w24
char *v8; // x4
cocos2d::CCString *v9; // x0
const char *CString; // x0
const char *v11; // x23
size_t v12; // x0
size_t v13; // x20
unsigned __int64 v14; // x21
_BYTE *v15; // x3
__int64 v17[2]; // [xsp+58h] [xbp+58h] BYREF
void *v18; // [xsp+68h] [xbp+68h]
__int64 v19[2]; // [xsp+70h] [xbp+70h] BYREF
void *v20; // [xsp+80h] [xbp+80h]
v5 = (char *)v17 + 1;
v6 = *(_DWORD *)this;
v7 = *((_DWORD *)this + 1);
MusicDownloadManager::urlEncode((char *)this + 8, v17);
if ( (v17[0] & 1) != 0 )
v5 = (char *)v18;
MusicDownloadManager::urlEncode((char *)this + 32, v19);
v8 = (char *)v19 + 1;
if ( (v19[0] & 1) != 0 )
v8 = (char *)v20;
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i,%i,%s,%s",
(const char *)v6,
v7,
v5,
v8);
CString = (const char *)cocos2d::CCString::getCString(v9);
*a2 = 0;
v11 = CString;
a2[1] = 0;
a2[2] = 0;
v12 = strlen(CString);
v13 = v12;
if ( v12 > 0xFFFFFFFFFFFFFFEFLL )
sub_62D3FC();
if ( v12 <= 0x16 )
{
*(_BYTE *)a2 = 2 * v12;
v15 = (char *)a2 + 1;
if ( !v12 )
{
*v15 = 0;
if ( (v19[0] & 1) == 0 )
goto LABEL_9;
goto LABEL_14;
}
}
else
{
v14 = (v12 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v15 = (_BYTE *)operator new(v14);
a2[2] = (unsigned __int64)v15;
a2[1] = v13;
*a2 = v14 | 1;
}
*((_BYTE *)memcpy(v15, v11, v13) + v13) = 0;
if ( (v19[0] & 1) == 0 )
goto LABEL_9;
LABEL_14:
operator delete(v20);
LABEL_9:
if ( (v17[0] & 1) != 0 )
operator delete(v18);
return a2;
}