//
// LevelPickerPopup::doPageRequest from 0xc848cc to 0xc84bc4 (760 bytes)
//
// 3 xrefs:
// > ??> @ 0x97f00
// > LevelPickerPopup::requestPage @ 0xc64024
// > ??> @ 0x1544218
//
// 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:05:41 +0000
//
__int64 __fastcall LevelPickerPopup::doPageRequest(LevelPickerPopup *this, float a2)
{
__int64 v3; // x0
cocos2d::CCString *v4; // x0
size_t v5; // x0
GJSearchObject *v6; // x21
char *Key; // x0
__int64 *v8; // x0
GameLevelManager *v9; // x0
const char *v10; // x1
GameLevelManager *StoredOnlineLevels; // x0
GameLevelManager *v12; // x23
GameLevelManager *v13; // x0
const char *v14; // x1
void (__fastcall *v15)(LevelPickerPopup *, __int64 *, char *); // x24
GameLevelManager *v16; // x0
const char *v17; // x1
char *PageInfo; // x0
size_t v19; // x0
char *v20; // x2
char *v21; // x2
__int64 v23; // x0
cocos2d::CCString *v24; // x0
size_t v25; // x0
GameLevelManager *v26; // x0
GameLevelManager *v27; // x0
GameLevelManager *v28; // x0
char *v29; // [xsp+48h] [xbp+48h]
char *v30; // [xsp+48h] [xbp+48h]
char *CString; // [xsp+48h] [xbp+48h]
__int64 v32[2]; // [xsp+58h] [xbp+58h] BYREF
void *v33; // [xsp+68h] [xbp+68h]
__int64 v34; // [xsp+70h] [xbp+70h] BYREF
__int64 v35; // [xsp+78h] [xbp+78h]
void *v36; // [xsp+80h] [xbp+80h]
if ( *((_BYTE *)this + 808) )
{
if ( *((_BYTE *)this + 809) )
{
v23 = GJAccountManager::sharedState(this);
v24 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)(*(_DWORD *)(v23 + 352) - *(_DWORD *)(v23 + 356)));
CString = (char *)cocos2d::CCString::getCString(v24);
v32[0] = 0;
v32[1] = 0;
v33 = nullptr;
v25 = strlen(CString);
std::string::__init(v32, CString, v25);
v6 = (GJSearchObject *)GJSearchObject::create(5, (char *)v32);
if ( (v32[0] & 1) != 0 )
operator delete(v33);
}
else
{
v3 = GameManager::sharedState(this);
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)(*(_DWORD *)(v3 + 660) - *(_DWORD *)(v3 + 664)));
v29 = (char *)cocos2d::CCString::getCString(v4);
v34 = 0;
v35 = 0;
v36 = nullptr;
v5 = strlen(v29);
std::string::__init(&v34, v29, v5);
v6 = (GJSearchObject *)GJSearchObject::create(5, (char *)&v34);
if ( (v34 & 1) != 0 )
operator delete(v36);
}
if ( *((_BYTE *)this + 809) )
*((_DWORD *)v6 + 108) = 1;
*((_DWORD *)v6 + 98) = *((_DWORD *)this + 208);
Key = (char *)GJSearchObject::getKey(v6);
v8 = std::string::assign((__int64 *)this + 105, Key);
v9 = (GameLevelManager *)GameLevelManager::sharedState((GameLevelManager *)v8);
v10 = (char *)this + 841;
if ( (*((_BYTE *)this + 840) & 1) != 0 )
v10 = *((const char **)this + 107);
StoredOnlineLevels = (GameLevelManager *)GameLevelManager::getStoredOnlineLevels(v9, v10);
v12 = StoredOnlineLevels;
if ( !StoredOnlineLevels )
goto LABEL_25;
v13 = (GameLevelManager *)GameLevelManager::sharedState(StoredOnlineLevels);
v14 = (char *)this + 841;
if ( (*((_BYTE *)this + 840) & 1) != 0 )
v14 = *((const char **)this + 107);
StoredOnlineLevels = (GameLevelManager *)GameLevelManager::getTimeLeft(v13, v14, 3600.0);
if ( (int)StoredOnlineLevels > 0 )
{
v15 = *(void (__fastcall **)(LevelPickerPopup *, __int64 *, char *))(*(_QWORD *)this + 1392LL);
v16 = (GameLevelManager *)GameLevelManager::sharedState(*(GameLevelManager **)this);
if ( (*((_BYTE *)this + 840) & 1) != 0 )
v17 = *((const char **)this + 107);
else
v17 = (char *)this + 841;
PageInfo = GameLevelManager::getPageInfo(v16, v17);
v34 = 0;
v30 = PageInfo;
v35 = 0;
v36 = nullptr;
v19 = strlen(PageInfo);
std::string::__init(&v34, v30, v19);
v20 = (char *)this + 841;
if ( (*((_BYTE *)this + 840) & 1) != 0 )
v20 = *((char **)this + 107);
v15(this, &v34, v20);
if ( (v34 & 1) != 0 )
operator delete(v36);
v21 = (char *)this + 841;
if ( (*((_BYTE *)this + 840) & 1) != 0 )
v21 = *((char **)this + 107);
(*(void (__fastcall **)(LevelPickerPopup *, GameLevelManager *, char *, _QWORD))(*(_QWORD *)this + 1376LL))(
this,
v12,
v21,
*((unsigned __int8 *)this + 809));
}
else
{
LABEL_25:
*(_QWORD *)(GameLevelManager::sharedState(StoredOnlineLevels) + 1224) = (char *)this + 776;
v26 = (GameLevelManager *)*((unsigned __int8 *)this + 809);
if ( *((_BYTE *)this + 809) )
{
v28 = (GameLevelManager *)GameLevelManager::sharedState(v26);
GameLevelManager::getLevelLists(v28, v6);
}
else
{
v27 = (GameLevelManager *)GameLevelManager::sharedState(v26);
GameLevelManager::getOnlineLevels(v27, v6);
}
}
}
else
{
PagedListPopup::fadeLoading(this);
LevelPickerPopup::buildSavedPage(this);
}
return _stack_chk_guard;
}