//
// FriendsProfilePage::getUserListFinished from 0xa52730 to 0xa529e0 (688 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'FriendsProfilePage::getUserListFinished @ 0xa529e4
// > ??> @ 0x56a10
// > ??> @ 0x148c670
//
// 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:06 +0000
//
__int64 __fastcall FriendsProfilePage::getUserListFinished(__int64 a1, cocos2d::CCObject *this, int a3)
{
__int64 result; // x0
cocos2d::CCObject *v5; // x0
__int64 v6; // x0
__int64 v7; // x1
unsigned int *v8; // x1
unsigned int v9; // w20
unsigned int v10; // w2
__int64 *v11; // x1
__int64 *v12; // x3
__int64 v13; // x2
__int64 v14; // x0
__int64 v15; // x2
GameManager *v16; // x0
GameManager *v17; // x0
int v18; // w20
GameLevelManager *v19; // x0
unsigned int v20; // w1
GameLevelManager *i; // x2
__int64 v22; // x1
GJAccountManager *v23; // x19
__int64 v24; // x0
cocos2d::CCObject *v25; // x0
GameManager *v26; // x0
GameManager *v27; // x0
GameManager *v28; // x0
GameManager *v29; // x0
GameManager *v30; // x0
cocos2d::CCObject *v31; // [xsp+28h] [xbp+28h]
cocos2d::CCObject *v32; // [xsp+28h] [xbp+28h]
result = *(unsigned int *)(a1 + 816);
if ( a3 == 2 )
{
if ( (_DWORD)result != 1 )
{
v25 = *(cocos2d::CCObject **)(a1 + 872);
if ( v25 )
{
v32 = this;
cocos2d::CCObject::release(v25);
this = v32;
}
*(_QWORD *)(a1 + 872) = this;
cocos2d::CCObject::retain(this);
*(_BYTE *)(a1 + 920) = 1;
FriendsProfilePage::rebuildList((cocos2d::CCArray **)a1);
PagedListPopup::fadeLoading((PagedListPopup *)a1);
PagedListPopup::clearStatus((PagedListPopup *)a1);
return (*(__int64 (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 904) + 344LL))(*(_QWORD *)(a1 + 904), 1);
}
}
else if ( (_DWORD)result == a3 )
{
v5 = *(cocos2d::CCObject **)(a1 + 856);
if ( v5 )
{
v31 = this;
cocos2d::CCObject::release(v5);
this = v31;
}
*(_QWORD *)(a1 + 856) = this;
cocos2d::CCObject::retain(this);
FriendsProfilePage::sortUsers((FriendsProfilePage *)a1);
v6 = *(_QWORD *)(a1 + 928);
if ( v6 )
{
v7 = *(_QWORD *)(a1 + 856);
if ( v7 )
{
v8 = *(unsigned int **)(v7 + 56);
v9 = 0;
v10 = *v8;
if ( *v8 )
{
v11 = *((__int64 **)v8 + 2);
v12 = &v11[v10 - 1];
if ( v11 <= v12 )
{
v13 = *v11;
if ( *v11 )
{
while ( *(int *)(v13 + 456) <= 0 )
{
if ( v12 >= ++v11 )
{
v13 = *v11;
if ( *v11 )
continue;
}
goto LABEL_14;
}
v9 = 1;
}
}
}
}
else
{
LABEL_14:
v9 = 0;
}
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v6 + 344LL))(v6, v9);
v14 = *(_QWORD *)(a1 + 952);
if ( v14 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v14 + 344LL))(v14, v9);
}
v15 = *(_BYTE *)(a1 + 880) >> 1;
if ( (*(_BYTE *)(a1 + 880) & 1) != 0 )
v15 = *(_QWORD *)(a1 + 888);
if ( v15 )
FriendsProfilePage::filterUsersWithQuery(a1, a1 + 880);
FriendsProfilePage::rebuildList((cocos2d::CCArray **)a1);
PagedListPopup::fadeLoading((PagedListPopup *)a1);
PagedListPopup::clearStatus((PagedListPopup *)a1);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 904) + 344LL))(*(_QWORD *)(a1 + 904), 1);
result = *(unsigned int *)(a1 + 816);
if ( !(_DWORD)result )
{
v16 = (GameManager *)GameManager::sharedState((GameManager *)result);
GameManager::reportAchievementWithID(v16, "geometry.ach.friends01", 100, 0);
v17 = (GameManager *)cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 856));
v18 = (int)v17;
if ( (int)v17 > 9 )
{
v26 = (GameManager *)GameManager::sharedState(v17);
v27 = (GameManager *)GameManager::reportAchievementWithID(v26, "geometry.ach.friends02", 100, 0);
if ( v18 > 24 )
{
v28 = (GameManager *)GameManager::sharedState(v27);
v29 = (GameManager *)GameManager::reportAchievementWithID(v28, "geometry.ach.friends03", 100, 0);
if ( v18 > 49 )
{
v30 = (GameManager *)GameManager::sharedState(v29);
GameManager::reportAchievementWithID(v30, "geometry.ach.friends04", 100, 0);
}
}
}
v19 = *(GameLevelManager **)(a1 + 856);
if ( v19 )
{
v19 = *((GameLevelManager **)v19 + 7);
v20 = *(_DWORD *)v19;
if ( *(_DWORD *)v19 )
{
v19 = *((GameLevelManager **)v19 + 2);
for ( i = (GameLevelManager *)((char *)v19 + 8 * v20 - 8); i >= v19; *(_BYTE *)(v22 + 724) = 0 )
{
v22 = *(_QWORD *)v19;
if ( !*(_QWORD *)v19 )
break;
v19 = (GameLevelManager *)((char *)v19 + 8);
}
}
}
v23 = (GJAccountManager *)GameLevelManager::sharedState(v19);
v24 = GJAccountManager::sharedState(v23);
result = GameLevelManager::userInfoForAccountID(
(cocos2d::CCDictionary **)v23,
*(_DWORD *)(v24 + 352) - *(_DWORD *)(v24 + 356));
if ( result )
*(_DWORD *)(result + 700) = 0;
}
}
return result;
}