//
// GJRateLevelLayer::selectRating from 0x100506560 to 0x1005066a9 (329 bytes)
//
// 2 xrefs:
// > GJRateLevelLayer::init @ 0x1005063b9
// > GJRateLevelLayer::init @ 0x100505cfc
//
// 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 GJRateLevelLayer::selectRating(GJRateLevelLayer *a1, cocos2d::CCObject *a2)
{
int v2; // eax
unsigned int v3; // r14d
__int64 v4; // r15
ButtonSprite *v5; // r12
int m_stars; // r13d
const char *v7; // rsi
_BOOL8 v8; // r14
ButtonSprite *v9; // rax
unsigned int v10; // eax
int v11; // ecx
int v12; // esi
if ( a2 )
v2 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);
else
v2 = -1;
a1->m_stars = v2;
if ( (unsigned int)sub_100720070(a1->m_starButtons) )
{
v3 = 0;
do
{
v4 = sub_1007200C0(a1->m_starButtons, v3);
v5 = (ButtonSprite *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 1056LL))(v4);
m_stars = a1->m_stars;
v7 = "GJ_button_04.png";
if ( m_stars == (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v4 + 64LL))(v4) )
v7 = "GJ_button_01.png";
ButtonSprite::updateBGImage(v5, v7);
++v3;
}
while ( v3 < (unsigned int)sub_100720070(a1->m_starButtons) );
}
v8 = a1->m_stars != -1;
v9 = (ButtonSprite *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_submitButton->getNormalImage)(a1->m_submitButton);
ButtonSprite::setColor(v9, (cocos2d::ccColor3B)(v8 ? -1 : 0xFFA6A6A6));
v10 = a1->m_stars;
v11 = 0;
if ( (int)v10 >= 2 )
{
if ( v10 == 2 )
{
v11 = 1;
}
else if ( v10 == 3 )
{
v11 = 2;
}
else
{
v11 = 3;
if ( v10 >= 6 )
{
v11 = 4;
if ( v10 >= 8 )
{
v11 = 5;
if ( v10 >= 0xA )
{
v11 = 6;
if ( v10 != 10 )
v11 = 0;
}
}
}
}
}
v12 = -1;
if ( v10 != 1 )
v12 = v11;
GJDifficultySprite::updateDifficultyFrame(a1->m_difficultySprite, v12, Short);
}