//
// AudioLineGuideGameObject::getSaveString from 0x78791c to 0x787ce4 (968 bytes)
//
// 2 xrefs:
// > ??> @ 0x97230
// > ??> @ 0x11733b0
//
// 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 __usercall AudioLineGuideGameObject::getSaveString@(
AudioLineGuideGameObject *this@,
GJBaseGameLayer *a2@,
__int64 a3@)
{
char *v5; // x0
size_t v6; // x20
double m_duration; // d0
unsigned int *v9; // x2
int v10; // w1
const char *v11; // [xsp+88h] [xbp+88h] BYREF
_DWORD v12[5]; // [xsp+90h] [xbp+90h] BYREF
char v13; // [xsp+A4h] [xbp+A4h]
size_t v14; // [xsp+A8h] [xbp+A8h] BYREF
unsigned __int64 v15; // [xsp+B0h] [xbp+B0h]
char *v16; // [xsp+B8h] [xbp+B8h]
_BYTE v17[504]; // [xsp+C0h] [xbp+C0h] BYREF
v14 = 0;
v15 = 500;
v16 = v17;
EffectGameObject::getSaveString(this, a2, (__int64)&v11);
fmt::BasicWriter::operator<<(&v14, v11, *((_QWORD *)v11 - 3));
v5 = (char *)(v11 - 24);
if ( v11 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v9 = (unsigned int *)(v11 - 8);
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *((_DWORD *)v11 - 2);
*((_DWORD *)v11 - 2) = v10 - 1;
}
if ( v10 <= 0 )
operator delete(v5);
}
if ( this->m_beatsPerMinute )
{
fmt::BasicWriter::operator<<(&v14, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v14, 0x1F2u);
fmt::BasicWriter::operator<<(&v14, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(
&v14,
this->m_beatsPerMinute);
if ( !this->m_beatsPerBar )
{
LABEL_4:
if ( this->m_speed == Normal )
goto LABEL_5;
goto LABEL_15;
}
}
else if ( !this->m_beatsPerBar )
{
goto LABEL_4;
}
fmt::BasicWriter::operator<<(&v14, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v14, 0x1F5u);
fmt::BasicWriter::operator<<(&v14, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v14, this->m_beatsPerBar);
if ( this->m_speed == Normal )
{
LABEL_5:
if ( !this->m_disabled )
goto LABEL_6;
LABEL_16:
fmt::BasicWriter::operator<<(&v14, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v14, 0x1F4u);
fmt::BasicWriter::operator<<(&v14, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v14, this->m_disabled);
if ( this->m_duration == 0.0 )
goto LABEL_7;
goto LABEL_17;
}
LABEL_15:
fmt::BasicWriter::operator<<(&v14, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v14, 0x1F3u);
fmt::BasicWriter::operator<<(&v14, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v14, this->m_speed);
if ( this->m_disabled )
goto LABEL_16;
LABEL_6:
if ( this->m_duration == 0.0 )
goto LABEL_7;
LABEL_17:
fmt::BasicWriter::operator<<(&v14, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v14, 0xAu);
fmt::BasicWriter::operator<<(&v14, &byte_F804F8, 0);
m_duration = this->m_duration;
v12[1] = 32;
v12[0] = 0;
v12[2] = 0;
v12[3] = 0;
v12[4] = -1;
v13 = 0;
fmt::BasicWriter::FormatDouble(&v14, v12, m_duration);
LABEL_7:
v6 = v14;
if ( v15 < v14 + 1 )
fmt::internal::Array::grow(&v14, v14 + 1);
v16[v6] = 0;
sub_D153B8(a3, v16);
if ( v16 != v17 && v16 )
operator delete[](v16);
return a3;
}