//
// GameLevelManager::onRateDemonCompleted from 0x1000906a0 to 0x100090848 (424 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x1000896f4
//
// 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
//
void __fastcall GameLevelManager::onRateDemonCompleted(_QWORD *a1, _QWORD *a2, char *__s)
{
char *v3; // x20
__int64 v6; // x22
GameLevelManager *v7; // x0
__int64 SplitIntFromKey; // x20
_BOOL4 v9; // w0
_BOOL4 v10; // w22
__int64 v11; // x0
__int64 v12; // x19
cocos2d::CCString *v13; // x0
char *CString; // x0
_BOOL4 v15; // w0
_BOOL4 v16; // w21
GameManager *v17; // x21
float v18; // s0
__int64 v19; // x0
void (*v20)(void); // x8
void (***v21)(void); // x0
void *__p[2]; // [xsp+8h] [xbp-38h] BYREF
char v23; // [xsp+1Fh] [xbp-21h]
v3 = __s;
if ( __s[23] < 0 )
v3 = *(char **)__s;
v6 = a1[76];
sub_100009900(__p, v3);
v7 = (GameLevelManager *)cocos2d::CCDictionary::removeObjectForKey_1(v6, (char *)__p);
if ( v23 < 0 )
operator delete(__p[0]);
SplitIntFromKey = GameLevelManager::getSplitIntFromKey(v7, v3, 1);
sub_100009900(__p, "-1");
v9 = sub_1000045BC(a2, __p);
v10 = v9;
if ( v23 < 0 )
{
operator delete(__p[0]);
if ( v10 )
goto LABEL_7;
LABEL_12:
sub_100009900(__p, "-2");
v15 = sub_1000045BC(a2, __p);
v16 = v15;
if ( v23 < 0 )
{
operator delete(__p[0]);
if ( v16 )
goto LABEL_14;
}
else if ( v15 )
{
LABEL_14:
v17 = GameManager::sharedState();
v17->m_hasRP.value = 0;
v18 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;
v17->m_hasRP.seed = (int)v18;
v17->m_hasRP.random = (int)v18;
v19 = a1[101];
if ( !v19 )
return;
v20 = *(void (**)(void))(*(_QWORD *)v19 + 8LL);
LABEL_19:
v20();
return;
}
v21 = (void (***)(void))a1[101];
if ( !v21 )
return;
v20 = **v21;
goto LABEL_19;
}
if ( !v9 )
goto LABEL_12;
LABEL_7:
v11 = a1[101];
if ( v11 )
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v11 + 8LL))(v11, SplitIntFromKey, 50);
v12 = a1[52];
v13 = (cocos2d::CCString *)sub_100268F4C("%i", SplitIntFromKey);
CString = (char *)cocos2d::CCString::getCString(v13);
sub_100009900(__p, CString);
cocos2d::CCDictionary::removeObjectForKey_1(v12, (char *)__p);
if ( v23 < 0 )
operator delete(__p[0]);
}