//
// ShareLevelLayer::selectRating from 0x7f2040 to 0x7f21c0 (384 bytes)
//
// 4 xrefs:
// > ShareLevelLayer::setupStars @ 0x7f3bb4
// > ??> @ 0xd7980
// > ShareLevelLayer::setupStars @ 0x7f3938
// > ??> @ 0x1546700
//
// 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:54:36 +0000
//
__int64 __fastcall ShareLevelLayer::selectRating(ShareLevelLayer *this, cocos2d::CCObject *a2)
{
unsigned int i; // w19
__int64 v4; // x20
__int64 v5; // x22
__int64 v6; // x1
__int64 v7; // x0
bool v8; // zf
const char *v9; // x1
ButtonSprite *v10; // x0
int v11; // w0
const char *v12; // x1
cocos2d::CCString *v13; // x0
const char *CString; // x1
cocos2d::CCSpriteFrameCache **v15; // x19
__int64 (__fastcall *v16)(cocos2d::CCSpriteFrameCache **, __int64); // x20
cocos2d::CCSpriteFrameCache *v17; // x0
__int64 v18; // x0
char *v20; // [xsp+48h] [xbp+48h]
if ( a2 )
*((_DWORD *)this + 168) = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)a2 + 64LL))(a2);
for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 85)); ++i )
{
v4 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 85), i);
v5 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 1072LL))(v4);
v6 = *(_QWORD *)v4;
v7 = v4;
LODWORD(v4) = *((_DWORD *)this + 168);
v8 = (_DWORD)v4 == (*(unsigned int (__fastcall **)(__int64))(v6 + 64))(v7);
v9 = "GJ_button_04.png";
v10 = (ButtonSprite *)v5;
if ( v8 )
{
v10 = (ButtonSprite *)v5;
v9 = "GJ_button_01.png";
}
ButtonSprite::updateBGImage(v10, v9);
}
*(_DWORD *)(*((_QWORD *)this + 83) + 1044LL) = *((_DWORD *)this + 168);
v11 = *((_DWORD *)this + 168);
if ( v11 <= 1 )
{
CString = "difficulty_auto_btn_001.png";
if ( v11 == 1 )
goto LABEL_15;
LABEL_17:
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"difficulty_%02d_btn_001.png",
nullptr);
goto LABEL_14;
}
if ( v11 == 2 )
{
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"difficulty_%02d_btn_001.png",
(_BYTE *)&dword_0 + 1);
goto LABEL_14;
}
if ( v11 == 3 )
{
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"difficulty_%02d_btn_001.png",
(_BYTE *)&dword_0 + 2);
goto LABEL_14;
}
v12 = (char *)&dword_0 + 3;
if ( v11 > 5 )
{
v12 = &byte_4;
if ( v11 > 7 )
{
v12 = &byte_5;
if ( v11 > 9 )
{
if ( v11 == 10 )
{
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"difficulty_%02d_btn_001.png",
&byte_6);
goto LABEL_14;
}
goto LABEL_17;
}
}
}
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"difficulty_%02d_btn_001.png",
v12);
LABEL_14:
CString = (const char *)cocos2d::CCString::getCString(v13);
LABEL_15:
v15 = *((cocos2d::CCSpriteFrameCache ***)this + 86);
v20 = (char *)CString;
v16 = *((__int64 (__fastcall **)(cocos2d::CCSpriteFrameCache **, __int64))*v15 + 145);
v17 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(*v15);
v18 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v17, v20);
return v16(v15, v18);
}