//
// LevelPickerPopup::buildSavedPage from 0x75a89c to 0x75a9be (290 bytes)
//
// 5 xrefs:
// > LevelPickerPopup::onToggleKind @ 0x75aa9a
// > LevelPickerPopup::onToggleFavorites @ 0x75ab30
// > LevelPickerPopup::doPageRequest @ 0x75ab58
// > LevelPickerPopup::onOnlineMode @ 0x75ad8c
// > LevelPickerPopup::textChanged @ 0x75af10
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:58:58 +0000
//
int __fastcall LevelPickerPopup::buildSavedPage(LevelPickerPopup *this)
{
int *v2; // r8
unsigned __int8 *updated; // r0
int v4; // r5
cocos2d::CCArray *v5; // r0
int v6; // r6
int v7; // r10
cocos2d::CCArray *i; // r7
int v9; // r3
int v10; // r2
cocos2d::CCArray *v11; // r1
int v12; // r3
int v13; // r3
char *v14; // r1
int v15; // r6
int v16; // r0
int v18; // r3
int v19; // r3
v2 = LevelPickerPopup::savedIndex(this);
updated = LevelPickerPopup::updateMatches((int)this, v2);
v4 = (*((_DWORD *)this + 180) - *((_DWORD *)this + 179)) >> 2;
if ( 10 * *((_DWORD *)this + 134) >= v4 )
*((_DWORD *)this + 134) = 0;
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)updated);
v6 = 10 * *((_DWORD *)this + 134);
v7 = 40 * *((_DWORD *)this + 134);
for ( i = v5; ; cocos2d::CCArray::addObject(i, *(cocos2d::CCObject **)(*v2 + 32 * v10)) )
{
v9 = 10 * *((_DWORD *)this + 134) + 10;
if ( v9 >= v4 )
v9 = v4;
if ( v6 >= v9 )
break;
++v6;
v10 = *(_DWORD *)(*((_DWORD *)this + 179) + v7);
v7 += 4;
}
if ( cocos2d::CCArray::count(i) )
v11 = i;
else
v11 = nullptr;
LevelPickerPopup::setupList(this, v11);
if ( !cocos2d::CCArray::count(i) )
{
if ( *((_BYTE *)this + 613) )
{
v14 = "No saved lists";
}
else if ( *((_BYTE *)this + 614) )
{
v12 = *((unsigned __int8 *)this + 648);
if ( (v12 & 1) != 0 )
v13 = *((_DWORD *)this + 163);
else
v13 = v12 >> 1;
if ( v13 )
v14 = "No saved levels";
else
v14 = "No favorite levels";
}
else
{
v14 = "No saved levels";
}
if ( *v2 != v2[1] )
{
if ( *((_BYTE *)this + 613) )
{
v14 = "Nothing found";
}
else if ( *((_BYTE *)this + 614) )
{
v18 = *((unsigned __int8 *)this + 648);
if ( (v18 & 1) != 0 )
v19 = *((_DWORD *)this + 163);
else
v19 = v18 >> 1;
if ( v19 )
v14 = "Nothing found";
}
else
{
v14 = "Nothing found";
}
}
PagedListPopup::showStatus(this, (cocos2d::CCLabelBMFont *)v14);
}
v15 = 10 * *((_DWORD *)this + 134);
v16 = cocos2d::CCArray::count(i);
return PagedListPopup::updatePageUI((int **)this, v4, v15, v16);
}