//
// LevelAreaInnerLayer::playStep1 from 0x1403e16c0 to 0x1403e17f4 (308 bytes)
//
// 2 xrefs:
// > LevelAreaInnerLayer::onDoor @ 0x1403e167b
// > ??> @ 0x140924e18
//
// 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 11:31:41 +0000
//
// Hidden C++ exception states: #wind=3
bool __fastcall LevelAreaInnerLayer::playStep1(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rcx
__int64 MainLevel; // rdi
unsigned int v5; // ebx
__int64 v6; // rcx
__int64 v7; // rax
__int64 MainLevelString; // rax
__int64 v9; // rbx
void *v10; // rdx
struct cocos2d::CCScene *v11; // rax
struct cocos2d::CCScene *v12; // rbx
__int64 v13; // rcx
cocos2d::CCDirector *v14; // rax
_BYTE v16[40]; // [rsp+20h] [rbp-28h] BYREF
void *v17; // [rsp+50h] [rbp+8h]
void *v18; // [rsp+50h] [rbp+8h]
v2 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v17 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v17);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = qword_14090BFD0;
}
*(_DWORD *)(v2 + 740) = 15;
*(_BYTE *)(a1 + 432) = 1;
v3 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v18 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v18);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v3 = *(_QWORD *)&qword_14090BFB0;
}
MainLevel = GameLevelManager::getMainLevel(v3, *(_DWORD *)(a1 + 428), 1u);
v5 = *(_DWORD *)(a1 + 428);
v7 = LocalLevelManager::sharedState(v6);
MainLevelString = LocalLevelManager::getMainLevelString(v7, v16, v5);
v9 = MainLevelString;
if ( MainLevel + 408 != MainLevelString )
{
v10 = (void *)MainLevelString;
if ( *(_QWORD *)(MainLevelString + 24) > 0xFu )
v10 = *(void **)MainLevelString;
sub_1400405A0((void **)(MainLevel + 408), v10, *(_QWORD *)(MainLevelString + 16));
}
sub_14003D310(v9);
v11 = (struct cocos2d::CCScene *)PlayLayer::scene(MainLevel, 0);
v12 = cocos2d::CCTransitionFade::create(0.5, v11);
v14 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v13);
return cocos2d::CCDirector::replaceScene(v14, v12);
}