//
// LocalLevelManager::didEncodeForSave from 0x544204 to 0x5443b8 (436 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:52:22 +0000
//
int __fastcall LocalLevelManager::didEncodeForSave(LocalLevelManager *this)
{
char v2; // r0
int v3; // r5
int v4; // r0
int v5; // r0
int v6; // r3
int v7; // r3
int v8; // r3
int v9; // r0
int v10; // r1
int v11; // r2
int v12; // r2
int v13; // r2
int v14; // r9
int v15; // r2
char *v16; // r1
size_t v17; // r2
int *v18; // r0
int v19; // r1
int v20; // r2
int v21; // r0
int v22; // r1
int v23; // r2
int v25; // [sp+4h] [bp+0h] BYREF
int v26; // [sp+8h] [bp+4h]
int v27; // [sp+Ch] [bp+8h]
int v28; // [sp+10h] [bp+Ch] BYREF
int v29; // [sp+14h] [bp+10h]
int v30; // [sp+18h] [bp+14h]
_DWORD v31[3]; // [sp+1Ch] [bp+18h] BYREF
int v32; // [sp+28h] [bp+24h] BYREF
int v33; // [sp+2Ch] [bp+28h]
int v34; // [sp+30h] [bp+2Ch]
v2 = GameLevelManager::sharedState(this);
GameLevelManager::collectPlatformerJournalKeys((GameLevelManager *)&v25, v2, 1);
v3 = *((_DWORD *)this + 81);
if ( v3 )
{
while ( 1 )
{
v4 = *((_DWORD *)this + 82);
if ( v3 == v4 )
break;
v5 = v4 - 16;
*((_DWORD *)this + 82) = v5;
std::string::~string(v5);
}
operator delete(*((void **)this + 81));
}
v6 = v25;
v25 = 0;
*((_DWORD *)this + 81) = v6;
v7 = v26;
v26 = 0;
*((_DWORD *)this + 82) = v7;
v8 = v27;
v27 = 0;
*((_DWORD *)this + 83) = v8;
std::__vector_base>::~__vector_base((int)&v25);
std::mutex::lock((LocalLevelManager *)((char *)this + 336));
if ( *((_BYTE *)this + 376) )
{
v28 = 0;
v29 = 0;
v30 = 0;
std::string::__init(&v28, &unk_B6B226, 0);
}
else
{
std::string::basic_string(&v28, (int)this + 340);
}
if ( (*((_BYTE *)this + 352) & 1) != 0 )
{
**((_BYTE **)this + 90) = 0;
*((_DWORD *)this + 89) = 0;
}
else
{
*((_BYTE *)this + 353) = 0;
*((_BYTE *)this + 352) = 0;
}
std::string::reserve((int *)this + 88, 0);
v9 = v28;
v10 = v29;
v11 = v30;
v28 = 0;
v29 = 0;
v30 = 0;
*((_DWORD *)this + 88) = v9;
*((_DWORD *)this + 89) = v10;
*((_DWORD *)this + 90) = v11;
std::string::~string((int)&v28);
v12 = *((unsigned __int8 *)this + 352);
if ( (v12 & 1) != 0 )
v13 = *((_DWORD *)this + 89);
else
v13 = v12 >> 1;
if ( v13 )
{
GameToolbox::getSaveDirectory((GameToolbox *)v31);
v15 = *((unsigned __int8 *)this + 352);
if ( (v15 & 1) != 0 )
{
v16 = *((char **)this + 90);
v17 = *((_DWORD *)this + 89);
}
else
{
v16 = (char *)this + 353;
v17 = v15 >> 1;
}
v18 = std::string::append(v31, v16, v17);
v14 = 1;
v19 = v18[1];
v20 = v18[2];
v32 = *v18;
v33 = v19;
v34 = v20;
*v18 = 0;
v18[1] = 0;
v18[2] = 0;
}
else
{
v32 = 0;
v33 = 0;
v34 = 0;
std::string::__init(&v32, &unk_B6B226, 0);
v14 = 0;
}
if ( (*((_BYTE *)this + 364) & 1) != 0 )
{
**((_BYTE **)this + 93) = 0;
*((_DWORD *)this + 92) = 0;
}
else
{
*((_BYTE *)this + 365) = 0;
*((_BYTE *)this + 364) = 0;
}
std::string::reserve((int *)this + 91, 0);
v21 = v32;
v22 = v33;
v23 = v34;
v32 = 0;
v33 = 0;
v34 = 0;
*((_DWORD *)this + 91) = v21;
*((_DWORD *)this + 92) = v22;
*((_DWORD *)this + 93) = v23;
std::string::~string((int)&v32);
if ( v14 )
std::string::~string((int)v31);
return std::mutex::unlock((LocalLevelManager *)((char *)this + 336));
}