//
// ShareLevelLayer::selectRating from 0x1406319b0 to 0x140631b53 (419 bytes)
//
// 5 xrefs:
// > ShareLevelLayer::setupStars @ 0x140631842
// > ShareLevelLayer::setupStars @ 0x1406314cb
// > ??> @ 0x1408e7604
// > ??> @ 0x1408e7638
// > ??> @ 0x140930ae8
//
// 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:35:29 +0000
//
__int64 __fastcall ShareLevelLayer::selectRating(__int64 a1, __int64 a2)
{
int *v2; // r14
int v4; // esi
unsigned int v5; // r15d
__int64 v6; // rdx
struct cocos2d::CCObject *v7; // rbx
__int64 v8; // rdi
int v9; // eax
const char *v10; // rdx
__int64 v11; // rcx
int v12; // eax
cocos2d::CCString *v13; // rax
const char *CString; // rsi
__int64 *v15; // rdi
__int64 v16; // rbx
cocos2d::CCSpriteFrameCache *v17; // rax
struct cocos2d::CCSpriteFrame *v18; // rax
v2 = (int *)(a1 + 672);
if ( a2 )
*v2 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
v4 = 0;
v5 = 0;
if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 680)) )
{
do
{
v7 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 680), v5);
v8 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v7 + 952LL))(v7);
v9 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v7 + 56LL))(v7);
v10 = "GJ_button_04.png";
if ( *v2 == v9 )
v10 = "GJ_button_01.png";
ButtonSprite::updateBGImage(v8, v10);
++v5;
}
while ( v5 < cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 680)) );
v2 = (int *)(a1 + 672);
}
v11 = *(_QWORD *)(a1 + 664);
*(_DWORD *)(v11 + 1116) = *v2;
v12 = *v2;
if ( *v2 <= 1 )
{
if ( v12 == 1 )
{
CString = "difficulty_auto_btn_001.png";
goto LABEL_12;
}
}
else if ( v12 == 2 )
{
v4 = 1;
}
else if ( v12 == 3 )
{
v4 = 2;
}
else if ( v12 > 5 )
{
if ( v12 > 7 )
{
if ( v12 > 9 )
{
if ( v12 == 10 )
v4 = 6;
}
else
{
v4 = 5;
}
}
else
{
v4 = 4;
}
}
else
{
v4 = 3;
}
v13 = cocos2d::CCString::createWithFormat("difficulty_%02d_btn_001.png", v4);
CString = cocos2d::CCString::getCString(v13);
LABEL_12:
v15 = *(__int64 **)(a1 + 688);
v16 = *v15;
v17 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v11, v6);
v18 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v17, CString);
return (*(__int64 (__fastcall **)(__int64 *, struct cocos2d::CCSpriteFrame *))(v16 + 1008))(v15, v18);
}