//
// RateStarsLayer::onRate from 0x957880 to 0x9579ac (300 bytes)
//
// 3 xrefs:
// > ??> @ 0x9bab8
// > RateStarsLayer::init @ 0x957e4c
// > ??> @ 0x1544488
//
// 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:57:25 +0000
//
__int64 __fastcall RateStarsLayer::onRate(RateStarsLayer *this, cocos2d::CCObject *a2)
{
GameLevelManager *v3; // x0
GameLevelManager *v4; // x0
GameLevelManager *v6; // x0
cocos2d::CCDictionary **v7; // x0
__int64 v8; // x0
__int64 v9; // x0
char v10; // w1
__int64 v11[2]; // [xsp+30h] [xbp+30h] BYREF
void *v12; // [xsp+40h] [xbp+40h]
if ( *((_DWORD *)this + 177) != -1 )
{
if ( *((_BYTE *)this + 681) )
{
v3 = (GameLevelManager *)GameLevelManager::sharedState(this);
v4 = (GameLevelManager *)(unsigned __int8)GameLevelManager::suggestLevelStars(
v3,
(const char *)*((unsigned int *)this + 176),
*((_DWORD *)this + 177),
*((_DWORD *)this + 186),
0,
0);
if ( (_BYTE)v4 )
{
*(_QWORD *)(GameLevelManager::sharedState(v4) + 1360) = (char *)this + 672;
v8 = *((_QWORD *)this + 91);
if ( v8 )
*(_QWORD *)(v8 + 664) = 0;
v11[0] = 0;
v11[1] = 0;
v12 = nullptr;
std::string::__init(v11, "Sending rating...", 0x11u);
v9 = UploadActionPopup::create((char *)this + 664, v11);
v10 = v11[0];
*((_QWORD *)this + 91) = v9;
if ( (v10 & 1) != 0 )
{
operator delete(v12);
v9 = *((_QWORD *)this + 91);
}
(*(void (__fastcall **)(__int64))(*(_QWORD *)v9 + 1312LL))(v9);
}
}
else
{
v6 = (GameLevelManager *)RateStarsLayer::onClose(this, nullptr);
v7 = (cocos2d::CCDictionary **)GameLevelManager::sharedState(v6);
GameLevelManager::rateStars(v7, *((_DWORD *)this + 176), *((_DWORD *)this + 177));
}
}
return _stack_chk_guard;
}