//
// InfoLayer::loadPage from 0x90a968 to 0x90acd4 (876 bytes)
//
// 10 xrefs:
// > InfoLayer::onRefreshComments @ 0x90ad64
// > InfoLayer::onGetComments @ 0x90af4c
// > InfoLayer::onNextPage @ 0x90af5c
// > InfoLayer::onPrevPage @ 0x90af6c
// > InfoLayer::commentUploadFinished @ 0x90afdc
// > InfoLayer::toggleCommentMode @ 0x90b03c
// > InfoLayer::toggleCommentMode @ 0x90b070
// > InfoLayer::toggleModRoom @ 0x90b10c
// > InfoLayer::init @ 0x90c66c
// > ??> @ 0xabf40
//
// 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 12:57:12 +0000
//
__int64 __fastcall InfoLayer::loadPage(InfoLayer *this, signed int a2, unsigned __int8 a3)
{
int v3; // w25
char *v5; // x20
GameManager *v7; // x0
GameManager *v8; // x0
GameLevelManager *GameVariable; // x0
unsigned int v10; // w26
__int64 v11; // x2
__int64 v12; // x3
__int64 v13; // x2
GameLevelManager *v14; // x0
GameLevelManager *v15; // x0
const char *v16; // x1
__int64 StoredLevelComments; // x0
__int64 v18; // x2
GameLevelManager *v19; // x0
GameLevelManager *v20; // x0
const char *v21; // x1
GameLevelManager *StoredOnlineLevels; // x0
GameLevelManager *v23; // x24
void (__fastcall *v24)(InfoLayer *, __int64 *, char *); // x25
GameLevelManager *v25; // x0
const char *v26; // x1
char *PageInfo; // x0
size_t v28; // x0
char *v29; // x2
char *v30; // x2
void (__fastcall *v31)(InfoLayer *, GameLevelManager *, char *); // x3
GameManager *v33; // x0
__int64 v34; // x0
int v35; // w1
GameLevelManager *v36; // x0
GameLevelManager *v37; // x20
int v38; // w0
GameLevelManager *v39; // x0
const char *v40; // [xsp+50h] [xbp+50h]
const char *active; // [xsp+58h] [xbp+58h]
char *v42; // [xsp+58h] [xbp+58h]
unsigned int v43; // [xsp+58h] [xbp+58h]
__int64 v44; // [xsp+60h] [xbp+60h] BYREF
__int64 v45; // [xsp+68h] [xbp+68h]
void *v46; // [xsp+70h] [xbp+70h]
v3 = a3;
v5 = (char *)this + 728;
v7 = (GameManager *)(*(__int64 (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 105) + 344LL))(
*((_QWORD *)this + 105),
0);
v8 = (GameManager *)GameManager::sharedState(v7);
GameVariable = (GameLevelManager *)GameManager::getGameVariable(v8, "0069");
v10 = (unsigned __int8)GameVariable;
GameLevelManager::sharedState(GameVariable);
active = (const char *)(unsigned int)InfoLayer::activeCommentID(this);
InfoLayer::activeCommentKeyType(this);
GameLevelManager::getCommentKey(active, &v44);
if ( (*((_BYTE *)this + 728) & 1) != 0 )
{
**((_BYTE **)v5 + 2) = 0;
*((_QWORD *)v5 + 1) = 0;
}
else
{
*((_BYTE *)this + 729) = 0;
*((_BYTE *)this + 728) = 0;
}
std::string::reserve((__int64 *)v5, 0);
v11 = v44;
v12 = v45;
*((_QWORD *)v5 + 2) = v46;
*(_QWORD *)v5 = v11;
*((_QWORD *)v5 + 1) = v12;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 94) + 344LL))(*((_QWORD *)this + 94), 1);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 96) + 344LL))(*((_QWORD *)this + 96), 0);
v13 = *((_QWORD *)this + 99);
if ( a2 <= 0 )
v14 = (GameLevelManager *)(*(__int64 (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v13 + 344LL))(
*((_QWORD *)this + 99),
0);
else
v14 = (GameLevelManager *)(*(__int64 (__fastcall **)(_QWORD, __int64))(*(_QWORD *)v13 + 344LL))(
*((_QWORD *)this + 99),
1);
v15 = (GameLevelManager *)GameLevelManager::sharedState(v14);
v16 = (char *)this + 729;
if ( (*((_BYTE *)this + 728) & 1) != 0 )
v16 = *((const char **)v5 + 2);
StoredLevelComments = GameLevelManager::getStoredLevelComments(v15, v16);
v18 = *((_QWORD *)this + 98);
if ( StoredLevelComments )
v19 = (GameLevelManager *)(*(__int64 (__fastcall **)(_QWORD, __int64))(*(_QWORD *)v18 + 344LL))(
*((_QWORD *)this + 98),
1);
else
v19 = (GameLevelManager *)(*(__int64 (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v18 + 344LL))(
*((_QWORD *)this + 98),
0);
v20 = (GameLevelManager *)GameLevelManager::sharedState(v19);
v21 = (char *)this + 729;
if ( (*((_BYTE *)this + 728) & 1) != 0 )
v21 = *((const char **)v5 + 2);
StoredOnlineLevels = (GameLevelManager *)GameLevelManager::getStoredOnlineLevels(v20, v21);
v23 = StoredOnlineLevels;
if ( !StoredOnlineLevels )
{
if ( !v3 )
StoredOnlineLevels = (GameLevelManager *)InfoLayer::setupCommentsBrowser(this, nullptr);
v33 = (GameManager *)GameLevelManager::sharedState(StoredOnlineLevels);
*((_QWORD *)v33 + 155) = (char *)this + 664;
v34 = GameManager::sharedState(v33);
v35 = *(_DWORD *)(v34 + 660);
v36 = (GameLevelManager *)*(unsigned int *)(v34 + 664);
if ( v35 == (_DWORD)v36 )
{
*((_BYTE *)this + 872) = (unsigned __int8)&dword_0 + 1;
v39 = (GameLevelManager *)GameLevelManager::sharedState((GameLevelManager *)((char *)&dword_0 + 1));
GameLevelManager::updateUserScore(v39);
if ( v3 )
goto LABEL_19;
}
else
{
v37 = (GameLevelManager *)GameLevelManager::sharedState(v36);
v40 = (const char *)(unsigned int)InfoLayer::activeCommentID(this);
v43 = *((_DWORD *)this + 214);
v38 = InfoLayer::activeCommentKeyType(this);
GameLevelManager::getLevelComments(v37, v40, a2, v43, v10, v38);
if ( v3 )
goto LABEL_19;
}
(*(void (__fastcall **)(_QWORD, char *))(**((_QWORD **)this + 95) + 928LL))(*((_QWORD *)this + 95), &byte_11E1A70);
goto LABEL_19;
}
v24 = *(void (__fastcall **)(InfoLayer *, __int64 *, char *))(*(_QWORD *)this + 1360LL);
v25 = (GameLevelManager *)GameLevelManager::sharedState(*(GameLevelManager **)this);
v26 = (char *)this + 729;
if ( (*((_BYTE *)this + 728) & 1) != 0 )
v26 = *((const char **)v5 + 2);
PageInfo = GameLevelManager::getPageInfo(v25, v26);
v44 = 0;
v42 = PageInfo;
v45 = 0;
v46 = nullptr;
v28 = strlen(PageInfo);
std::string::__init(&v44, v42, v28);
v29 = (char *)this + 729;
if ( (*((_BYTE *)this + 728) & 1) != 0 )
v29 = *((char **)v5 + 2);
v24(this, &v44, v29);
if ( (v44 & 1) != 0 )
{
operator delete(v46);
v30 = (char *)this + 729;
v31 = *(void (__fastcall **)(InfoLayer *, GameLevelManager *, char *))(*(_QWORD *)this + 1344LL);
if ( (*((_BYTE *)this + 728) & 1) == 0 )
goto LABEL_18;
goto LABEL_21;
}
v30 = (char *)this + 729;
v31 = *(void (__fastcall **)(InfoLayer *, GameLevelManager *, char *))(*(_QWORD *)this + 1344LL);
if ( (*((_BYTE *)this + 728) & 1) != 0 )
LABEL_21:
v30 = *((char **)v5 + 2);
LABEL_18:
v31(this, v23, v30);
LABEL_19:
*((_DWORD *)this + 217) = a2;
return _stack_chk_guard;
}