//
// GameLevelManager::onGetTopArtistsCompleted from 0x81071c to 0x810c0c (1264 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x85c66c
// > ??> @ 0xe3b60
//
// 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 12:54:50 +0000
//
__int64 __fastcall GameLevelManager::onGetTopArtistsCompleted(__int64 **this, __int64 a2, char *a3)
{
char *v5; // x24
_BOOL4 v6; // w21
const char *v7; // x1
size_t v8; // x0
cocos2d::CCArray *v9; // x21
cocos2d::CCString *v10; // x0
const char *CString; // x0
size_t v12; // x0
cocos2d::CCString *v13; // x0
size_t v14; // x0
unsigned __int64 v15; // x0
__int64 *v16; // x21
__int64 v17; // x1
void (__fastcall *v18)(__int64 *, __int64 *, char *); // x23
cocos2d::CCArray *v19; // x23
const char *v20; // x1
size_t v21; // x0
cocos2d::CCArray *v22; // x22
unsigned int i; // w21
cocos2d::CCString *v24; // x0
const char *v25; // x0
size_t v26; // x0
cocos2d::CCDictionary *v27; // x1
SongInfoObject *v28; // x27
cocos2d::CCObject *v29; // x0
__int64 v30; // x0
void (__fastcall ***v32)(_QWORD, cocos2d::CCArray *, char *); // x0
char *v33; // [xsp+68h] [xbp+68h]
char *v34; // [xsp+68h] [xbp+68h]
char *v35; // [xsp+68h] [xbp+68h]
char *v36; // [xsp+68h] [xbp+68h]
char *v37; // [xsp+68h] [xbp+68h]
__int64 v38[2]; // [xsp+78h] [xbp+78h] BYREF
void *v39; // [xsp+88h] [xbp+88h]
__int64 v40; // [xsp+90h] [xbp+90h] BYREF
size_t v41; // [xsp+98h] [xbp+98h]
void *v42; // [xsp+A0h] [xbp+A0h]
__int64 v43; // [xsp+A8h] [xbp+A8h] BYREF
size_t v44; // [xsp+B0h] [xbp+B0h]
void *v45; // [xsp+B8h] [xbp+B8h]
__int64 v46[2]; // [xsp+C0h] [xbp+C0h] BYREF
void *v47; // [xsp+D0h] [xbp+D0h]
__int64 v48; // [xsp+D8h] [xbp+D8h] BYREF
size_t v49; // [xsp+E0h] [xbp+E0h]
void *v50; // [xsp+E8h] [xbp+E8h]
__int64 v51; // [xsp+F0h] [xbp+F0h] BYREF
size_t v52; // [xsp+F8h] [xbp+F8h]
void *v53; // [xsp+100h] [xbp+100h]
v5 = a3 + 1;
if ( (*a3 & 1) != 0 )
v5 = *((char **)a3 + 2);
GameLevelManager::removeDLFromActive((GameLevelManager *)this, v5);
v51 = 0;
v52 = 0;
v53 = nullptr;
std::string::__init(&v51, &word_117CE08, 2u);
v6 = sub_7FEA60(a2, (__int64)&v51);
if ( (v51 & 1) != 0 )
operator delete(v53);
if ( !v6 )
{
v7 = (const char *)(a2 + 1);
if ( (*(_BYTE *)a2 & 1) != 0 )
v7 = *(const char **)(a2 + 16);
v33 = (char *)v7;
v51 = 0;
v52 = 0;
v53 = nullptr;
v8 = strlen(v7);
std::string::__init(&v51, v33, v8);
v9 = sub_80CFCC((unsigned __int8 *)&v51, "#");
if ( (v51 & 1) != 0 )
{
operator delete(v53);
if ( (unsigned int)cocos2d::CCArray::count(v9) > 1 )
{
LABEL_10:
v10 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v9, 0);
CString = (const char *)cocos2d::CCString::getCString(v10);
v38[0] = 0;
v34 = (char *)CString;
v38[1] = 0;
v39 = nullptr;
v12 = strlen(CString);
std::string::__init(v38, v34, v12);
v13 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v9, 1u);
v35 = (char *)cocos2d::CCString::getCString(v13);
v40 = 0;
v41 = 0;
v42 = nullptr;
v14 = strlen(v35);
v15 = std::string::__init(&v40, v35, v14);
v16 = *(this + 182);
if ( v16 )
{
v17 = *v16;
v43 = 0;
v18 = *(void (__fastcall **)(__int64 *, __int64 *, char *))(v17 + 16);
v44 = 0;
v45 = nullptr;
if ( (v40 & 1) != 0 )
{
std::string::__init(&v43, v42, v41);
}
else
{
v45 = v42;
v43 = v40;
v44 = v41;
}
v18(v16, &v43, v5);
v15 = (unsigned __int8)v43;
if ( (v43 & 1) != 0 )
operator delete(v45);
}
v19 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)v15);
v20 = (char *)v38 + 1;
if ( (v38[0] & 1) != 0 )
v20 = (const char *)v39;
v36 = (char *)v20;
v46[0] = 0;
v46[1] = 0;
v47 = nullptr;
v21 = strlen(v20);
std::string::__init(v46, v36, v21);
v22 = sub_80CFCC((unsigned __int8 *)v46, "|");
if ( (v46[0] & 1) != 0 )
operator delete(v47);
for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(v22); ++i )
{
v24 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v22, i);
v25 = (const char *)cocos2d::CCString::getCString(v24);
v51 = 0;
v52 = 0;
v53 = nullptr;
v37 = (char *)v25;
v26 = strlen(v25);
std::string::__init(&v51, v37, v26);
v48 = 0;
v49 = 0;
v50 = nullptr;
if ( (v51 & 1) != 0 )
{
std::string::__init(&v48, v53, v52);
}
else
{
v50 = v53;
v48 = v51;
v49 = v52;
}
v28 = (SongInfoObject *)GameLevelManager::responseToDict((__int64)&v48, 0);
if ( (v48 & 1) != 0 )
operator delete(v50);
v29 = (cocos2d::CCObject *)SongInfoObject::create(v28, v27);
cocos2d::CCArray::addObject(v19, v29);
if ( (v51 & 1) != 0 )
operator delete(v53);
}
v51 = 0;
v52 = 0;
v53 = nullptr;
if ( (v40 & 1) != 0 )
{
std::string::__init(&v51, v42, v41);
}
else
{
v51 = v40;
v52 = v41;
v53 = v42;
}
GameLevelManager::storeSearchResult((GameLevelManager *)this, v19, (__int64)&v51, v5);
if ( (v51 & 1) != 0 )
operator delete(v53);
v32 = (void (__fastcall ***)(_QWORD, cocos2d::CCArray *, char *))*(this + 182);
if ( v32 )
(**v32)(v32, v19, v5);
if ( (v40 & 1) != 0 )
operator delete(v42);
if ( (v38[0] & 1) != 0 )
operator delete(v39);
return _stack_chk_guard;
}
}
else if ( (unsigned int)cocos2d::CCArray::count(v9) > 1 )
{
goto LABEL_10;
}
}
v30 = (__int64)*(this + 182);
if ( v30 )
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v30 + 8LL))(v30, v5);
return _stack_chk_guard;
}