//
// GameLevelManager::onRestoreItemsCompleted from 0x80bed4 to 0x80c0d4 (512 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x85c974
// > ??> @ 0x65e18
//
// 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:54:48 +0000
//
__int64 __fastcall GameLevelManager::onRestoreItemsCompleted(GameLevelManager *a1, __int64 a2)
{
_BOOL4 v3; // w22
__int64 v4; // x19
__int64 v6; // x22
char v7; // w0
__int64 v8; // x0
__int64 v9; // x1
__int64 v10; // [xsp+40h] [xbp+40h] BYREF
__int64 v11; // [xsp+48h] [xbp+48h]
void *v12; // [xsp+50h] [xbp+50h]
GameLevelManager::removeDLFromActive(a1, "restoreKey");
v10 = 0;
v11 = 0;
v12 = nullptr;
std::string::__init(&v10, &word_117CE08, 2u);
v3 = sub_7FEA60(a2, (__int64)&v10);
if ( (v10 & 1) != 0 )
operator delete(v12);
if ( v3 )
{
v10 = 0;
v11 = 0;
v12 = nullptr;
std::string::__init(&v10, "No restore data found.", 0x16u);
v4 = FLAlertLayer::create(0, (cocos2d::CCLabelBMFont *)"Error", (char *)&v10, (ButtonSprite *)"OK", nullptr, 300.0);
if ( (v10 & 1) != 0 )
operator delete(v12);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v4 + 1312LL))(v4);
}
else
{
v10 = 0;
v11 = 0;
v12 = nullptr;
std::string::__init(&v10, "Your data has been restored.", 0x1Cu);
v6 = FLAlertLayer::create(
0,
(cocos2d::CCLabelBMFont *)"Data restored",
(char *)&v10,
(ButtonSprite *)"OK",
nullptr,
300.0);
if ( (v10 & 1) != 0 )
operator delete(v12);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 1312LL))(v6);
v10 = 0;
v7 = *(_BYTE *)a2;
v11 = 0;
v12 = nullptr;
if ( (v7 & 1) != 0 )
{
std::string::__init(&v10, *(void **)(a2 + 16), *(_QWORD *)(a2 + 8));
}
else
{
v8 = *(_QWORD *)a2;
v9 = *(_QWORD *)(a2 + 8);
v12 = *(void **)(a2 + 16);
v10 = v8;
v11 = v9;
}
GameLevelManager::parseRestoreData();
if ( (v10 & 1) != 0 )
operator delete(v12);
}
return _stack_chk_guard;
}