//
// InfoLayer::loadPage from 0x1403d1560 to 0x1403d1ae2 (1410 bytes)
//
// 10 xrefs:
// > InfoLayer::init @ 0x1403cfb56
// > InfoLayer::onRefreshComments @ 0x1403d047f
// > InfoLayer::onGetComments @ 0x1403d0cf5
// > InfoLayer::onNextPage @ 0x1403d232b
// > InfoLayer::onPrevPage @ 0x1403d233b
// > InfoLayer::commentUploadFinished @ 0x1403d23f0
// > InfoLayer::toggleCommentMode @ 0x1403d2a64
// > InfoLayer::toggleModRoom @ 0x1403d2dd6
// > ??> @ 0x140924710
// > ??> @ 0x14092471c
//
// This function is hookable on this platform (idp: pc, 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 11:31:35 +0000
//
// Hidden C++ exception states: #wind=9
void __fastcall InfoLayer::loadPage(__int64 a1, int a2, char a3)
{
int v6; // ebp
__int64 v7; // rcx
BOOL GameVariable; // r13d
char v9; // cl
int v10; // edi
__int64 v11; // rax
int ID; // esi
cocos2d::CCString *v13; // rax
const char *CString; // rax
size_t v15; // rdi
size_t v16; // r8
_BYTE *v17; // rsi
unsigned __int64 v18; // rdx
void *v19; // rcx
__int64 v20; // rdx
_BYTE *v21; // r14
__int64 v22; // rcx
__int64 v23; // rdx
__int64 v24; // rcx
__int64 StoredOnlineLevels; // r14
_BYTE *v26; // rsi
__int64 v27; // rcx
char *PageInfo; // rax
__int64 v29; // r10
__int64 v30; // rdx
char v31; // cl
int v32; // ebp
__int64 v33; // rax
unsigned int v34; // edi
void *v35; // [rsp+30h] [rbp-68h]
void *v36; // [rsp+30h] [rbp-68h]
void *v37; // [rsp+30h] [rbp-68h]
void *v38; // [rsp+30h] [rbp-68h]
void *v39; // [rsp+30h] [rbp-68h]
void *v40; // [rsp+30h] [rbp-68h]
void *v41; // [rsp+30h] [rbp-68h]
void *v42; // [rsp+30h] [rbp-68h]
void *v43; // [rsp+30h] [rbp-68h]
void *Block[2]; // [rsp+38h] [rbp-60h] BYREF
__int64 v45; // [rsp+48h] [rbp-50h]
unsigned __int64 v46; // [rsp+50h] [rbp-48h]
v6 = 0;
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 848) + 336LL))(*(_QWORD *)(a1 + 848), 0);
v7 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v35 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v35);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v7 = qword_14090BFD0;
}
GameVariable = GameManager::getGameVariable(v7, "0069");
v9 = *(_BYTE *)(a1 + 888);
if ( v9 )
v10 = (*(_QWORD *)(a1 + 704) != 0) + 4;
else
v10 = *(_DWORD *)(a1 + 884);
v11 = *(_QWORD *)(a1 + 704);
if ( v11 && v9 )
ID = *(_DWORD *)(v11 + 392);
else
ID = InfoLayer::getID((_QWORD *)a1);
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v36 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v36);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
}
v13 = cocos2d::CCString::createWithFormat("comment_%i_%i_%i_%i", ID, a2, GameVariable, v10);
CString = cocos2d::CCString::getCString(v13);
*(_OWORD *)Block = 0;
v45 = 0;
v46 = 0;
v15 = -1;
v16 = -1;
do
++v16;
while ( CString[v16] );
sub_14003D230(Block, CString, v16);
v17 = (_BYTE *)(a1 + 728);
sub_140059C40(a1 + 728, (__int64)Block);
v18 = v46;
if ( v46 > 0xF )
{
v19 = Block[0];
if ( v46 + 1 >= 0x1000 )
{
v19 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v19 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v19);
}
LOBYTE(v18) = 1;
(*(void (__fastcall **)(_QWORD, unsigned __int64))(**(_QWORD **)(a1 + 760) + 336LL))(*(_QWORD *)(a1 + 760), v18);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 776) + 336LL))(*(_QWORD *)(a1 + 776), 0);
if ( a2 <= 0 )
v20 = 0;
else
LOBYTE(v20) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 800) + 336LL))(*(_QWORD *)(a1 + 800), v20);
v21 = (_BYTE *)(a1 + 728);
if ( *(_QWORD *)(a1 + 752) > 0xFu )
v21 = *(_BYTE **)v17;
v22 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v37 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v37);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v22 = *(_QWORD *)&qword_14090BFB0;
}
if ( GameLevelManager::getStoredLevelComments(v22, v21) )
LOBYTE(v23) = 1;
else
v23 = 0;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 792) + 336LL))(*(_QWORD *)(a1 + 792), v23);
if ( *(_QWORD *)(a1 + 752) > 0xFu )
v17 = *(_BYTE **)v17;
v24 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v38 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v38);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v24 = *(_QWORD *)&qword_14090BFB0;
}
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v24, v17);
if ( StoredOnlineLevels )
{
v26 = (_BYTE *)(a1 + 728);
if ( *(_QWORD *)(a1 + 752) > 0xFu )
v26 = *(_BYTE **)v26;
v27 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v39 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v39);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v27 = *(_QWORD *)&qword_14090BFB0;
}
PageInfo = GameLevelManager::getPageInfo(v27, v26);
*(_OWORD *)Block = 0;
v45 = 0;
v46 = 0;
do
++v15;
while ( PageInfo[v15] );
sub_14003D230(Block, PageInfo, v15);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)(a1 + 664) + 24LL))(a1 + 664, Block);
(**(void (__fastcall ***)(__int64, __int64))(a1 + 664))(a1 + 664, StoredOnlineLevels);
}
else
{
if ( !a3 )
InfoLayer::setupCommentsBrowser(a1, 0);
v29 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v40 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v40);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v29 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v29 + 1368) = a1 + 664;
v30 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v41 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v41);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v30 = qword_14090BFD0;
v29 = *(_QWORD *)&qword_14090BFB0;
}
if ( *(_DWORD *)(v30 + 692) == *(_DWORD *)(v30 + 696) )
{
*(_BYTE *)(a1 + 880) = 1;
if ( !v29 )
{
v42 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v42);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v29 = *(_QWORD *)&qword_14090BFB0;
}
GameLevelManager::updateUserScore(v29);
}
else
{
v31 = *(_BYTE *)(a1 + 888);
if ( v31 )
{
LOBYTE(v6) = *(_QWORD *)(a1 + 704) != 0;
v32 = v6 + 4;
}
else
{
v32 = *(_DWORD *)(a1 + 884);
}
v33 = *(_QWORD *)(a1 + 704);
if ( v33 && v31 )
v34 = *(_DWORD *)(v33 + 392);
else
v34 = InfoLayer::getID((_QWORD *)a1);
if ( !v29 )
{
v43 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v43);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v29 = *(_QWORD *)&qword_14090BFB0;
}
GameLevelManager::getLevelComments(
(cocos2d::CCActionManager **)v29,
v34,
a2,
*(_DWORD *)(a1 + 864),
GameVariable,
v32);
}
if ( !a3 )
(**(void (__fastcall ***)(__int64, const char *))(*(_QWORD *)(a1 + 768) + 360LL))(
*(_QWORD *)(a1 + 768) + 360LL,
" ");
}
*(_DWORD *)(a1 + 876) = a2;
}