//
// UISettingsGameObject::getSaveString from 0x784ddc to 0x7851ec (1040 bytes)
//
// 2 xrefs:
// > ??> @ 0x35af0
// > ??> @ 0x11713b0
//
// 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 UISettingsGameObject::getSaveString@(
UISettingsGameObject *this@,
GJBaseGameLayer *a2@,
__int64 a3@)
{
char *v5; // x0
size_t v6; // x20
unsigned int *v8; // x2
int v9; // w1
const char *v10; // [xsp+A0h] [xbp+A0h] BYREF
size_t v11; // [xsp+A8h] [xbp+A8h] BYREF
unsigned __int64 v12; // [xsp+B0h] [xbp+B0h]
char *v13; // [xsp+B8h] [xbp+B8h]
_BYTE v14[504]; // [xsp+C0h] [xbp+C0h] BYREF
v11 = 0;
v12 = 500;
v13 = v14;
EffectGameObject::getSaveString(this, a2, (__int64)&v10);
fmt::BasicWriter::operator<<(&v11, v10, *((_QWORD *)v10 - 3));
v5 = (char *)(v10 - 24);
if ( v10 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v10 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *((_DWORD *)v10 - 2);
*((_DWORD *)v10 - 2) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v5);
}
if ( this->m_targetGroupID )
{
fmt::BasicWriter::operator<<(&v11, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v11, 0x33u);
fmt::BasicWriter::operator<<(&v11, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(
&v11,
this->m_targetGroupID);
if ( !this->m_centerGroupID )
{
LABEL_4:
if ( !this->m_xRef )
goto LABEL_5;
goto LABEL_16;
}
}
else if ( !this->m_centerGroupID )
{
goto LABEL_4;
}
fmt::BasicWriter::operator<<(&v11, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v11, 0x47u);
fmt::BasicWriter::operator<<(&v11, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(
&v11,
this->m_centerGroupID);
if ( !this->m_xRef )
{
LABEL_5:
if ( !this->m_yRef )
goto LABEL_6;
goto LABEL_17;
}
LABEL_16:
fmt::BasicWriter::operator<<(&v11, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v11, 0x181u);
fmt::BasicWriter::operator<<(&v11, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v11, this->m_xRef);
if ( !this->m_yRef )
{
LABEL_6:
if ( !this->m_xRelative )
goto LABEL_7;
LABEL_18:
fmt::BasicWriter::operator<<(&v11, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v11, 0x183u);
fmt::BasicWriter::operator<<(&v11, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v11, this->m_xRelative);
if ( !this->m_yRelative )
goto LABEL_8;
goto LABEL_19;
}
LABEL_17:
fmt::BasicWriter::operator<<(&v11, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v11, 0x182u);
fmt::BasicWriter::operator<<(&v11, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v11, this->m_yRef);
if ( this->m_xRelative )
goto LABEL_18;
LABEL_7:
if ( !this->m_yRelative )
goto LABEL_8;
LABEL_19:
fmt::BasicWriter::operator<<(&v11, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v11, 0x184u);
fmt::BasicWriter::operator<<(&v11, &byte_F804F8, 0);
fmt::BasicWriter::FormatInt,char>>(&v11, this->m_yRelative);
LABEL_8:
v6 = v11;
if ( v12 < v11 + 1 )
fmt::internal::Array::grow(&v11, v11 + 1);
v13[v6] = 0;
sub_D153B8(a3, v13);
if ( v13 != v14 && v13 )
operator delete[](v13);
return a3;
}