//
// GJGameLevel::getSongName from 0x1005843e0 to 0x100584491 (177 bytes)
//
// 3 xrefs:
// > EditLevelLayer::setupLevelInfo @ 0x1001dee01
// > LevelCell::loadLocalLevelCell @ 0x1002370fd
// > LevelCell::loadCustomLevelCell @ 0x10023895a
//
// This function is hookable on this platform (idp: pc, 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:32:21 +0000
//
std::string *__fastcall GJGameLevel::getSongName(std::string *this, __int64 a2)
{
__int64 v3; // rdi
__int64 v4; // rax
__int64 v5; // rax
__int128 v7; // [rsp+0h] [rbp-30h] BYREF
std::string::size_type v8; // [rsp+10h] [rbp-20h]
v3 = *(unsigned int *)(a2 + 608);
if ( (_DWORD)v3 )
{
*(_WORD *)&this->__r_.__value_.__l.0 = 0;
v4 = SongInfoObject::create_1(v3);
if ( v4 && !*(_BYTE *)(v4 + 432) )
{
if ( (*(_BYTE *)(v4 + 320) & 1) != 0 )
{
sub_10001AD30(&v7, *(const void **)(v4 + 336), *(_QWORD *)(v4 + 328));
}
else
{
v5 = v4 + 320;
v8 = *(_QWORD *)(v5 + 16);
v7 = *(_OWORD *)v5;
}
if ( (*(_BYTE *)&this->__r_.__value_.__s.0 & 1) != 0 )
operator delete(this->__r_.__value_.__l.__data_);
this->__r_.__value_.__r.__words[2] = v8;
*(_OWORD *)&this->__r_.__value_.__l.0 = v7;
}
else
{
std::string::assign(this, "Unknown");
}
}
else
{
LevelTools::getAudioTitle((__int64)this, *(_DWORD *)(a2 + 604));
}
return this;
}