//
// sub_1001E09D0 from 0x1001e09d0 to 0x1001e0c06 (566 bytes)
//
// 0 xrefs:
//
// 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:26:28 +0000
//
__int64 __fastcall sub_1001E09D0(__int64 a1, __int64 a2)
{
__int64 v3; // rdi
unsigned int v4; // eax
__int64 v5; // rcx
unsigned int v6; // eax
_BYTE *v7; // rbx
__int64 v9; // rdi
__int64 v10; // rdx
unsigned int v11; // r14d
__int64 v12; // rax
double v13; // xmm0_8
__int64 v14; // rax
__int64 v15; // rdi
__int64 v16; // rsi
_DWORD *v17; // r14
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rbx
char *v21; // rax
_QWORD v22[2]; // [rsp+8h] [rbp-28h] BYREF
void *__p; // [rsp+18h] [rbp-18h]
v3 = *(_QWORD *)(a1 + 472);
v4 = *(unsigned __int8 *)(v3 + 1472);
if ( (v4 & 1) != 0 )
{
if ( !*(_QWORD *)(v3 + 1480) )
goto LABEL_8;
}
else if ( !(v4 >> 1) )
{
goto LABEL_8;
}
if ( *(_DWORD *)(v3 + 1520) != *(_DWORD *)(v3 + 788) || *(_DWORD *)(v3 + 1524) != 4 )
sub_1005839A0(v3);
LABEL_8:
if ( !*(_BYTE *)(a1 + 536) )
{
v5 = *(_QWORD *)(a1 + 472);
v6 = *(unsigned __int8 *)(v5 + 1472);
if ( (v6 & 1) != 0 )
{
if ( *(_QWORD *)(v5 + 1480) )
goto LABEL_11;
}
else if ( v6 >> 1 )
{
LABEL_11:
__p = operator new(0x60u);
v22[0] = 97;
v22[1] = 91;
strcpy(
(char *)__p,
"There is a saved checkpoint for this level.\nDo you want to load it?");
v7 = (_BYTE *)FLAlertLayer::create_1(a1 + 416, "Load Save", v22, "New Game", "Load Save", 380.0);
if ( (v22[0] & 1) != 0 )
operator delete(__p);
sub_100494AC0(v7);
v7[656] = 1;
(*(void (__fastcall **)(_BYTE *, __int64))(*(_QWORD *)v7 + 72LL))(v7, 11);
return (*(__int64 (__fastcall **)(_BYTE *))(*(_QWORD *)v7 + 1312LL))(v7);
}
}
v9 = *(_QWORD *)(a1 + 480);
if ( (unsigned int)sub_1007FEF90(v9) )
{
v11 = 0;
do
{
v12 = sub_1007FEFE0(*(_QWORD *)(a1 + 480), v11);
a2 = 0;
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v12 + 1160LL))(v12, 0);
++v11;
v9 = *(_QWORD *)(a1 + 480);
}
while ( v11 < (unsigned int)sub_1007FEF90(v9) );
}
*(_QWORD *)&v13 = GameManager::sharedState(v9, a2, v10).u64[0];
*(_DWORD *)(v14 + 708) = 3;
v15 = *(_QWORD *)(a1 + 472);
v16 = 0;
v17 = PlayLayer::scene(v15, 0);
if ( *(_BYTE *)(a1 + 536) == 1 )
{
v18 = (*(__int64 (__fastcall **)(_DWORD *, double))(*(_QWORD *)v17 + 488LL))(v17, v13);
v19 = sub_1007FEFE0(v18, 0);
v16 = *(_QWORD *)(a1 + 472) + 1472LL;
v15 = v19;
PlayLayer::loadPersistentCheckpoint(v19);
*(_BYTE *)(a1 + 536) = 0;
}
v20 = cocos2d::CCDirector::sharedDirector(v15, v16);
v21 = cocos2d::CCTransitionFade::create_1((__int64)v17, 0.5);
return cocos2d::CCDirector::replaceScene(v20, v21);
}