//
// LevelListLayer::onBack from 0x1002e38b8 to 0x1002e3a48 (400 bytes)
//
// 1 xrefs:
// > ??> @ 0x1009239f0
//
// 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 11:02:49 +0000
//
_BYTE *__fastcall LevelListLayer::onBack(_BYTE *result, __int64 a2)
{
_BYTE *v3; // x20
__int64 v4; // x0
__int64 v5; // x21
int v6; // w19
__int64 v7; // x0
char *v8; // x1
__int64 v9; // x19
char *v10; // x0
__int64 v11; // x20
char *v12; // x0
void *__p[2]; // [xsp+0h] [xbp-60h] BYREF
__int64 v14; // [xsp+10h] [xbp-50h]
std::string __str; // [xsp+20h] [xbp-40h] BYREF
if ( (result[952] & 1) == 0 )
{
v3 = result;
(*(void (__fastcall **)(_BYTE *, _QWORD))(*(_QWORD *)result + 1072LL))(result, 0);
v4 = *((_QWORD *)v3 + 120);
if ( v4 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v4 + 1160LL))(v4, 0);
sub_1002E3A78(v3);
v5 = GameLevelManager::sharedState();
if ( (char)v3[911] < 0 )
sub_1000097D0(&__str, *((void **)v3 + 111), *((_QWORD *)v3 + 112));
else
__str = *(std::string *)(v3 + 37);
std::string::operator=((std::string *)(v5 + 1160), &__str);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
if ( *(_DWORD *)(*((_QWORD *)v3 + 114) + 544LL) == 2 )
{
v6 = GameLevelManager::sharedState();
v7 = GameLevelManager::sharedState();
if ( *(char *)(v7 + 1183) < 0 )
{
sub_1000097D0(__p, *(void **)(v7 + 1160), *(_QWORD *)(v7 + 1168));
}
else
{
*(_OWORD *)__p = *(_OWORD *)(v7 + 1160);
v14 = *(_QWORD *)(v7 + 1176);
}
if ( v14 >= 0 )
v8 = (char *)__p;
else
v8 = (char *)__p[0];
v9 = sub_1000ADF18(v6, v8);
if ( SHIBYTE(v14) < 0 )
operator delete(__p[0]);
if ( (*(_BYTE *)(GameLevelManager::sharedState() + 1216) & 1) != 0 || !v9 )
{
*(_BYTE *)(GameLevelManager::sharedState() + 1216) = 0;
v10 = GJSearchObject::create_2(102);
v9 = LevelBrowserLayer::scene(v10);
}
v11 = cocos2d::CCDirector::sharedDirector();
v12 = cocos2d::CCTransitionFade::create_1(v9, 0.5);
return (_BYTE *)cocos2d::CCDirector::replaceScene(v11, v12);
}
else
{
return (_BYTE *)LevelBrowserLayer::onBack(v3, a2);
}
}
return result;
}