//
// GameLevelManager::suggestLevelStars from 0x140154d90 to 0x1401550ab (795 bytes)
//
// 3 xrefs:
// > GJRateLevelLayer::onRate @ 0x1402f6b30
// > RateStarsLayer::onRate @ 0x1403cab76
// > ??> @ 0x1406ca920
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=4
void GameLevelManager::suggestLevelStars(GameLevelManager *a1, int a2, int a3, int a4)
{
cocos2d::CCString *v8; // rax
const char *CString; // rax
const char *v10; // rdi
size_t v11; // rbx
size_t v12; // r8
__int64 v13; // rsi
void *v14; // rcx
size_t v15; // r8
__int64 v16; // rax
__int64 v17; // rcx
void *v18; // rcx
cocos2d::CCString *v19; // rax
const char *v20; // rax
cocos2d::CCString *v21; // rax
char *v22; // rax
size_t v23; // r8
size_t v24; // r8
_QWORD *v25; // rdx
__int128 v26; // [rsp+40h] [rbp-89h] BYREF
__int64 v27; // [rsp+50h] [rbp-79h]
__int64 v28; // [rsp+58h] [rbp-71h]
__int128 v29; // [rsp+60h] [rbp-69h] BYREF
__int64 v30; // [rsp+70h] [rbp-59h]
__int64 v31; // [rsp+78h] [rbp-51h]
__int128 *v32; // [rsp+80h] [rbp-49h]
__int128 *v33; // [rsp+88h] [rbp-41h]
void *Block[2]; // [rsp+98h] [rbp-31h] BYREF
__int128 v35; // [rsp+A8h] [rbp-21h]
_QWORD Src[4]; // [rsp+B8h] [rbp-11h] BYREF
v8 = cocos2d::CCString::createWithFormat("suggest_%i_%i_%i", a2, a3, a4);
CString = cocos2d::CCString::getCString(v8);
v10 = CString;
*(_OWORD *)Block = 0;
v35 = 0;
v11 = -1;
v12 = -1;
do
++v12;
while ( CString[v12] );
sub_14003A930(Block, CString, v12);
v13 = cocos2d::CCDictionary::objectForKey(a1->m_friendReqAndUserBlocks, Block);
if ( *((_QWORD *)&v35 + 1) > 0xFu )
{
v14 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v35 + 1) + 1LL) >= 0x1000 )
{
v14 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v14 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v14);
}
if ( !v13 )
{
*(_OWORD *)Block = 0;
v35 = 0;
v15 = -1;
do
++v15;
while ( v10[v15] );
sub_14003A930(Block, v10, v15);
v16 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject(a1->m_friendReqAndUserBlocks, v16, Block);
if ( *((_QWORD *)&v35 + 1) > 0xFu )
{
v18 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v35 + 1) + 1LL) >= 0x1000 )
{
v18 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v18 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v18);
}
GameLevelManager::getBasePostString(v17, Src);
v19 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 87, "mfp", "3879", 103, 99, (const char *)&word_140531E9C);
v20 = cocos2d::CCString::getCString(v19);
v21 = cocos2d::CCString::createWithFormat("&levelID=%i&stars=%i&feature=%i&secret=%s", a2, a3, a4, v20);
v22 = (char *)cocos2d::CCString::getCString(v21);
v23 = -1;
do
++v23;
while ( v22[v23] );
sub_140041270(Src, v22, v23);
v32 = &v26;
v33 = &v29;
v26 = 0;
v27 = 0;
v28 = 0;
v24 = -1;
do
++v24;
while ( v10[v24] );
sub_14003A930(&v26, v10, v24);
v25 = Src;
if ( Src[3] > 0xFu )
v25 = (_QWORD *)Src[0];
v29 = 0;
v30 = 0;
v31 = 0;
do
++v11;
while ( *((_BYTE *)v25 + v11) );
sub_14003A930(&v29, v25, v11);
*(_OWORD *)Block = 0;
*(_QWORD *)&v35 = 0;
*((_QWORD *)&v35 + 1) = 15;
Block[0] = sub_14003AA10(0x40u);
*(_QWORD *)&v35 = 55;
*((_QWORD *)&v35 + 1) = 63;
strcpy((char *)Block[0], "https://www.boomlings.com/database/suggestGJStars20.php");
GameLevelManager::ProcessHttpRequest(a1, (__int64)Block, (const char *)&v29, (const char *)&v26, 45);
sub_14003A830((__int64)Src);
}
}