//
// SongInfoObject::addSongLink from 0x5732b4 to 0x573370 (188 bytes)
//
// 4 xrefs:
// > SongInfoObject::createWithCoder @ 0x578624
// > SongInfoObject::createWithCoder @ 0x578692
// > MusicDownloadManager::parseMusicLibrary @ 0x578efa
// > MusicDownloadManager::parseMusicLibrary @ 0x5790fc
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:52:39 +0000
//
int __fastcall SongInfoObject::addSongLink(int this, const GJLinkObject *a2)
{
int v3; // r4
int v4; // r3
int v5; // r3
unsigned int *v6; // r7
GJLinkObject *v7; // r0
int v8; // r3
_DWORD *v9; // r4
int v10; // r3
char *v11; // r1
size_t v12; // r2
unsigned __int8 v13; // [sp+0h] [bp-14h] BYREF
char v14; // [sp+1h] [bp-13h] BYREF
size_t v15; // [sp+4h] [bp-10h]
char *v16; // [sp+8h] [bp-Ch]
v3 = this;
v4 = *((unsigned __int8 *)a2 + 20);
if ( (v4 & 1) != 0 )
v5 = *((_DWORD *)a2 + 6);
else
v5 = v4 >> 1;
if ( v5 )
{
v6 = (unsigned int *)(this + 412);
this = sub_56B10E((_DWORD *)(this + 412), (unsigned __int8 *)a2 + 20);
if ( !this )
{
v7 = *(GJLinkObject **)(v3 + 416);
if ( v7 == *(GJLinkObject **)(v3 + 420) )
{
std::vector::__push_back_slow_path(v6, a2);
}
else
{
if ( v7 )
GJLinkObject::GJLinkObject(v7, a2);
*(_DWORD *)(v3 + 416) += 32;
}
v8 = *(unsigned __int8 *)(v3 + 388);
v9 = (_DWORD *)(v3 + 388);
if ( (v8 & 1) != 0 )
v10 = v9[1];
else
v10 = v8 >> 1;
if ( v10 )
std::string::append(v9, ";");
MusicDownloadManager::linkRowString((MusicDownloadManager *)&v13, a2);
if ( (v13 & 1) != 0 )
{
v11 = v16;
v12 = v15;
}
else
{
v12 = (int)v13 >> 1;
v11 = &v14;
}
std::string::append(v9, v11, v12);
return std::string::~string((int)&v13);
}
}
return this;
}