//
// ProfilePage::loadPage from 0x5fb440 to 0x5fb59c (348 bytes)
//
// 5 xrefs:
// > ProfilePage::getUserInfoFinished @ 0x5fb5d2
// > ProfilePage::onNextPage @ 0x5fb616
// > ProfilePage::onPrevPage @ 0x5fb620
// > ProfilePage::commentUploadFinished @ 0x5fb648
// > ProfilePage::commentDeleteFailed @ 0x5fb6fe
//
// 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:54:35 +0000
//
int __fastcall ProfilePage::loadPage(ProfilePage *this, int a2, int a3, int a4)
{
GameLevelManager *v6; // r0
char *AccountCommentKey; // r0
GameLevelManager *v8; // r0
GameLevelManager *v9; // r0
const char *v10; // r1
_BOOL4 StoredOnlineLevels; // r1
GameLevelManager *v12; // r0
GameLevelManager *v13; // r0
const char *v14; // r1
_BOOL4 v15; // r0
_BOOL4 v16; // r8
void (__fastcall *v17)(ProfilePage *, ProfilePage **, char *, int, ProfilePage *, int, int, int); // r9
GameLevelManager *v18; // r0
const char *v19; // r1
const char *PageInfo; // r10
size_t v21; // r0
int v22; // r3
char *v23; // r2
char *v24; // r2
int result; // r0
GameLevelManager *v26; // r0
GameLevelManager *v27; // r0
GameLevelManager *v28; // r0
ProfilePage *v29; // [sp+0h] [bp-10h] BYREF
int v30; // [sp+4h] [bp-Ch]
int v31; // [sp+8h] [bp-8h]
int v32; // [sp+Ch] [bp-4h]
v29 = this;
v30 = a2;
v31 = a3;
v32 = a4;
v6 = (GameLevelManager *)GameLevelManager::sharedState(this);
AccountCommentKey = (char *)GameLevelManager::getAccountCommentKey(v6, *((const char **)this + 139), a2);
std::string::assign((int *)this + 141, AccountCommentKey);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 158) + 172))(*((_DWORD *)this + 158), 1);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 160) + 172))(*((_DWORD *)this + 160), 0);
v8 = (GameLevelManager *)(*(int (__fastcall **)(_DWORD, bool))(**((_DWORD **)this + 148) + 172))(
*((_DWORD *)this + 148),
a2 > 0);
v9 = (GameLevelManager *)GameLevelManager::sharedState(v8);
if ( (*((_BYTE *)this + 564) & 1) != 0 )
v10 = *((const char **)this + 143);
else
v10 = (char *)this + 565;
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v9, v10);
v12 = (GameLevelManager *)(*(int (__fastcall **)(_DWORD, _BOOL4))(**((_DWORD **)this + 147) + 172))(
*((_DWORD *)this + 147),
StoredOnlineLevels);
v13 = (GameLevelManager *)GameLevelManager::sharedState(v12);
if ( (*((_BYTE *)this + 564) & 1) != 0 )
v14 = *((const char **)this + 143);
else
v14 = (char *)this + 565;
v15 = GameLevelManager::getStoredOnlineLevels(v13, v14);
v16 = v15;
if ( v15 )
{
v17 = *(void (__fastcall **)(ProfilePage *, ProfilePage **, char *, int, ProfilePage *, int, int, int))(*(_DWORD *)this + 712);
v18 = (GameLevelManager *)GameLevelManager::sharedState((GameLevelManager *)v15);
if ( (*((_BYTE *)this + 564) & 1) != 0 )
v19 = *((const char **)this + 143);
else
v19 = (char *)this + 565;
v29 = nullptr;
v30 = 0;
v31 = 0;
PageInfo = (const char *)GameLevelManager::getPageInfo(v18, v19);
v21 = strlen(PageInfo);
std::string::__init((int *)&v29, PageInfo, v21);
v22 = *((unsigned __int8 *)this + 564);
if ( (v22 & 1) != 0 )
v23 = *((char **)this + 143);
else
v23 = (char *)this + 565;
v17(this, &v29, v23, v22, v29, v30, v31, v32);
std::string::~string((int)&v29);
if ( (*((_BYTE *)this + 564) & 1) != 0 )
v24 = *((char **)this + 143);
else
v24 = (char *)this + 565;
result = (*(int (__fastcall **)(ProfilePage *, _BOOL4, char *))(*(_DWORD *)this + 704))(this, v16, v24);
}
else
{
v26 = (GameLevelManager *)ProfilePage::setupCommentsBrowser(this, nullptr);
v27 = (GameLevelManager *)GameLevelManager::sharedState(v26);
*((_DWORD *)v27 + 207) = (char *)this + 524;
v28 = (GameLevelManager *)GameLevelManager::sharedState(v27);
result = GameLevelManager::getAccountComments(v28, *((const char **)this + 139), a2, *((_DWORD *)this + 154));
}
*((_DWORD *)this + 157) = a2;
return result;
}