//
// ShareLevelLayer::selectRating from 0x3b83f8 to 0x3b84d8 (224 bytes)
//
// 1 xrefs:
// > ShareLevelLayer::setupStars @ 0x3b8c22
//
// 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 ShareLevelLayer::selectRating(ShareLevelLayer *a1, cocos2d::CCObject *a2)
{
unsigned int v3; // r5
int v4; // r0
int v5; // r6
int v6; // r0
int m_starsRequested; // r10
ButtonSprite *v8; // r7
const char *v9; // r1
int v10; // r3
cocos2d::CCString *v11; // r0
const char *CString; // r5
cocos2d::CCSprite *m_difficultySprite; // r4
void (__fastcall *setDisplayFrame)(cocos2d::CCSprite *__hidden, cocos2d::CCSpriteFrame *); // r6
cocos2d::CCSpriteFrameCache *v15; // r0
cocos2d::CCSpriteFrame *v16; // r0
if ( a2 )
a1->m_starsRequested = a2->getTag(a2);
v3 = 0;
while ( v3 < cocos2d::CCArray::count(a1->m_starButtons) )
{
v4 = cocos2d::CCArray::objectAtIndex(a1->m_starButtons, v3++);
v5 = v4;
v6 = (*(int (__fastcall **)(int))(*(_DWORD *)v4 + 528))(v4);
m_starsRequested = a1->m_starsRequested;
v8 = (ButtonSprite *)v6;
if ( m_starsRequested == (*(int (__fastcall **)(int))(*(_DWORD *)v5 + 32))(v5) )
v9 = "GJ_button_01.png";
else
v9 = "GJ_button_04.png";
ButtonSprite::updateBGImage(v8, v9);
}
a1->m_level->m_starsRequested = a1->m_starsRequested;
v10 = a1->m_starsRequested;
if ( v10 <= 1 )
{
if ( v10 == 1 )
{
CString = "difficulty_auto_btn_001.png";
goto LABEL_22;
}
LABEL_19:
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"difficulty_%02d_btn_001.png",
nullptr);
goto LABEL_20;
}
if ( v10 == 2 )
{
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"difficulty_%02d_btn_001.png",
(_BYTE *)&dword_0 + 1);
goto LABEL_20;
}
if ( v10 == 3 )
{
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"difficulty_%02d_btn_001.png",
(_BYTE *)&dword_0 + 2);
goto LABEL_20;
}
if ( v10 <= 5 )
{
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"difficulty_%02d_btn_001.png",
(_BYTE *)&dword_0 + 3);
goto LABEL_20;
}
if ( v10 <= 7 )
{
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"difficulty_%02d_btn_001.png",
byte_4);
goto LABEL_20;
}
if ( v10 <= 9 )
{
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"difficulty_%02d_btn_001.png",
&byte_5);
goto LABEL_20;
}
if ( v10 != 10 )
goto LABEL_19;
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"difficulty_%02d_btn_001.png",
&byte_6);
LABEL_20:
CString = cocos2d::CCString::getCString(v11);
LABEL_22:
m_difficultySprite = a1->m_difficultySprite;
setDisplayFrame = m_difficultySprite->setDisplayFrame;
v15 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v16 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v15, CString);
setDisplayFrame(m_difficultySprite, v16);
}