//
// MessagesProfilePage::loadMessagesFinished from 0xa4a28c to 0xa4a3d8 (332 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'MessagesProfilePage::loadMessagesFinished @ 0xa4a3dc
// > ??> @ 0xf5140
// > ??> @ 0x148b0c0
//
// 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 13:00:01 +0000
//
__int64 __fastcall MessagesProfilePage::loadMessagesFinished(
MessagesProfilePage *this,
GameLevelManager **a2,
const char *a3)
{
__int64 result; // x0
GameLevelManager *v6; // x0
int v7; // w20
unsigned int v8; // w1
GameLevelManager *v9; // x2
__int64 v10; // x1
GJAccountManager *v11; // x21
__int64 v12; // x0
__int64 v13; // x0
result = MessagesProfilePage::isCorrect(this, a3);
if ( (_BYTE)result )
{
MessagesProfilePage::setupCommentsBrowser(this, (cocos2d::CCArray *)a2);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 94) + 344LL))(*((_QWORD *)this + 94), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 92) + 344LL))(*((_QWORD *)this + 92), 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 99) + 344LL))(*((_QWORD *)this + 99), 1);
if ( *((unsigned __int8 *)this + 696) < (unsigned int)(a2 != nullptr) )
{
v6 = (GameLevelManager *)cocos2d::CCArray::count((cocos2d::CCArray *)a2);
if ( (_DWORD)v6 )
{
if ( a2 )
{
v6 = a2[7];
v7 = 0;
v8 = *(_DWORD *)v6;
if ( *(_DWORD *)v6 )
{
v6 = *((GameLevelManager **)v6 + 2);
v9 = (GameLevelManager *)((char *)v6 + 8 * v8 - 8);
while ( v9 >= v6 )
{
v10 = *(_QWORD *)v6;
if ( !*(_QWORD *)v6 )
break;
v6 = (GameLevelManager *)((char *)v6 + 8);
if ( !*(_BYTE *)(v10 + 424) )
++v7;
}
}
}
else
{
v7 = 0;
}
v11 = (GJAccountManager *)GameLevelManager::sharedState(v6);
v12 = GJAccountManager::sharedState(v11);
v13 = GameLevelManager::userInfoForAccountID(
(cocos2d::CCDictionary **)v11,
*(_DWORD *)(v12 + 352) - *(_DWORD *)(v12 + 356));
if ( v13 )
{
if ( *(_DWORD *)(v13 + 692) < v7 )
*(_DWORD *)(v13 + 692) = v7;
}
}
}
return MessagesProfilePage::updateSelectUI(this);
}
return result;
}