//
// LevelListLayer::onBack from 0x14042ef00 to 0x14042f324 (1060 bytes)
//
// 2 xrefs:
// > ??> @ 0x14078f8a8
// > ??> @ 0x140926ba0
//
// 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:32:14 +0000
//
// Hidden C++ exception states: #wind=9
void __fastcall LevelListLayer::onBack(struct cocos2d::CCObject *a1)
{
struct cocos2d::CCScene *v2; // rsi
__int64 v3; // rcx
bool v4; // bl
bool v5; // bl
void **v6; // rcx
void **v7; // rdx
void **v8; // rcx
void **v9; // rcx
size_t *v10; // rbx
__int64 v11; // rax
void *v12; // rdx
__int64 v13; // rcx
__int64 v14; // rdx
_BYTE *v15; // rbx
__int64 v16; // rax
__int64 v17; // rdx
__int64 v18; // r8
__int64 v19; // r9
__int64 v20; // rax
__int64 v21; // rbx
__int64 v22; // rdx
__int64 v23; // rcx
__int64 v24; // r8
__int64 v25; // r9
__int64 v26; // rcx
cocos2d::CCObject *v27; // rax
struct cocos2d::CCScene *v28; // rbx
__int64 v29; // rcx
cocos2d::CCDirector *v30; // rax
__int64 v31; // rax
cocos2d::CCTouchDispatcher *v32; // rax
__int64 v33; // rdx
__int64 v34; // rcx
void *v35; // [rsp+28h] [rbp-41h]
void *v36; // [rsp+28h] [rbp-41h]
void *v37; // [rsp+28h] [rbp-41h]
void *v38; // [rsp+28h] [rbp-41h]
void *v39; // [rsp+28h] [rbp-41h]
char v40[8]; // [rsp+30h] [rbp-39h] BYREF
__int64 v41; // [rsp+38h] [rbp-31h]
__int64 v42; // [rsp+40h] [rbp-29h]
__int64 v43; // [rsp+48h] [rbp-21h]
void *Src[5]; // [rsp+50h] [rbp-19h] BYREF
_BYTE v45[32]; // [rsp+78h] [rbp+Fh] BYREF
_QWORD v46[2]; // [rsp+98h] [rbp+2Fh] BYREF
__int64 v47; // [rsp+A8h] [rbp+3Fh]
unsigned __int64 v48; // [rsp+B0h] [rbp+47h]
v2 = nullptr;
if ( !*((_BYTE *)a1 + 968) )
{
(*(void (__fastcall **)(struct cocos2d::CCObject *, _QWORD))(*(_QWORD *)a1 + 992LL))(a1, 0);
v3 = *((_QWORD *)a1 + 122);
if ( v3 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v3 + 1032LL))(v3, 0);
sub_14003F4F0((__int64)v46, *((_QWORD *)a1 + 115) + 440LL);
v4 = v47 == 0;
sub_14003D310((__int64)v46);
if ( v4 )
{
sub_14003F4F0((__int64)v46, *((_QWORD *)a1 + 115) + 472LL);
v5 = v47 != 0;
sub_14003D310((__int64)v46);
if ( v5 )
{
sub_14003F4F0((__int64)Src, *((_QWORD *)a1 + 115) + 472LL);
v6 = (void **)(*((_QWORD *)a1 + 115) + 440LL);
if ( v6 != Src )
{
v7 = Src;
if ( Src[3] > (void *)0xF )
v7 = (void **)Src[0];
sub_1400405A0(v6, v7, (size_t)Src[2]);
}
v8 = Src;
}
else
{
v41 = 0;
v42 = 7;
v43 = 15;
strcpy(v40, "Unknown");
v9 = (void **)(*((_QWORD *)a1 + 115) + 440LL);
if ( v9 != (void **)v40 )
sub_1400405A0(v9, v40, 7u);
v8 = (void **)v40;
}
sub_14003D310((__int64)v8);
}
v10 = (size_t *)sub_14003F4F0((__int64)v45, (__int64)a1 + 888);
Src[4] = v10;
v11 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v35 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v35);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v11 = *(_QWORD *)&qword_14090BFB0;
}
if ( (size_t *)(v11 + 1272) != v10 )
{
v12 = v10;
if ( v10[3] > 0xF )
v12 = (void *)*v10;
sub_1400405A0((void **)(v11 + 1272), v12, v10[2]);
}
sub_14003D310((__int64)v10);
if ( *(_DWORD *)(*((_QWORD *)a1 + 115) + 584LL) == 2 )
{
v14 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v36 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v36);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v14 = *(_QWORD *)&qword_14090BFB0;
}
sub_14003F4F0((__int64)v46, v14 + 1272);
v15 = v46;
if ( v48 > 0xF )
v15 = (_BYTE *)v46[0];
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v37 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v37);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
}
v16 = GJSearchObject::createFromKey(v15);
if ( v16 )
v2 = (struct cocos2d::CCScene *)LevelBrowserLayer::scene(v16, v17, v18, v19);
sub_14003D310((__int64)v46);
v20 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v38 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v38);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v20 = *(_QWORD *)&qword_14090BFB0;
}
if ( *(_BYTE *)(v20 + 1344) || !v2 )
{
*(_BYTE *)(v20 + 1344) = 0;
v21 = GJSearchObject::create_2(102);
v2 = (struct cocos2d::CCScene *)cocos2d::CCScene::create(v23, v22, v24, v25);
*(_QWORD *)(cocos2d::CCApplication::sharedApplication(v26) + 232) = v2;
v27 = LevelBrowserLayer::create(v21);
(*(void (__fastcall **)(struct cocos2d::CCScene *, cocos2d::CCObject *))(*(_QWORD *)v2 + 464LL))(v2, v27);
}
v28 = cocos2d::CCTransitionFade::create(0.5, v2);
v30 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v29);
cocos2d::CCDirector::replaceScene(v30, v28);
}
else if ( *((_BYTE *)a1 + 748) )
{
v31 = cocos2d::CCDirector::sharedDirector(v13);
v32 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v31 + 144LL))(v31);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v32, a1);
LOBYTE(v33) = 1;
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)a1 + 520LL))(a1, v33);
}
else
{
(*(void (__fastcall **)(struct cocos2d::CCObject *, _QWORD))(*(_QWORD *)a1 + 992LL))(a1, 0);
if ( !qword_14090BFD0 )
{
v39 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v39);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
}
GameManager::safePopScene(v34);
}
}
}