//
// GameLevelManager::onRestoreItemsCompleted from 0x1005228b0 to 0x100522a3d (397 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x10051c76e
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GameLevelManager::onRestoreItemsCompleted(GameLevelManager *a1, unsigned __int8 *a2)
{
const void *v2; // rdi
unsigned __int64 v3; // rcx
size_t v4; // rdx
char *v5; // rbx
char *v6; // r14
_WORD __s2[11]; // [rsp+9h] [rbp-77h] BYREF
__int128 v8; // [rsp+20h] [rbp-60h] BYREF
void *v9; // [rsp+30h] [rbp-50h]
_QWORD v10[2]; // [rsp+38h] [rbp-48h] BYREF
void *v11; // [rsp+48h] [rbp-38h]
void *v12[6]; // [rsp+50h] [rbp-30h] BYREF
GameLevelManager::removeDLFromActive(a1, "restoreKey");
strcpy((char *)__s2, "-1");
v2 = a2 + 1;
v3 = *a2 >> 1;
if ( (*a2 & 1) != 0 )
{
v2 = *((const void **)a2 + 2);
v3 = *((_QWORD *)a2 + 1);
}
v4 = 2;
if ( v3 < 2 )
v4 = v3;
if ( (v3 != 2) | (memcmp(v2, __s2, v4) != 0) )
{
v11 = operator new(0x20u);
v10[0] = 33;
v10[1] = 28;
strcpy((char *)v11, "Your data has been restored.");
v6 = FLAlertLayer::create_1(0, (int)"Data restored", (__int64)v10, (int)"OK", 0, COERCE_DOUBLE(1133903872));
if ( (v10[0] & 1) != 0 )
operator delete(v11);
(*(void (__fastcall **)(char *))(*(_QWORD *)v6 + 1288LL))(v6);
if ( (*a2 & 1) != 0 )
{
sub_100006B70(&v8, *((const void **)a2 + 2), *((_QWORD *)a2 + 1), COERCE_DOUBLE(1133903872));
if ( (v8 & 1) == 0 )
return;
}
else
{
v9 = *((void **)a2 + 2);
v8 = *(_OWORD *)a2;
if ( (v8 & 1) == 0 )
return;
}
operator delete(v9);
return;
}
strcpy((char *)v12, ",No restore data found.");
v5 = FLAlertLayer::create_1(0, (int)"Error", (__int64)v12, (int)"OK", 0, COERCE_DOUBLE(1133903872));
if ( ((__int64)v12[0] & 1) != 0 )
operator delete(v12[2]);
(*(void (__fastcall **)(char *))(*(_QWORD *)v5 + 1288LL))(v5);
}