//
// GameLevelManager::onGetUserListCompleted from 0x4d4eb0 to 0x4d51c6 (790 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x4dac7a
//
// 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:50:51 +0000
//
int (***__fastcall GameLevelManager::onGetUserListCompleted(GameLevelManager *a1, int a2, char *a3))(void)
{
char v5; // r1
const char *v6; // r6
size_t v7; // r0
_BOOL4 v8; // r8
size_t v9; // r0
_BOOL4 v10; // r8
size_t v11; // r0
_BOOL4 v12; // r8
int v13; // r8
_BOOL4 v14; // r10
const char *v15; // r0
cocos2d::CCArray *v16; // r0
int (***result)(void); // r0
int (*v18)(void); // r3
cocos2d::CCArray *v19; // r0
bool v20; // nf
cocos2d::CCArray *v21; // r11
size_t v22; // r0
unsigned int v23; // r10
cocos2d::CCString *v24; // r0
const char *CString; // r0
const char *v26; // r7
size_t v27; // r0
cocos2d::CCNode *v28; // r0
cocos2d::CCDictionary *v29; // r1
cocos2d::CCNode *v30; // r7
int v31; // r3
size_t v32; // r0
int v33; // r5
cocos2d::CCArray *v34; // [sp+8h] [bp-3Ch]
const char *v35; // [sp+Ch] [bp-38h]
char *v36; // [sp+10h] [bp-34h]
int v37[3]; // [sp+18h] [bp-2Ch] BYREF
int v38; // [sp+24h] [bp-20h] BYREF
int v39; // [sp+28h] [bp-1Ch]
int v40; // [sp+2Ch] [bp-18h]
int v41; // [sp+30h] [bp-14h] BYREF
int v42; // [sp+34h] [bp-10h]
int v43; // [sp+38h] [bp-Ch]
v38 = 0;
v5 = *a3;
v39 = 0;
v40 = 0;
if ( (v5 & 1) != 0 )
v6 = *((const char **)a3 + 2);
else
v6 = a3 + 1;
v7 = strlen(v6);
std::string::__init(&v38, v6, v7);
v41 = 0;
v42 = 0;
v43 = 0;
std::string::__init(&v41, "get_friends", 0xBu);
v8 = sub_4A9CC4((unsigned __int8 *)&v38, (unsigned __int8 *)&v41);
std::string::~string((int)&v41);
std::string::~string((int)&v38);
if ( v8 )
{
v13 = 0;
}
else
{
v38 = 0;
v39 = 0;
v40 = 0;
v9 = strlen(v6);
std::string::__init(&v38, v6, v9);
v41 = 0;
v42 = 0;
v43 = 0;
std::string::__init(&v41, "get_following", 0xDu);
v10 = sub_4A9CC4((unsigned __int8 *)&v38, (unsigned __int8 *)&v41);
std::string::~string((int)&v41);
std::string::~string((int)&v38);
if ( v10 )
{
v13 = 3;
}
else
{
v38 = 0;
v39 = 0;
v40 = 0;
v11 = strlen(v6);
std::string::__init(&v38, v6, v11);
v41 = 0;
v42 = 0;
v43 = 0;
std::string::__init(&v41, "get_muted", 9u);
v12 = sub_4A9CC4((unsigned __int8 *)&v38, (unsigned __int8 *)&v41);
std::string::~string((int)&v41);
std::string::~string((int)&v38);
if ( v12 )
v13 = 4;
else
v13 = 1;
}
}
GameLevelManager::removeDLFromActive(a1, v6);
v41 = 0;
v42 = 0;
v43 = 0;
std::string::__init(&v41, "-1", 2u);
v14 = sub_4A9CC4((unsigned __int8 *)a2, (unsigned __int8 *)&v41);
std::string::~string((int)&v41);
if ( !v14 )
{
if ( (*(_BYTE *)a2 & 1) != 0 )
v15 = *(const char **)(a2 + 8);
else
v15 = (const char *)(a2 + 1);
v16 = (cocos2d::CCArray *)atoi(v15);
if ( (int)v16 < 0 )
{
result = *((int (****)(void))a1 + 223);
if ( result )
{
v18 = (*result)[1];
return (int (***)(void))v18();
}
return result;
}
v19 = (cocos2d::CCArray *)cocos2d::CCArray::create(v16);
v20 = (*(_BYTE *)a2 & 1) != 0;
if ( (*(_BYTE *)a2 & 1) == 0 )
++a2;
v41 = 0;
if ( v20 )
a2 = *(_DWORD *)(a2 + 8);
v42 = 0;
v43 = 0;
v21 = v19;
v22 = strlen((const char *)a2);
std::string::__init(&v41, (const void *)a2, v22);
v34 = sub_4C1A88(&v41, "|");
v23 = 0;
std::string::~string((int)&v41);
while ( 1 )
{
if ( v23 >= cocos2d::CCArray::count(v34) )
{
if ( !cocos2d::CCArray::count(v21) )
break;
v41 = 0;
v42 = 0;
v43 = 0;
v32 = strlen(v6);
v33 = *((_DWORD *)a1 + 181);
std::string::__init(&v41, v6, v32);
cocos2d::CCDictionary::setObject(v33, v21);
std::string::~string((int)&v41);
result = *((int (****)(void))a1 + 223);
if ( result )
{
v18 = **result;
return (int (***)(void))v18();
}
return result;
}
v24 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v34, v23);
CString = (const char *)cocos2d::CCString::getCString(v24);
memset(v37, 0, sizeof(v37));
v26 = CString;
v27 = strlen(CString);
std::string::__init(v37, v26, v27);
std::string::basic_string(&v38, (int)v37);
v28 = (cocos2d::CCNode *)GameLevelManager::responseToDict((cocos2d::CCDictionary *)&v38, 0);
v30 = GJUserScore::create(v28, v29);
std::string::~string((int)&v38);
if ( v13 == 1 )
{
v31 = 2;
}
else
{
v31 = 1;
if ( v13 == 3 )
{
*((_BYTE *)v30 + 552) = 1;
goto LABEL_37;
}
if ( v13 == 4 )
{
*((_BYTE *)v30 + 555) = 1;
goto LABEL_37;
}
}
*((_DWORD *)v30 + 130) = v31;
LABEL_37:
if ( *((int *)v30 + 74) > 0 && *((int *)v30 + 73) > 0 )
{
cocos2d::CCArray::addObject(v21, v30);
v35 = *((const char **)v30 + 73);
v36 = *((char **)v30 + 74);
std::string::basic_string(&v41, (int)v30 + 264);
GameLevelManager::storeUserName((unsigned __int8 *)a1, v35, v36, (unsigned __int8 *)&v41);
std::string::~string((int)&v41);
}
++v23;
std::string::~string((int)v37);
}
}
result = *((int (****)(void))a1 + 223);
if ( result )
{
v18 = (*result)[1];
return (int (***)(void))v18();
}
return result;
}