//
// sub_10054C9E0 from 0x10054c9e0 to 0x10054cacd (237 bytes)
//
// 5 xrefs:
// > GameLevelManager::writePlatformerSaveJournal @ 0x10054c5eb
// > GameLevelManager::replayPlatformerSaveJournal @ 0x10054d000
// > sub_10054D820 @ 0x10054d870
// > sub_10054DBF0 @ 0x10054dc38
// > sub_10054DDE0 @ 0x10054de1e
//
// This function is hookable on this platform (idp: pc, 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:32:01 +0000
//
__int64 __fastcall sub_10054C9E0(__int64 a1, __int64 a2)
{
__int64 v2; // r14
std::string *v3; // rax
char *v4; // rsi
std::string::value_type *v5; // r14
unsigned int RootSubDictFromString; // ebx
__int64 v8; // [rsp+8h] [rbp-58h] BYREF
__int128 v9; // [rsp+10h] [rbp-50h] BYREF
void *__p; // [rsp+20h] [rbp-40h]
std::string v11; // [rsp+30h] [rbp-30h] BYREF
v8 = 0;
v2 = cocos2d::CCFileUtils::sharedFileUtils(a1, a2);
sub_1004F5360(&v11);
v3 = std::string::append(&v11, "CCPlatformerSave.dat");
__p = v3->__r_.__value_.__l.__data_;
v9 = *(_OWORD *)&v3->__r_.__value_.__l.0;
*(_OWORD *)&v3->__r_.__value_.__l.0 = 0;
v3->__r_.__value_.__r.__words[2] = 0;
if ( (*(_BYTE *)&v11.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v11.__r_.__value_.__l.__data_);
if ( (v9 & 1) != 0 )
v4 = (char *)__p;
else
v4 = (char *)&v9 + 1;
v5 = (std::string::value_type *)(*(__int64 (__fastcall **)(__int64, char *, const char *, __int64 *))(*(_QWORD *)v2 + 32LL))(
v2,
v4,
"r",
&v8);
if ( (v9 & 1) != 0 )
operator delete(__p);
if ( v5 )
{
cocos2d::ZipUtils::decompressString2(&v11, v5, 0, v8, 11);
operator delete[](v5);
RootSubDictFromString = DS_Dictionary::loadRootSubDictFromString(a1, (unsigned __int8 *)&v11);
if ( (*(_BYTE *)&v11.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v11.__r_.__value_.__l.__data_);
}
else
{
return 0;
}
return RootSubDictFromString;
}