//
// sub_4CA99C from 0x4ca99c to 0x4cab7e (482 bytes)
//
// 2 xrefs:
// > GameLevelManager::removePlatformerSaveJournalEntry @ 0x4cabc8
// > GameLevelManager::writePlatformerSaveJournal @ 0x4caeee
//
// 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:37 +0000
//
_DWORD *__fastcall sub_4CA99C(_DWORD *a1, int a2)
{
char *v4; // r1
size_t v5; // r2
_DWORD *v6; // r0
int v7; // r1
int v8; // r2
int *v9; // r0
cocos2d::CCString *v10; // r0
char *v11; // r0
int *v12; // r0
int v13; // r1
int v14; // r2
int *v15; // r0
int v16; // r1
int v17; // r2
cocos2d::CCString *v18; // r0
char *v19; // r0
_DWORD *v20; // r0
int v21; // r1
int v22; // r2
size_t v23; // r2
cocos2d::CCString *v24; // r0
char *CString; // r0
_DWORD *v26; // r3
int v27; // r1
int v28; // r2
int v30[3]; // [sp+0h] [bp-2Ch] BYREF
int v31; // [sp+Ch] [bp-20h] BYREF
int v32; // [sp+10h] [bp-1Ch]
int v33; // [sp+14h] [bp-18h]
int v34; // [sp+18h] [bp-14h] BYREF
size_t v35; // [sp+1Ch] [bp-10h]
char *v36; // [sp+20h] [bp-Ch]
if ( *(_DWORD *)(a2 + 952) == 2 )
{
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, "l", 1u);
GJGameLevel::generateAutoSaveUID((GJGameLevel *)&v34, a2);
if ( (v34 & 1) != 0 )
{
v4 = v36;
v5 = v35;
}
else
{
v5 = (int)(unsigned __int8)v34 >> 1;
v4 = (char *)&v34 + 1;
}
v6 = std::string::append(&v31, v4, v5);
v7 = v6[1];
v8 = v6[2];
*a1 = *v6;
a1[1] = v7;
a1[2] = v8;
*v6 = 0;
v6[1] = 0;
v6[2] = 0;
std::string::~string((int)&v34);
v9 = &v31;
}
else if ( *(_DWORD *)(a2 + 744) - *(_DWORD *)(a2 + 748) <= 0 )
{
v23 = *(unsigned __int8 *)(a2 + 477);
if ( *(_BYTE *)(a2 + 477) )
{
v34 = 0;
v35 = 0;
v36 = nullptr;
std::string::__init(&v34, &a1i2r3e45s789g[12], 1u);
}
else
{
v34 = *(unsigned __int8 *)(a2 + 477);
v35 = v23;
v36 = (char *)v23;
std::string::__init(&v34, "o", 1u);
}
v24 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(*(_DWORD *)(a2 + 268) - *(_DWORD *)(a2 + 272)));
CString = (char *)cocos2d::CCString::getCString(v24);
v26 = std::string::append(&v34, CString);
v27 = v26[1];
v28 = v26[2];
*a1 = *v26;
a1[1] = v27;
a1[2] = v28;
v9 = &v34;
*v26 = 0;
v26[1] = 0;
v26[2] = 0;
}
else
{
memset(v30, 0, sizeof(v30));
std::string::__init(v30, "d", 1u);
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(*(_DWORD *)(a2 + 744) - *(_DWORD *)(a2 + 748)));
v11 = (char *)cocos2d::CCString::getCString(v10);
v12 = std::string::append(v30, v11);
v13 = v12[1];
v14 = v12[2];
v31 = *v12;
v32 = v13;
v33 = v14;
*v12 = 0;
v12[1] = 0;
v12[2] = 0;
v15 = std::string::append(&v31, "_");
v16 = v15[1];
v17 = v15[2];
v34 = *v15;
v35 = v16;
v36 = (char *)v17;
*v15 = 0;
v15[1] = 0;
v15[2] = 0;
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(*(_DWORD *)(a2 + 268) - *(_DWORD *)(a2 + 272)));
v19 = (char *)cocos2d::CCString::getCString(v18);
v20 = std::string::append(&v34, v19);
v21 = v20[1];
v22 = v20[2];
*a1 = *v20;
a1[1] = v21;
a1[2] = v22;
*v20 = 0;
v20[1] = 0;
v20[2] = 0;
std::string::~string((int)&v34);
std::string::~string((int)&v31);
v9 = v30;
}
std::string::~string((int)v9);
return a1;
}