//
// GManager::save from 0x5888d0 to 0x5889d0 (256 bytes)
//
// 5 xrefs:
// > AppDelegate::trySaveGame @ 0x5bde6c
// > AppDelegate::trySaveGame @ 0x5bde74
// > GameManager::doQuickSave @ 0x5ee3a4
// > EditorPauseLayer::saveLevel @ 0x78e4dc
// > ??> @ 0x31698
//
// 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
//
void GManager::save(GManager *a1)
{
void *v2; // x0
unsigned int *v3; // x2
int v4; // w1
__int64 v5; // [xsp+40h] [xbp+40h] BYREF
if ( !a1->m_saved )
{
a1->m_saved = 1;
sub_D18D28(&v5, &a1->m_fileName);
GManager::saveGMTo(a1, (__int64)&v5);
v2 = (void *)(v5 - 24);
if ( (__int64 *)(v5 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v3 = (unsigned int *)(v5 - 8);
do
v4 = __ldaxr(v3);
while ( __stlxr(v4 - 1, v3) );
}
else
{
v4 = *(_DWORD *)(v5 - 8);
*(_DWORD *)(v5 - 8) = v4 - 1;
}
if ( v4 <= 0 )
operator delete(v2);
}
}
}