//
// GameLevelManager::prunePlatformerJournalKeys from 0x4b5cf0 to 0x4b5dba (202 bytes)
//
// 2 xrefs:
// > GameManager::saveFinished @ 0x41518a
// > LocalLevelManager::saveFinished @ 0x5443e4
//
// 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:50:08 +0000
//
void __fastcall GameLevelManager::prunePlatformerJournalKeys(int a1, _DWORD *a2)
{
std::mutex *v3; // r6
DS_Dictionary *v4; // r4
unsigned int i; // r7
int v6; // r1
const char *v7; // r1
int IntegerForKey; // r10
int v9; // r1
const char *v10; // r1
if ( *a2 != a2[1] )
{
v3 = (std::mutex *)dword_D2BB34;
std::mutex::lock((std::mutex *)dword_D2BB34);
v4 = (DS_Dictionary *)operator new(0xD8u);
DS_Dictionary::DS_Dictionary(v4);
if ( sub_4B5ADC(v4) )
{
for ( i = 0; i < (a2[1] - *a2) >> 4; ++i )
{
v6 = *a2 + 16 * i;
if ( (*(_BYTE *)v6 & 1) != 0 )
v7 = *(const char **)(v6 + 8);
else
v7 = (const char *)(v6 + 1);
if ( DS_Dictionary::stepIntoSubDictWithKey(v4, v7) )
{
IntegerForKey = DS_Dictionary::getIntegerForKey(v4, "sq");
DS_Dictionary::stepOutOfSubDict(v4);
}
else
{
IntegerForKey = -1;
}
v9 = *a2 + 16 * i;
if ( IntegerForKey == *(_DWORD *)(v9 + 12) )
{
if ( (*(_BYTE *)(*a2 + 16 * i) & 1) != 0 )
v10 = *(const char **)(v9 + 8);
else
v10 = (const char *)(v9 + 1);
DS_Dictionary::removeKey(v4, v10);
}
}
sub_4B5A60();
}
DS_Dictionary::~DS_Dictionary(v4);
operator delete(v4);
std::mutex::unlock(v3);
}
}