//
// LevelListLayer::loadLevelsFinished from 0xbaca24 to 0xbacbec (456 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'LevelListLayer::loadLevelsFinished @ 0xbacbf0
// > ??> @ 0xd5970
// > ??> @ 0x14dbe98
//
// 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 13:02:53 +0000
//
__int64 __fastcall LevelListLayer::loadLevelsFinished(LevelListLayer *this, cocos2d::CCArray *a2, char *a3, int a4)
{
__int64 v7; // x0
__int64 v9; // x1
char *v10; // x24
int v11; // w23
GameLevelManager *v12; // x0
cocos2d::CCDictionary **v13; // x0
__int64 v14; // x0
size_t v15; // x0
_BOOL4 v16; // w21
GameLevelManager *updated; // x0
GameLevelManager *v18; // x21
const char *Key; // x0
int v20; // [xsp+48h] [xbp+48h]
int v21; // [xsp+48h] [xbp+48h]
__int64 v22; // [xsp+50h] [xbp+50h] BYREF
__int64 v23; // [xsp+58h] [xbp+58h]
char *v24; // [xsp+60h] [xbp+60h]
v7 = *((_QWORD *)this + 83);
if ( v7 && *(_DWORD *)(v7 + 316) == 25 )
{
v22 = 0;
v23 = 0;
v24 = nullptr;
if ( (*(_BYTE *)(v7 + 320) & 1) != 0 )
{
v21 = a4;
std::string::__init(&v22, *(void **)(v7 + 336), *(_QWORD *)(v7 + 328));
a4 = v21;
}
else
{
v9 = *(_QWORD *)(v7 + 328);
v22 = *(_QWORD *)(v7 + 320);
v23 = v9;
v24 = *(char **)(v7 + 336);
}
v20 = a4;
if ( (v22 & 1) != 0 )
{
v10 = v24;
v11 = atoi(v24);
operator delete(v10);
}
else
{
v12 = (GameLevelManager *)atoi((const char *)&v22 + 1);
v11 = (int)v12;
}
v13 = (cocos2d::CCDictionary **)GameLevelManager::sharedState(v12);
GameLevelManager::markListAsDownloaded(v13, v11);
v14 = *((_QWORD *)this + 114);
a4 = v20;
if ( v11 == *(_DWORD *)(v14 + 344) )
{
*(_BYTE *)(v14 + 398) = 1;
if ( v20 == 1 )
goto LABEL_12;
LABEL_4:
LevelBrowserLayer::loadLevelsFinished((cocos2d::CCArray **)this, a2, a3);
return _stack_chk_guard;
}
}
if ( a4 != 1 )
goto LABEL_4;
LABEL_12:
v22 = 0;
v23 = 0;
v24 = nullptr;
v15 = strlen(a3);
std::string::__init(&v22, a3, v15);
v16 = sub_BA8AE8((__int64)this + 920, (__int64)&v22);
if ( (v22 & 1) != 0 )
{
operator delete(v24);
if ( !v16 )
return _stack_chk_guard;
goto LABEL_14;
}
if ( v16 )
{
LABEL_14:
updated = (GameLevelManager *)LevelListLayer::updateStatsArt(this);
v18 = (GameLevelManager *)GameLevelManager::sharedState(updated);
Key = (const char *)GJSearchObject::getKey(*((GJSearchObject **)this + 83));
GameLevelManager::resetTimerForKey(v18, Key);
LevelBrowserLayer::loadPage((GJSearchObject **)this, *((GJSearchObject **)this + 83));
}
return _stack_chk_guard;
}