//
// GameLevelManager::getTopArtists from 0x822574 to 0x822844 (720 bytes)
//
// 3 xrefs:
// > TopArtistsLayer::init @ 0xaad0fc
// > TopArtistsLayer::loadPage @ 0xaad5a4
// > ??> @ 0xc4420
//
// 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:55:02 +0000
//
__int64 __fastcall GameLevelManager::getTopArtists(GameLevelManager *this, const char *a2, unsigned int a3)
{
unsigned int v4; // w23
size_t v6; // x0
char *v7; // x1
char *v8; // x1
cocos2d::CCString *v9; // x0
__int64 CString; // x0
cocos2d::CCString *v11; // x0
size_t v12; // x0
const char *v13; // x1
size_t v14; // x0
char *TopArtistsKey; // [xsp+48h] [xbp+48h]
char *v17; // [xsp+48h] [xbp+48h]
char *v18; // [xsp+48h] [xbp+48h]
__int64 v19; // [xsp+50h] [xbp+50h] BYREF
size_t v20; // [xsp+58h] [xbp+58h]
char *v21; // [xsp+60h] [xbp+60h]
__int64 v22[2]; // [xsp+68h] [xbp+68h] BYREF
void *v23; // [xsp+78h] [xbp+78h]
__int64 v24[2]; // [xsp+80h] [xbp+80h] BYREF
void *v25; // [xsp+90h] [xbp+90h]
__int64 v26[2]; // [xsp+98h] [xbp+98h] BYREF
void *v27; // [xsp+A8h] [xbp+A8h]
__int64 v28; // [xsp+B0h] [xbp+B0h] BYREF
size_t v29; // [xsp+B8h] [xbp+B8h]
void *v30; // [xsp+C0h] [xbp+C0h]
v4 = (unsigned int)a2;
v19 = 0;
TopArtistsKey = (char *)GameLevelManager::getTopArtistsKey(this, a2);
v20 = 0;
v21 = nullptr;
v6 = strlen(TopArtistsKey);
std::string::__init(&v19, TopArtistsKey, v6);
v7 = (char *)&v19 + 1;
if ( (v19 & 1) != 0 )
v7 = v21;
if ( !GameLevelManager::isDLActive(this, v7) )
{
v8 = (char *)&v19 + 1;
if ( (v19 & 1) != 0 )
v8 = v21;
GameLevelManager::addDLToActive(this, v8);
GameLevelManager::getBasePostString(v22);
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7");
CString = cocos2d::CCString::getCString(v9);
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&page=%i&secret=%s&total=%i",
(const char *)v4,
CString,
a3);
v17 = (char *)cocos2d::CCString::getCString(v11);
v12 = strlen(v17);
std::string::append((__int64)v22, v17, v12);
v24[0] = 0;
v24[1] = 0;
v25 = nullptr;
std::string::__init(v24, "https://www.boomlings.com/database/getGJTopArtists.php", 0x36u);
v13 = (char *)v22 + 1;
if ( (v22[0] & 1) != 0 )
v13 = (const char *)v23;
v18 = (char *)v13;
v26[0] = 0;
v26[1] = 0;
v27 = nullptr;
v14 = strlen(v13);
std::string::__init(v26, v18, v14);
v28 = 0;
v29 = 0;
v30 = nullptr;
if ( (v19 & 1) != 0 )
{
std::string::__init(&v28, v21, v20);
}
else
{
v28 = v19;
v29 = v20;
v30 = v21;
}
GameLevelManager::ProcessHttpRequest(this, v24, (__int64)v26, (char *)&v28, 59);
if ( (v28 & 1) != 0 )
operator delete(v30);
if ( (v26[0] & 1) != 0 )
operator delete(v27);
if ( (v24[0] & 1) != 0 )
operator delete(v25);
if ( (v22[0] & 1) != 0 )
operator delete(v23);
}
if ( (v19 & 1) != 0 )
operator delete(v21);
return _stack_chk_guard;
}