//
// LevelInfoLayer::onRateStars from 0x140423650 to 0x140423a57 (1031 bytes)
//
// 3 xrefs:
// > LevelInfoLayer::FLAlert_Clicked @ 0x1404262c7
// > LevelInfoLayer::init @ 0x14041d305
// > ??> @ 0x1409268f4
//
// This function is hookable on this platform (idp: pc, 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 11:32:10 +0000
//
// Hidden C++ exception states: #wind=6
void __fastcall LevelInfoLayer::onRateStars(__int64 a1)
{
__int64 v2; // rdx
__int64 v3; // rcx
_QWORD *v4; // rax
_QWORD *v5; // rcx
const char *v6; // rdx
__int64 v7; // r8
__int64 v8; // rax
cocos2d::CCObject *v9; // rbx
__int64 (__fastcall *v10)(__int64); // rdx
cocos2d::CCObject *v11; // rcx
_DWORD *v12; // rax
bool v13; // di
unsigned int v14; // ebx
_QWORD *v15; // rsi
__int128 v16; // [rsp+50h] [rbp-58h] BYREF
__int64 v17; // [rsp+60h] [rbp-48h]
__int64 v18; // [rsp+68h] [rbp-40h]
_BYTE v19[32]; // [rsp+70h] [rbp-38h] BYREF
void *v20; // [rsp+B0h] [rbp+8h]
void *v21; // [rsp+B0h] [rbp+8h]
void *v22; // [rsp+B0h] [rbp+8h]
if ( !*(_BYTE *)(a1 + 488) )
{
v2 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v20 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v20);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = qword_14090BFD0;
}
if ( *(_DWORD *)(v2 + 692) == *(_DWORD *)(v2 + 696) )
{
v3 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v21 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v21);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v3 = *(_QWORD *)&qword_14090BFB0;
}
GameLevelManager::updateUserScore(v3);
v2 = qword_14090BFD0;
}
if ( !v2 )
{
v22 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v22);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = qword_14090BFD0;
}
if ( *(_BYTE *)(v2 + 965) )
{
v12 = *(_DWORD **)(a1 + 504);
v13 = v12[243] == 5;
v14 = v12[82] - v12[83];
v15 = operator new(0x2F8u);
FLAlertLayer::FLAlertLayer((__int64)v15);
*v15 = &RateStarsLayer::`vftable';
v15[40] = &RateStarsLayer::`vftable';
v15[41] = &RateStarsLayer::`vftable';
v15[42] = &RateStarsLayer::`vftable';
v15[43] = &RateStarsLayer::`vftable';
v15[44] = &RateStarsLayer::`vftable';
v15[51] = &RateStarsLayer::`vftable';
v15[54] = &RateStarsLayer::`vftable';
v15[68] = &RateStarsLayer::`vftable';
v15[83] = &RateStarsLayer::`vftable';
v15[84] = &RateStarsLayer::`vftable';
*((_WORD *)v15 + 340) = 0;
v15[86] = 0;
v15[87] = 0;
v15[88] = 0;
*((_BYTE *)v15 + 712) = 0;
v15[90] = 0;
v15[91] = 0;
v15[92] = 0;
*((_DWORD *)v15 + 186) = 0;
v15[94] = 0;
if ( (unsigned __int8)RateStarsLayer::init(v15, v14, v13) )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v15);
}
else
{
(*(void (__fastcall **)(_QWORD *, __int64))(*v15 + 8LL))(v15, 1);
v15 = nullptr;
}
v15[94] = a1 + 424;
v10 = *(__int64 (__fastcall **)(__int64))(*v15 + 1064LL);
v11 = (cocos2d::CCObject *)v15;
if ( v10 == FLAlertLayer::show )
{
FLAlertLayer::show((__int64)v15);
return;
}
}
else
{
*(_BYTE *)(v2 + 965) = 1;
v16 = 0;
v4 = sub_14003D460(0x140u);
*(_QWORD *)&v16 = v4;
v17 = 314;
v18 = 319;
v5 = v4;
v6 = "Auto: 1 Star or Moon\n"
"Easy: 2 Stars or Moons\n"
"Normal: 3 Stars or Moons\n"
"Hard: 4 to 5 Stars or Moons\n"
"Harder: 6 to 7 Stars or Moons\n"
"Insane: 8 to 9 Stars or Moons\n"
"Demon: 10 Stars or Moons\n"
"(These values are not assigned before a rating is manually given by RobTop.)";
v7 = 2;
do
{
*(_OWORD *)v5 = *(_OWORD *)v6;
*((_OWORD *)v5 + 1) = *((_OWORD *)v6 + 1);
*((_OWORD *)v5 + 2) = *((_OWORD *)v6 + 2);
*((_OWORD *)v5 + 3) = *((_OWORD *)v6 + 3);
*((_OWORD *)v5 + 4) = *((_OWORD *)v6 + 4);
*((_OWORD *)v5 + 5) = *((_OWORD *)v6 + 5);
*((_OWORD *)v5 + 6) = *((_OWORD *)v6 + 6);
v5 += 16;
*((_OWORD *)v5 - 1) = *((_OWORD *)v6 + 7);
v6 += 128;
--v7;
}
while ( v7 );
*(_OWORD *)v5 = *(_OWORD *)v6;
*((_OWORD *)v5 + 1) = *((_OWORD *)v6 + 1);
*((_OWORD *)v5 + 2) = *((_OWORD *)v6 + 2);
v5[6] = *((_QWORD *)v6 + 6);
*((_WORD *)v5 + 28) = *((_WORD *)v6 + 28);
*((_BYTE *)v4 + 314) = 0;
v8 = sub_14003F4F0((__int64)v19, (__int64)&v16);
v9 = FLAlertLayer::create((int)a1 + 440, (int)"Rating guide", v8, (__int64)"OK", 0, 1133903872, 0, 0, 1065353216);
sub_14003D310((__int64)&v16);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v9 + 64LL))(v9, 8);
v10 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 1064LL);
v11 = v9;
}
v10((__int64)v11);
}
}