//
// GameLevelManager::collectPlatformerJournalKeys from 0x82fb98 to 0x82fed8 (832 bytes)
//
// 3 xrefs:
// > GameManager::didEncodeForSave @ 0x7149b4
// > LocalLevelManager::didEncodeForSave @ 0x91401c
// > ??> @ 0x738d0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 12:55:08 +0000
//
void **__usercall GameLevelManager::collectPlatformerJournalKeys@(
void **__return_ptr a1@,
unsigned __int8 a2@)
{
int v3; // w22
DS_Dictionary *v5; // x20
char *v6; // x0
char *v7; // x2
char *v9; // x23
char *v10; // x19
const char *v11; // x1
int v12; // w0
int v13; // w21
int IntegerForKey; // w26
unsigned __int64 v15; // x0
unsigned __int64 v16; // x1
__int64 v17; // x3
char *v18; // x0
char *v19; // x2
char *v20; // x19
char *v21; // x0
std::mutex *v22; // [xsp+68h] [xbp+68h]
void *v23; // [xsp+70h] [xbp+70h] BYREF
char *v24; // [xsp+78h] [xbp+78h]
__int64 v25; // [xsp+88h] [xbp+88h] BYREF
__int64 v26; // [xsp+90h] [xbp+90h]
void *v27; // [xsp+98h] [xbp+98h]
int v28; // [xsp+A0h] [xbp+A0h]
v3 = a2;
v22 = (std::mutex *)qword_155C990;
std::mutex::lock((std::mutex *)qword_155C990);
*a1 = nullptr;
a1[1] = nullptr;
a1[2] = nullptr;
v5 = (DS_Dictionary *)operator new(0xF0u);
DS_Dictionary::DS_Dictionary(v5);
if ( !(unsigned __int8)sub_82FA7C((__int64)v5) )
{
v6 = *((char **)v5 + 26);
if ( v6 )
{
v7 = *((char **)v5 + 27);
if ( v7 != v6 )
*((_QWORD *)v5 + 27) = &v7[8 * ~((unsigned __int64)(v7 - 8 - v6) >> 3)];
operator delete(v6);
}
pugi::xml_document::~xml_document(v5);
operator delete(v5);
goto LABEL_7;
}
DS_Dictionary::getAllKeys((__int64 *)&v23, v5);
v9 = v24;
v10 = (char *)v23;
if ( v23 != v24 )
{
do
{
while ( 1 )
{
v11 = v10 + 1;
if ( (*v10 & 1) != 0 )
v11 = *((const char **)v10 + 2);
v12 = (unsigned __int8)DS_Dictionary::stepIntoSubDictWithKey(v5, v11);
v13 = 0;
if ( (_BYTE)v12 )
break;
if ( v3 == v12 )
goto LABEL_16;
LABEL_11:
v10 += 24;
if ( v9 == v10 )
goto LABEL_22;
}
IntegerForKey = DS_Dictionary::getIntegerForKey(v5, "t");
v13 = DS_Dictionary::getIntegerForKey(v5, "sq");
DS_Dictionary::stepOutOfSubDict(v5);
if ( v3 != (IntegerForKey == 2) )
goto LABEL_11;
LABEL_16:
std::string::basic_string((unsigned __int64)&v25, v10);
v15 = (unsigned __int64)a1[1];
v16 = (unsigned __int64)a1[2];
v28 = v13;
if ( v15 >= v16 )
{
std::vector>::__push_back_slow_path>(a1, (__int64)&v25);
}
else
{
if ( v15 )
{
v17 = v26;
*(_QWORD *)v15 = v25;
*(_QWORD *)(v15 + 8) = v17;
*(_QWORD *)(v15 + 16) = v27;
v25 = 0;
v26 = 0;
v27 = nullptr;
*(_DWORD *)(v15 + 24) = v28;
v15 = (unsigned __int64)a1[1];
}
a1[1] = (void *)(v15 + 32);
}
if ( (v25 & 1) == 0 )
goto LABEL_11;
v10 += 24;
operator delete(v27);
}
while ( v9 != v10 );
}
LABEL_22:
v18 = *((char **)v5 + 26);
if ( v18 )
{
v19 = *((char **)v5 + 27);
if ( v18 != v19 )
*((_QWORD *)v5 + 27) = &v19[8 * ~((unsigned __int64)(v19 - 8 - v18) >> 3)];
operator delete(v18);
}
pugi::xml_document::~xml_document(v5);
operator delete(v5);
v20 = (char *)v23;
if ( v23 )
{
v21 = v24;
if ( v23 != v24 )
{
do
{
v24 = v21 - 24;
std::string::~string((__int64)(v21 - 24));
v21 = v24;
}
while ( v20 != v24 );
v21 = (char *)v23;
}
operator delete(v21);
}
LABEL_7:
std::mutex::unlock(v22);
return a1;
}