//
// GameLevelManager::getSongUsage from 0x4b99b4 to 0x4b9b1a (358 bytes)
//
// 1 xrefs:
// > SongUsagePopup::init @ 0x760574
//
// 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:14 +0000
//
int __fastcall GameLevelManager::getSongUsage(GameLevelManager *this, const char *a2)
{
cocos2d::CCString *v4; // r0
const char *CString; // r5
size_t v6; // r0
char *v7; // r1
int v8; // r2
char *v9; // r1
cocos2d::CCString *v10; // r0
int v11; // r0
cocos2d::CCString *v12; // r0
char *v13; // r0
size_t v14; // r0
int v16[2]; // [sp+10h] [bp+0h] BYREF
char *v17; // [sp+18h] [bp+8h]
char *v18[3]; // [sp+1Ch] [bp+Ch] BYREF
int v19[3]; // [sp+28h] [bp+18h] BYREF
int v20[3]; // [sp+34h] [bp+24h] BYREF
int v21[3]; // [sp+40h] [bp+30h] BYREF
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"susage_%i", a2);
v16[0] = 0;
v16[1] = 0;
v17 = nullptr;
CString = (const char *)cocos2d::CCString::getCString(v4);
v6 = strlen(CString);
std::string::__init(v16, CString, v6);
if ( (v16[0] & 1) != 0 )
v7 = v17;
else
v7 = (char *)v16 + 1;
if ( !GameLevelManager::isDLActive(this, v7) )
{
if ( (v16[0] & 1) != 0 )
v9 = v17;
else
v9 = (char *)v16 + 1;
GameLevelManager::addDLToActive(this, v9, v8, LOBYTE(v16[0]));
GameLevelManager::getBasePostString((GameLevelManager *)v18);
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_54 + 3,
"mfd",
"2893",
103,
98,
&a1i2r3e45s789g[9]);
v11 = cocos2d::CCString::getCString(v10);
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"&songID=%i&secret=%s", a2, v11);
v13 = (char *)cocos2d::CCString::getCString(v12);
std::string::append(v18, v13);
memset(v19, 0, sizeof(v19));
std::string::__init(v19, "https://www.boomlings.com/database/getGJSongUsage.php", 0x35u);
if ( ((int)v18[0] & 1) == 0 )
CString = (char *)v18 + 1;
v20[0] = 0;
if ( ((int)v18[0] & 1) != 0 )
CString = v18[2];
v20[1] = 0;
v20[2] = 0;
v14 = strlen(CString);
std::string::__init(v20, CString, v14);
std::string::basic_string(v21, (int)v16);
GameLevelManager::ProcessHttpRequest(this, v19, (int)v20, (int)v21, 108);
std::string::~string((int)v21);
std::string::~string((int)v20);
std::string::~string((int)v19);
std::string::~string((int)v18);
}
return std::string::~string((int)v16);
}