//
// ProfilePage::loadPage from 0x140559f40 to 0x14055a231 (753 bytes)
//
// 7 xrefs:
// > ProfilePage::getUserInfoFinished @ 0x140559cdb
// > ProfilePage::onNextPage @ 0x14055a6d8
// > ProfilePage::onPrevPage @ 0x14055a6e8
// > ProfilePage::commentUploadFinished @ 0x14055a72a
// > ProfilePage::commentDeleteFailed @ 0x14055aa58
// > ??> @ 0x14092c054
// > ??> @ 0x14092c060
//
// 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:34:12 +0000
//
// Hidden C++ exception states: #wind=6
void __fastcall ProfilePage::loadPage(__int64 a1, int a2)
{
cocos2d::CCString *v4; // rax
char *CString; // rax
size_t v6; // rbx
size_t v7; // r8
_BYTE *v8; // rsi
__int64 v9; // rdx
__int64 v10; // rdx
_BYTE *v11; // r14
__int64 v12; // rcx
__int64 v13; // rdx
__int64 v14; // rcx
__int64 StoredOnlineLevels; // r14
_BYTE *v16; // rsi
__int64 v17; // rcx
char *PageInfo; // rax
__int64 v19; // rcx
__int128 v20; // [rsp+20h] [rbp-38h] BYREF
__int64 v21; // [rsp+30h] [rbp-28h]
__int64 v22; // [rsp+38h] [rbp-20h]
void *v23; // [rsp+60h] [rbp+8h]
void *v24; // [rsp+60h] [rbp+8h]
void *v25; // [rsp+60h] [rbp+8h]
void *v26; // [rsp+60h] [rbp+8h]
void *v27; // [rsp+60h] [rbp+8h]
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v23 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v23);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
}
v4 = cocos2d::CCString::createWithFormat("a_%i_%i", *(_DWORD *)(a1 + 736), a2);
CString = (char *)cocos2d::CCString::getCString(v4);
v6 = -1;
v7 = -1;
do
++v7;
while ( CString[v7] );
v8 = (_BYTE *)(a1 + 744);
sub_1400405A0((void **)(a1 + 744), CString, v7);
LOBYTE(v9) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 872) + 336LL))(*(_QWORD *)(a1 + 872), v9);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 888) + 336LL))(*(_QWORD *)(a1 + 888), 0);
if ( a2 <= 0 )
v10 = 0;
else
LOBYTE(v10) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 808) + 336LL))(*(_QWORD *)(a1 + 808), v10);
v11 = (_BYTE *)(a1 + 744);
if ( *(_QWORD *)(a1 + 768) > 0xFu )
v11 = *(_BYTE **)v8;
v12 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v24 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v24);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v12 = *(_QWORD *)&qword_14090BFB0;
}
if ( GameLevelManager::getStoredOnlineLevels(v12, v11) )
LOBYTE(v13) = 1;
else
v13 = 0;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 800) + 336LL))(*(_QWORD *)(a1 + 800), v13);
if ( *(_QWORD *)(a1 + 768) > 0xFu )
v8 = *(_BYTE **)v8;
v14 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v25 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v25);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v14 = *(_QWORD *)&qword_14090BFB0;
}
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v14, v8);
if ( StoredOnlineLevels )
{
v16 = (_BYTE *)(a1 + 744);
if ( *(_QWORD *)(a1 + 768) > 0xFu )
v16 = *(_BYTE **)v16;
v17 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v26 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v26);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v17 = *(_QWORD *)&qword_14090BFB0;
}
PageInfo = GameLevelManager::getPageInfo(v17, v16);
v20 = 0;
v21 = 0;
v22 = 0;
do
++v6;
while ( PageInfo[v6] );
sub_14003D230(&v20, PageInfo, v6);
(*(void (__fastcall **)(__int64, __int128 *))(*(_QWORD *)(a1 + 672) + 24LL))(a1 + 672, &v20);
(**(void (__fastcall ***)(__int64, __int64))(a1 + 672))(a1 + 672, StoredOnlineLevels);
}
else
{
ProfilePage::setupCommentsBrowser(a1, 0);
v19 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v27 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v27);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v19 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v19 + 1368) = a1 + 672;
GameLevelManager::getAccountComments(
(cocos2d::CCActionManager **)v19,
*(_DWORD *)(a1 + 736),
a2,
*(_DWORD *)(a1 + 856));
}
*(_DWORD *)(a1 + 868) = a2;
}