//
// GameLevelManager::markLevelAsRatedDemon from 0x802624 to 0x80279c (376 bytes)
//
// 2 xrefs:
// > GameLevelManager::rateDemon @ 0x8210e4
// > ??> @ 0xf5bf0
//
// 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:44 +0000
//
__int64 __fastcall GameLevelManager::markLevelAsRatedDemon(cocos2d::CCDictionary **this, unsigned int a2)
{
__int64 v4; // x24
cocos2d::CCObject *v5; // x23
cocos2d::CCString *v6; // x0
const char *CString; // x0
const char *v8; // x25
size_t v9; // x0
size_t v10; // x19
unsigned __int64 v11; // x0
__int64 v12; // x22
char *v13; // x0
char *v14; // x3
__int64 v16; // [xsp+50h] [xbp+50h] BYREF
size_t v17; // [xsp+58h] [xbp+58h]
void *v18; // [xsp+60h] [xbp+60h]
if ( (unsigned int)cocos2d::CCDictionary::count(*(this + 102)) > 0x3E7 )
{
cocos2d::CCDictionary::getFirstKey(&v16, *(this + 102));
cocos2d::CCDictionary::removeObjectForKey(*(this + 102), &v16);
if ( (v16 & 1) != 0 )
operator delete(v18);
}
v4 = (__int64)*(this + 102);
v5 = *(this + 189);
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)a2);
CString = (const char *)cocos2d::CCString::getCString(v6);
v16 = 0;
v8 = CString;
v17 = 0;
v18 = nullptr;
v9 = strlen(CString);
v10 = v9;
if ( v9 > 0xFFFFFFFFFFFFFFEFLL )
sub_62C79C();
if ( v9 > 0x16 )
{
v11 = (v9 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v12 = v11 | 1;
v13 = (char *)operator new(v11);
v16 = v12;
v14 = v13;
v18 = v13;
v17 = v10;
LABEL_7:
v14 = (char *)memcpy(v14, v8, v10);
goto LABEL_8;
}
LOBYTE(v16) = 2 * v9;
v14 = (char *)&v16 + 1;
if ( v9 )
goto LABEL_7;
LABEL_8:
v14[v10] = 0;
cocos2d::CCDictionary::setObject(v4, v5);
if ( (v16 & 1) != 0 )
operator delete(v18);
return _stack_chk_guard;
}