//
// GameLevelManager::suggestLevelStars from 0x820cc0 to 0x82105c (924 bytes)
//
// 4 xrefs:
// > GJRateLevelLayer::onRate @ 0x953210
// > RateStarsLayer::onRate @ 0x9578d0
// > RateStarsModLayer::onRate @ 0xcfcf48
// > ??> @ 0x7d4d0
//
// 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:01 +0000
//
__int64 __fastcall GameLevelManager::suggestLevelStars(
GameLevelManager *this,
const char *a2,
unsigned int a3,
unsigned int a4,
unsigned __int8 a5,
unsigned int a6)
{
unsigned int v7; // w25
unsigned int v8; // w28
cocos2d::CCString *v11; // x0
char *CString; // x23
size_t v13; // x0
size_t v14; // x19
__int64 v15; // x24
char *v16; // x3
__int64 v17; // x19
__int64 result; // x0
cocos2d::CCObject *v19; // x19
size_t v20; // x0
cocos2d::CCString *v21; // x0
__int64 v22; // x0
cocos2d::CCString *v23; // x0
size_t v24; // x0
const char *v25; // x1
size_t v26; // x0
size_t v27; // x0
unsigned __int64 v28; // [xsp+60h] [xbp+60h]
int v29[2]; // [xsp+60h] [xbp+60h]
char *v31; // [xsp+68h] [xbp+68h]
char *v32; // [xsp+68h] [xbp+68h]
__int64 v33[2]; // [xsp+78h] [xbp+78h] BYREF
void *v34; // [xsp+88h] [xbp+88h]
__int64 v35[2]; // [xsp+90h] [xbp+90h] BYREF
void *v36; // [xsp+A0h] [xbp+A0h]
__int64 v37[2]; // [xsp+A8h] [xbp+A8h] BYREF
void *v38; // [xsp+B8h] [xbp+B8h]
unsigned __int64 v39; // [xsp+C0h] [xbp+C0h] BYREF
size_t v40; // [xsp+C8h] [xbp+C8h]
void *v41; // [xsp+D0h] [xbp+D0h]
v7 = a5;
v8 = (unsigned int)a2;
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"suggest_%i_%i_%i", a2);
v39 = 0;
CString = (char *)cocos2d::CCString::getCString(v11);
v40 = 0;
v41 = nullptr;
v13 = strlen(CString);
v14 = v13;
v15 = *((_QWORD *)this + 136);
if ( v13 > 0xFFFFFFFFFFFFFFEFLL )
sub_62C79C();
if ( v13 > 0x16 )
{
v28 = (v13 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v40 = v13;
v16 = (char *)operator new(v28);
v41 = v16;
v39 = v28 | 1;
LABEL_4:
v16 = (char *)memcpy(v16, CString, v14);
goto LABEL_5;
}
LOBYTE(v39) = 2 * v13;
v16 = (char *)&v39 + 1;
if ( v13 )
goto LABEL_4;
LABEL_5:
v16[v14] = 0;
v17 = cocos2d::CCDictionary::objectForKey(v15, &v39);
if ( (v39 & 1) != 0 )
{
operator delete(v41);
result = 0;
if ( v17 )
return result;
}
else
{
result = 0;
if ( v17 )
return result;
}
*(_QWORD *)v29 = *((_QWORD *)this + 136);
v19 = (cocos2d::CCObject *)cocos2d::CCNode::create(nullptr);
v39 = 0;
v40 = 0;
v41 = nullptr;
v20 = strlen(CString);
std::string::__init((__int64 *)&v39, CString, v20);
cocos2d::CCDictionary::setObject(v29[0], v19);
if ( (v39 & 1) != 0 )
operator delete(v41);
GameLevelManager::getBasePostString(v33);
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfp",
"3879",
103,
99,
"3");
v22 = cocos2d::CCString::getCString(v21);
v23 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&levelID=%i&stars=%i&feature=%i&coin=%i&demonDiff=%i&secret=%s",
(const char *)v8,
a3,
a4,
v7,
a6,
v22);
v31 = (char *)cocos2d::CCString::getCString(v23);
v24 = strlen(v31);
std::string::append((__int64)v33, v31, v24);
v35[0] = 0;
v35[1] = 0;
v36 = nullptr;
std::string::__init(v35, "https://www.boomlings.com/database/suggestGJStars20.php", 0x37u);
v25 = (char *)v33 + 1;
if ( (v33[0] & 1) != 0 )
v25 = (const char *)v34;
v32 = (char *)v25;
v37[0] = 0;
v37[1] = 0;
v38 = nullptr;
v26 = strlen(v25);
std::string::__init(v37, v32, v26);
v39 = 0;
v40 = 0;
v41 = nullptr;
v27 = strlen(CString);
std::string::__init((__int64 *)&v39, CString, v27);
GameLevelManager::ProcessHttpRequest(this, v35, (__int64)v37, (char *)&v39, 51);
if ( (v39 & 1) != 0 )
operator delete(v41);
if ( (v37[0] & 1) != 0 )
operator delete(v38);
if ( (v35[0] & 1) != 0 )
operator delete(v36);
if ( (v33[0] & 1) != 0 )
operator delete(v34);
return 1;
}