//
// GJGameLevel::getSongName from 0x10055c100 to 0x10055c1b1 (177 bytes)
//
// 3 xrefs:
// > EditLevelLayer::setupLevelInfo @ 0x1001fc541
// > LevelCell::loadLocalLevelCell @ 0x10024f1fe
// > LevelCell::loadCustomLevelCell @ 0x100250412
//
// 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
//
std::string *__fastcall GJGameLevel::getSongName(std::string *this, __int64 a2, double a3)
{
int v4; // edi
SongInfoObject *v5; // rax
std::string *p_m_songName; // rax
__int128 v8; // [rsp+0h] [rbp-30h] BYREF
std::string::size_type longStorage; // [rsp+10h] [rbp-20h]
v4 = *(_DWORD *)(a2 + 600);
if ( v4 )
{
*(_WORD *)&this->__r_.__value_.__l.0 = 0;
v5 = SongInfoObject::create_1(v4);
if ( v5 && !v5->m_unloaded )
{
if ( (v5->m_songName.m_data.m_short.sizex2 & 1) != 0 )
{
sub_100006B70(&v8, v5->m_songName.m_data.m_long.longStorage, v5->m_songName.m_data.m_long.size, a3);
}
else
{
p_m_songName = &v5->m_songName;
longStorage = (std::string::size_type)p_m_songName->m_data.m_long.longStorage;
v8 = *(_OWORD *)&p_m_songName->m_data.m_short.sizex2;
}
if ( (*(_BYTE *)&this->__r_.__value_.__s.0 & 1) != 0 )
operator delete(this->__r_.__value_.__l.__data_);
this->__r_.__value_.__r.__words[2] = longStorage;
*(_OWORD *)&this->__r_.__value_.__l.0 = v8;
}
else
{
std::string::assign(this, "Unknown");
}
}
else
{
LevelTools::getAudioTitle((__int64)this, *(_DWORD *)(a2 + 596));
}
return this;
}