//
// FriendPickerPopup::buildRows from 0x7587f0 to 0x7589f2 (514 bytes)
//
// 5 xrefs:
// > FriendPickerPopup::getUserListFinished @ 0x758a7e
// > FriendPickerPopup::getUserListFailed @ 0x758aca
// > FriendPickerPopup::onToggleSelectedView @ 0x758bb0
// > FriendPickerPopup::delayedRebuild @ 0x758bb4
// > FriendPickerPopup::textChanged @ 0x758c2c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:58:57 +0000
//
int __fastcall FriendPickerPopup::buildRows(ScrollableContentLayer **this)
{
cocos2d::CCObject *v2; // r0
cocos2d::CCObject *v3; // r0
int v4; // r2
int v5; // r0
cocos2d::CCArray *v6; // r7
signed int i; // r9
int v8; // r2
cocos2d::CCObject *v9; // r0
int v10; // r5
cocos2d::CCObject *v11; // r8
int v12; // r0
int v13; // r5
int v14; // r3
unsigned __int8 *v16; // r6
unsigned int v17; // r2
int v18; // r1
unsigned int v19; // r1
unsigned __int8 *v20; // r3
unsigned __int8 *v21; // r5
int v22; // r0
int result; // r0
int v24; // r3
int v25; // r3
char *v26; // r1
unsigned __int8 *v27; // [sp+1Ch] [bp-28h] BYREF
int v28[3]; // [sp+24h] [bp-20h] BYREF
int v29[3]; // [sp+30h] [bp-14h] BYREF
PagedListPopup::clearStatus((PagedListPopup *)this);
FriendPickerPopup::updateCountLabel(this);
v2 = *(this + 154);
if ( v2 )
{
v2 = (cocos2d::CCObject *)cocos2d::CCObject::release(v2);
*(this + 154) = nullptr;
}
v3 = (cocos2d::CCObject *)cocos2d::CCArray::create(v2);
*(this + 154) = v3;
cocos2d::CCObject::retain(v3);
if ( *((_BYTE *)this + 640) && (v5 = (int)*(this + 151)) != 0 )
{
v6 = (cocos2d::CCArray *)(*(int (__fastcall **)(int))(*(_DWORD *)v5 + 12))(v5);
}
else if ( *((_BYTE *)this + 620) )
{
v6 = *(this + 153);
}
else
{
v6 = *(this + 152);
}
if ( !v6 || !cocos2d::CCArray::count(v6) )
{
ScrollableContentLayer::reloadVirtualRows(*(this + 136), 0.0, v4);
if ( *((_BYTE *)this + 640) )
{
v26 = "No users selected";
}
else if ( *((_BYTE *)this + 620) )
{
v26 = "No users found";
}
else
{
v26 = "No friends yet. Use the search to find users.";
}
return PagedListPopup::showStatus((PagedListPopup *)this, (cocos2d::CCLabelBMFont *)v26);
}
for ( i = 0; i < cocos2d::CCArray::count(v6); ++i )
{
v9 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(v6, i);
v10 = *((_DWORD *)v9 + 74);
v11 = v9;
v12 = GJAccountManager::sharedState(v9);
if ( v10 == *(_DWORD *)(v12 + 280) - *(_DWORD *)(v12 + 284) )
continue;
v13 = *((unsigned __int8 *)this + 620);
if ( !*((_BYTE *)this + 620) )
{
v14 = *((unsigned __int8 *)this + 628);
if ( (v14 & 1) != 0 ? *(this + 158) : (ScrollableContentLayer *)(v14 >> 1) )
{
std::string::basic_string(v28, (int)v11 + 264);
sub_74CCD0(v29, (int)v28);
if ( (v29[0] & 1) != 0 )
{
v16 = (unsigned __int8 *)v29[2];
v17 = v29[1];
}
else
{
v17 = (int)LOBYTE(v29[0]) >> 1;
v16 = (unsigned __int8 *)v29 + 1;
}
v18 = *((unsigned __int8 *)this + 628);
if ( (v18 & 1) != 0 )
{
v19 = (unsigned int)*(this + 158);
v20 = (unsigned __int8 *)*(this + 159);
}
else
{
v19 = v18 >> 1;
v20 = (unsigned __int8 *)this + 629;
}
if ( v17 < v19 )
goto LABEL_49;
if ( !v19 )
goto LABEL_28;
v21 = &v16[v17];
std::__search(
&v27,
v16,
&v16[v17],
v20,
&v20[v19],
(int (__fastcall *)(int, _DWORD))std::char_traits::eq);
if ( v27 == v21 )
LABEL_49:
v13 = 1;
else
v13 = v27 - v16 == -1;
LABEL_28:
std::string::~string((int)v29);
std::string::~string((int)v28);
if ( v13 )
continue;
}
}
if ( *((_BYTE *)this + 640) )
{
v22 = (int)*(this + 151);
if ( v22 )
{
if ( !(*(int (__fastcall **)(int, _DWORD))(*(_DWORD *)v22 + 4))(v22, *((_DWORD *)v11 + 74)) )
continue;
}
}
cocos2d::CCArray::addObject(*(this + 154), v11);
}
ScrollableContentLayer::reloadVirtualRows(*(this + 136), 0.0, v8);
result = cocos2d::CCArray::count(*(this + 154));
if ( !result )
{
if ( *((_BYTE *)this + 620) )
{
v26 = "Nothing found";
}
else
{
v24 = *((unsigned __int8 *)this + 628);
if ( (v24 & 1) != 0 )
v25 = (int)*(this + 158);
else
v25 = v24 >> 1;
if ( v25 )
v26 = "No friends match\nTap search to check all users";
else
v26 = "Nothing found";
}
return PagedListPopup::showStatus((PagedListPopup *)this, (cocos2d::CCLabelBMFont *)v26);
}
return result;
}