//
// RateDemonLayer::onRate from 0xa8404c to 0xa84168 (284 bytes)
//
// 3 xrefs:
// > ??> @ 0xe4d90
// > RateDemonLayer::init @ 0xa846e8
// > ??> @ 0x1546e28
//
// 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 13:00:33 +0000
//
__int64 __fastcall RateDemonLayer::onRate(RateDemonLayer *this, cocos2d::CCObject *a2)
{
GameLevelManager *v3; // x0
__int64 v5; // x0
__int64 v6; // x0
char v7; // w1
void *v8[3]; // [xsp+20h] [xbp+20h] BYREF
if ( *((_DWORD *)this + 179) != -1 )
{
v3 = (GameLevelManager *)GameLevelManager::sharedState(_stack_chk_guard);
if ( (unsigned __int8)GameLevelManager::rateDemon(
v3,
(char *)*((unsigned int *)this + 178),
*((_DWORD *)this + 179),
*((_BYTE *)this + 720)) )
{
if ( !*((_BYTE *)this + 720) )
{
LABEL_4:
RateDemonLayer::onClose(this, nullptr);
return _stack_chk_guard;
}
*(_QWORD *)(GameLevelManager::sharedState((GameLevelManager *)*((unsigned __int8 *)this + 720)) + 1360) = (char *)this + 672;
v5 = *((_QWORD *)this + 91);
if ( v5 )
*(_QWORD *)(v5 + 664) = 0;
BYTE1(v8[2]) = 0;
WORD1(v8[2]) = 0;
HIDWORD(v8[2]) = 0;
strcpy((char *)v8, "\"Sending rating.");
v6 = UploadActionPopup::create((__int64)this + 664, (char *)v8);
v7 = (char)v8[0];
*((_QWORD *)this + 91) = v6;
if ( (v7 & 1) != 0 )
{
operator delete(v8[2]);
v6 = *((_QWORD *)this + 91);
}
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 1312LL))(v6);
}
if ( *((_BYTE *)this + 720) )
return _stack_chk_guard;
goto LABEL_4;
}
return _stack_chk_guard;
}