//
// sub_833644 from 0x833644 to 0x833a48 (1028 bytes)
//
// 2 xrefs:
// > GameLevelManager::clearPlatformerSaveJournal @ 0x833a78
// > GameLevelManager::removePlatformerSaveJournalEntry @ 0x83c6d8
//
// 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:10 +0000
//
__int64 __fastcall sub_833644(int a1, __int64 a2)
{
std::mutex *v4; // x28
DS_Dictionary *v5; // x22
char *v6; // x0
char *v7; // x2
char *v9; // x19
char *v10; // x24
const char *v11; // x20
unsigned __int64 v12; // x0
char *v13; // x20
char *v14; // x19
const char *v15; // x1
char *v16; // x0
char *v17; // x2
char *v18; // x19
char *v19; // x0
char *v20; // x19
char *v21; // x0
const char *v22; // x1
size_t v23; // x2
__int64 v24; // x1
unsigned __int8 *v25; // x0
unsigned __int8 *v26; // x1
unsigned __int8 *v27; // x3
unsigned __int8 *v28; // x2
int v29; // t1
int IntegerForKey; // w25
_BOOL4 v31; // w0
void *v32; // [xsp+78h] [xbp+78h] BYREF
char *v33; // [xsp+80h] [xbp+80h]
char *v34; // [xsp+88h] [xbp+88h]
void *v35; // [xsp+90h] [xbp+90h] BYREF
char *v36; // [xsp+98h] [xbp+98h]
v4 = (std::mutex *)qword_155C990;
std::mutex::lock((std::mutex *)qword_155C990);
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 ( v6 != v7 )
*((_QWORD *)v5 + 27) = &v7[8 * ~((unsigned __int64)(v7 - 8 - v6) >> 3)];
operator delete(v6);
}
pugi::xml_document::~xml_document(v5);
operator delete(v5);
std::mutex::unlock(v4);
return _stack_chk_guard;
}
v32 = nullptr;
v33 = nullptr;
v34 = nullptr;
DS_Dictionary::getAllKeys((__int64 *)&v35, v5);
v9 = (char *)v35;
v10 = v36;
v11 = (char *)v35 + 1;
if ( v35 != v36 )
{
while ( 1 )
{
if ( !a1 )
goto LABEL_10;
if ( a1 == 3 )
break;
v22 = v11;
if ( (*v9 & 1) != 0 )
v22 = *((const char **)v9 + 2);
if ( (unsigned __int8)DS_Dictionary::stepIntoSubDictWithKey(v5, v22) )
{
IntegerForKey = DS_Dictionary::getIntegerForKey(v5, "t");
DS_Dictionary::stepOutOfSubDict(v5);
v31 = IntegerForKey == 2;
if ( a1 != 2 )
v31 = IntegerForKey != 2;
if ( !v31 )
goto LABEL_14;
goto LABEL_10;
}
if ( a1 != 2 )
{
v12 = (unsigned __int64)v33;
if ( v33 != v34 )
{
LABEL_11:
if ( v12 )
{
std::string::basic_string(v12, v9);
v12 = (unsigned __int64)v33;
}
v33 = (char *)(v12 + 24);
goto LABEL_14;
}
goto LABEL_41;
}
LABEL_14:
v9 += 24;
v11 += 24;
if ( v10 == v9 )
goto LABEL_15;
}
v23 = (unsigned __int8)*v9 >> 1;
if ( (*v9 & 1) != 0 )
v23 = *((_QWORD *)v9 + 1);
v24 = *(_BYTE *)a2 >> 1;
if ( (*(_BYTE *)a2 & 1) != 0 )
v24 = *(_QWORD *)(a2 + 8);
if ( v23 != v24 )
goto LABEL_14;
v25 = (unsigned __int8 *)v11;
if ( (*v9 & 1) != 0 )
v25 = *((unsigned __int8 **)v9 + 2);
v26 = (unsigned __int8 *)(a2 + 1);
if ( (*(_BYTE *)a2 & 1) != 0 )
v26 = *(unsigned __int8 **)(a2 + 16);
if ( (*v9 & 1) != 0 )
{
if ( v23 && memcmp(v25, v26, v23) )
goto LABEL_14;
}
else if ( v23 )
{
if ( *v25 != *v26 )
goto LABEL_14;
v27 = v25 + 1;
v28 = &v25[v23];
while ( 1 )
{
++v26;
if ( v27 == v28 )
break;
v29 = *v27++;
if ( *v26 != v29 )
goto LABEL_14;
}
}
LABEL_10:
v12 = (unsigned __int64)v33;
if ( v33 != v34 )
goto LABEL_11;
LABEL_41:
std::vector::__push_back_slow_path((__int64 *)&v32, v9);
goto LABEL_14;
}
LABEL_15:
v13 = v33;
v14 = (char *)v32;
if ( v32 != v33 )
{
do
{
v15 = v14 + 1;
if ( (*v14 & 1) != 0 )
v15 = *((const char **)v14 + 2);
DS_Dictionary::removeKey(v5, v15);
v14 += 24;
}
while ( v13 != v14 );
sub_82F964(v5);
}
v16 = *((char **)v5 + 26);
if ( v16 )
{
v17 = *((char **)v5 + 27);
if ( v16 != v17 )
*((_QWORD *)v5 + 27) = &v17[8 * ~((unsigned __int64)(v17 - 8 - v16) >> 3)];
operator delete(v16);
}
pugi::xml_document::~xml_document(v5);
operator delete(v5);
v18 = (char *)v35;
if ( v35 )
{
v19 = v36;
if ( v35 != v36 )
{
do
{
v36 = v19 - 24;
std::string::~string((__int64)(v19 - 24));
v19 = v36;
}
while ( v18 != v36 );
v19 = (char *)v35;
}
operator delete(v19);
}
v20 = (char *)v32;
if ( v32 )
{
v21 = v33;
if ( v32 != v33 )
{
do
{
v33 = v21 - 24;
std::string::~string((__int64)(v21 - 24));
v21 = v33;
}
while ( v20 != v33 );
v21 = (char *)v32;
}
operator delete(v21);
}
std::mutex::unlock(v4);
return _stack_chk_guard;
}