//
// sub_1005786D0 from 0x1005786d0 to 0x10057883d (365 bytes)
//
// 1 xrefs:
// > MemberListPopup::friendPickerAdd @ 0x1009437ab
//
// 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 12:32:17 +0000
//
__int64 __fastcall sub_1005786D0(__int64 a1, int a2, __int64 a3)
{
__int64 v4; // rax
const std::string::value_type *CString; // rax
int i; // r12d
__int64 v7; // rax
const std::string::value_type *v8; // rax
unsigned int v9; // r14d
unsigned int v10; // eax
_DWORD *v11; // rdi
__int64 v12; // rax
std::string v14; // [rsp+0h] [rbp-50h] BYREF
int v15; // [rsp+1Ch] [rbp-34h]
__int64 v16; // [rsp+20h] [rbp-30h]
v16 = a1;
if ( a3 && (v15 = a2, (unsigned int)sub_1007FEF90(a3)) )
{
memset(&v14, 0, sizeof(v14));
if ( (int)sub_1007FEF90(a3) > 0 )
{
sub_1007FEFE0(a3, 0);
v4 = sub_10088E820("%i", *(_BYTE *)&v14.__r_.__value_.__l.0);
CString = (const std::string::value_type *)cocos2d::CCString::getCString(v4);
std::string::append(&v14, CString);
for ( i = 1; i < (int)sub_1007FEF90(a3); ++i )
{
std::string::append(&v14, ",");
sub_1007FEFE0(a3, (unsigned int)i);
v7 = sub_10088E820("%i", *(_BYTE *)&v14.__r_.__value_.__l.0);
v8 = (const std::string::value_type *)cocos2d::CCString::getCString(v7);
std::string::append(&v14, v8);
}
}
LOBYTE(v10) = GameLevelManager::updateThread(v16, v15, 4, &v14);
v9 = v10;
if ( (_BYTE)v10 )
{
v11 = *(_DWORD **)(v16 + 680);
if ( v11 )
cocos2d::CCObject::release(v11);
v12 = sub_1007FE900(v11);
*(_QWORD *)(v16 + 680) = v12;
cocos2d::CCObject::retain(v12);
sub_1007FEF70(*(_QWORD *)(v16 + 680), a3);
}
if ( (*(_BYTE *)&v14.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v14.__r_.__value_.__l.__data_);
}
else
{
return 0;
}
return v9;
}