//
// RateStarsLayer::selectRating from 0x569180 to 0x56927c (252 bytes)
//
// 1 xrefs:
// > RateStarsLayer::init @ 0x5699f0
//
// 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:30 +0000
//
int __fastcall RateStarsLayer::selectRating(RateStarsLayer *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 + 136) = (*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)a2 + 32))(a2);
else
*((_DWORD *)this + 136) = -1;
v3 = 0;
while ( v3 < cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 134)) )
{
v4 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 134), v3++);
v5 = v4;
v6 = (*(int (__fastcall **)(int))(*(_DWORD *)v4 + 536))(v4);
v7 = *((_DWORD *)this + 136);
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 + 133) + 536);
if ( *((_DWORD *)this + 136) == -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 + 136);
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 + 140), v15, 0);
}