//
// GameLevelManager::onRateDemonCompleted from 0x80d7fc to 0x80da5c (608 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x85ac60
// > ??> @ 0x69130
//
// 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:48 +0000
//
__int64 __fastcall GameLevelManager::onRateDemonCompleted(GameLevelManager *a1, __int64 a2, char *a3)
{
char *v5; // x20
size_t v6; // x0
__int64 v7; // x24
unsigned int SplitIntFromKey; // w20
_BOOL4 v9; // w24
__int64 v10; // x0
const char *v11; // x1
__int64 v12; // x20
cocos2d::CCString *v13; // x0
const char *CString; // x0
size_t v15; // x0
_BOOL8 v17; // x0
_BOOL4 v18; // w19
void (__fastcall ***v19)(_QWORD, _QWORD, __int64); // x0
__int64 v20; // x0
__int64 v21; // x19
float v22; // s0
__int64 v23; // x0
char *v24; // [xsp+48h] [xbp+48h]
__int64 v25; // [xsp+50h] [xbp+50h] BYREF
__int64 v26; // [xsp+58h] [xbp+58h]
void *v27; // [xsp+60h] [xbp+60h]
v5 = a3 + 1;
if ( (*a3 & 1) != 0 )
v5 = *((char **)a3 + 2);
v25 = 0;
v26 = 0;
v27 = nullptr;
v6 = strlen(v5);
v7 = *((_QWORD *)a1 + 136);
std::string::__init(&v25, v5, v6);
cocos2d::CCDictionary::removeObjectForKey(v7, &v25);
if ( (v25 & 1) != 0 )
operator delete(v27);
SplitIntFromKey = GameLevelManager::getSplitIntFromKey(a1, v5, 1u);
v25 = 0;
v26 = 0;
v27 = nullptr;
std::string::__init(&v25, &word_117CE08, 2u);
v9 = sub_7FEA60(a2, (__int64)&v25);
if ( (v25 & 1) != 0 )
{
operator delete(v27);
if ( v9 )
goto LABEL_7;
}
else if ( v9 )
{
LABEL_7:
v10 = *((_QWORD *)a1 + 170);
if ( v10 )
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v10 + 8LL))(v10, SplitIntFromKey, 56);
v11 = (const char *)SplitIntFromKey;
v12 = *((_QWORD *)a1 + 102);
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v11);
CString = (const char *)cocos2d::CCString::getCString(v13);
v25 = 0;
v24 = (char *)CString;
v26 = 0;
v27 = nullptr;
v15 = strlen(CString);
std::string::__init(&v25, v24, v15);
cocos2d::CCDictionary::removeObjectForKey(v12, &v25);
if ( (v25 & 1) != 0 )
operator delete(v27);
return _stack_chk_guard;
}
v25 = 0;
v26 = 0;
v27 = nullptr;
std::string::__init(&v25, "-2", 2u);
v17 = sub_7FEA60(a2, (__int64)&v25);
v18 = v17;
if ( (v25 & 1) != 0 )
operator delete(v27);
if ( v18 )
{
v20 = GameManager::sharedState((GameManager *)v17);
*(_DWORD *)(v20 + 1040) = 0;
v21 = v20;
v22 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*(_DWORD *)(v21 + 1036) = (int)v22;
*(_DWORD *)(v21 + 1032) = (int)v22;
v23 = *((_QWORD *)a1 + 170);
if ( v23 )
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v23 + 8LL))(v23, SplitIntFromKey, 56);
}
else
{
v19 = *((void (__fastcall ****)(_QWORD, _QWORD, __int64))a1 + 170);
if ( v19 )
(**v19)(v19, SplitIntFromKey, 56);
}
return _stack_chk_guard;
}