//
// PlayLayer::loadPersistentCheckpoint from 0x402b4c to 0x402ce4 (408 bytes)
//
// 3 xrefs:
// > LevelInfoLayer::loadLevelStep @ 0x499c16
// > EditLevelLayer::playStep3 @ 0x49f518
// > EditLevelLayer::onTest @ 0x49f864
//
// 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:47:25 +0000
//
int __fastcall PlayLayer::loadPersistentCheckpoint(int a1, int a2)
{
int v4; // r5
const char *v5; // r1
GameObject *v6; // r0
GameObject *v7; // r6
void (__fastcall *v8)(GameObject *, _BYTE *); // r10
const char *v9; // r1
int v10; // r1
int v11; // r6
int v12; // r6
cocos2d::CCString *v13; // r0
int CString; // r0
_BYTE v16[8]; // [sp+4h] [bp-28h] BYREF
_BYTE v17[12]; // [sp+Ch] [bp-20h] BYREF
_BYTE v18[12]; // [sp+18h] [bp-14h] BYREF
v4 = CheckpointObject::create((CheckpointObject *)a1);
cocos2d::ZipUtils::decompressString(v17, a2, 0, 11);
deserializeCheckpoint(v4, v17, a1);
v6 = (GameObject *)GameObject::createWithFrame((GameObject *)"checkpoint_01_001.png", v5);
*((_DWORD *)v6 + 223) = 44;
v7 = v6;
(*(void (__fastcall **)(GameObject *))(*(_DWORD *)v6 + 632))(v6);
v8 = *(void (__fastcall **)(GameObject *, _BYTE *))(*(_DWORD *)v7 + 684);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v16, (const cocos2d::CCPoint *)(*(_DWORD *)(v4 + 2292) + 264));
v8(v7, v16);
CheckpointObject::setObject((CheckpointObject *)v4, v7);
PlayLayer::storeCheckpoint((cocos2d::CCArray **)a1, (CheckpointObject *)v4);
PlayLayer::setLastSavedCheckpoint((CheckpointObject **)a1, (CheckpointObject *)v4);
GameObject::makeInvisible(v7);
GJEffectManager::loadPersistentState(*(_DWORD *)(a1 + 1524), v4 + 2724, v4 + 2744, v4 + 2764);
(*(void (__fastcall **)(int))(*(_DWORD *)a1 + 804))(a1);
*(_BYTE *)(a1 + 10839) = 1;
v9 = *(const char **)(v4 + 2676);
if ( (int)v9 > 0 )
{
*(_DWORD *)(a1 + 10588) = v9;
*(_QWORD *)(a1 + 12160) = *(_QWORD *)(v4 + 2680);
*(_QWORD *)(a1 + 12168) = *(_QWORD *)(v4 + 2688);
*(_DWORD *)(a1 + 10584) = *(_DWORD *)(v4 + 2696);
*(_QWORD *)(a1 + 11256) = *(_QWORD *)(v4 + 2704);
*(_DWORD *)(a1 + 11264) = *(_DWORD *)(v4 + 2712);
*(_DWORD *)(a1 + 11268) = *(_DWORD *)(v4 + 2716);
*(_DWORD *)(a1 + 12084) = *(_DWORD *)(v4 + 2720);
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Attempt %i", v9);
CString = cocos2d::CCString::getCString(v13);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 11900) + 464))(*(_DWORD *)(a1 + 11900), CString);
}
v10 = *(_DWORD *)(a1 + 1408);
v11 = *(unsigned __int8 *)(v10 + 1160);
if ( (v11 & 1) != 0 )
v12 = *(_DWORD *)(v10 + 1164);
else
v12 = v11 >> 1;
if ( v12 )
{
cocos2d::ZipUtils::decompressString(v18, v10 + 1160, 0, 11);
GJBaseGameLayer::restoreRecording(a1, v18);
std::string::~string((int)v18);
}
*(_BYTE *)(a1 + 11789) = 1;
return std::string::~string((int)v17);
}