//
// GJRateLevelLayer::selectRating from 0x564ae8 to 0x564be4 (252 bytes)
//
// 1 xrefs:
// > GJRateLevelLayer::init @ 0x5660c4
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:52:27 +0000
//
int __fastcall GJRateLevelLayer::selectRating(GJRateLevelLayer *this, cocos2d::CCObject *a2)
{
unsigned int v3; // r5
int v4; // r0
int v5; // r6
int v6; // r0
int v7; // r10
char *v8; // r7
const char *v9; // r1
int (*v10)(void); // r3
_DWORD *v11; // r0
int v12; // r3
int v13; // r1
int v14; // r3
int v15; // r1
if ( a2 )
*((_DWORD *)this + 186) = (*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)a2 + 32))(a2);
else
*((_DWORD *)this + 186) = -1;
v3 = 0;
while ( v3 < cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 185)) )
{
v4 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 185), v3++);
v5 = v4;
v6 = (*(int (__fastcall **)(int))(*(_DWORD *)v4 + 536))(v4);
v7 = *((_DWORD *)this + 186);
v8 = (char *)v6;
if ( v7 == (*(int (__fastcall **)(int))(*(_DWORD *)v5 + 32))(v5) )
v9 = "GJ_button_01.png";
else
v9 = "GJ_button_04.png";
ButtonSprite::updateBGImage(v8, v9);
}
v10 = *(int (**)(void))(**((_DWORD **)this + 184) + 536);
if ( *((_DWORD *)this + 186) == -1 )
{
v11 = (_DWORD *)v10();
v12 = 42662;
v13 = 166;
}
else
{
v11 = (_DWORD *)v10();
v12 = 0xFFFF;
v13 = 255;
}
ButtonSprite::setColor(v11, v12 | (v13 << 16));
v14 = *((_DWORD *)this + 186);
if ( v14 <= 1 )
{
v15 = 0;
}
else if ( v14 == 2 )
{
v15 = 1;
}
else if ( v14 == 3 )
{
v15 = 2;
}
else if ( v14 <= 5 )
{
v15 = 3;
}
else if ( v14 <= 7 )
{
v15 = 4;
}
else if ( v14 <= 9 )
{
v15 = 5;
}
else if ( v14 == 10 )
{
v15 = 6;
}
else
{
v15 = 0;
}
if ( v14 == 1 )
v15 = -1;
return GJDifficultySprite::updateDifficultyFrame(*((_DWORD *)this + 190), v15, 0);
}