//
// ShareLevelLayer::setupStars from 0x4a3594 to 0x4a37e2 (590 bytes)
//
// 1 xrefs:
// > ShareLevelLayer::init @ 0x4a4378
//
// 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:49:52 +0000
//
int __fastcall ShareLevelLayer::setupStars(const cocos2d::CCPoint **this)
{
const char *v2; // r5
cocos2d::CCArray *WinSize; // r0
cocos2d::CCObject *v4; // r0
cocos2d::CCArray *v5; // r0
cocos2d::CCArray *v6; // r10
float v7; // r9
int v8; // r3
cocos2d::CCObject *StarsButton; // r6
cocos2d::CCArray *v11; // r0
const cocos2d::CCPoint *v12; // r6
GJGameLevel *v13; // r0
const char *v14; // r1
const char *v15; // r2
cocos2d::CCLabelBMFont *v16; // r0
int v17; // r9
void (__fastcall *v18)(int, _BYTE *); // r11
const char *v19; // r1
const cocos2d::CCPoint *v20; // r0
int v21; // r9
void (__fastcall *v22)(int, _BYTE *); // r11
float v24[2]; // [sp+8h] [bp-44h] BYREF
_BYTE v25[4]; // [sp+10h] [bp-3Ch] BYREF
float v26; // [sp+14h] [bp-38h]
_BYTE v27[8]; // [sp+18h] [bp-34h] BYREF
_BYTE v28[8]; // [sp+20h] [bp-2Ch] BYREF
_BYTE v29[8]; // [sp+28h] [bp-24h] BYREF
int (__fastcall *v30)(ShareLevelLayer *, cocos2d::CCObject *); // [sp+30h] [bp-1Ch]
int v31; // [sp+34h] [bp-18h]
int v32[2]; // [sp+38h] [bp-14h] BYREF
cocos2d::CCLabelBMFont *v33; // [sp+40h] [bp-Ch]
v2 = (_BYTE *)(&dword_0 + 1);
cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)this);
WinSize = (cocos2d::CCArray *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v24);
v4 = (cocos2d::CCObject *)cocos2d::CCArray::create(WinSize);
*(this + 132) = v4;
v5 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v4);
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v5);
v7 = COERCE_FLOAT(cocos2d::CCArray::create(v6));
do
{
v8 = (int)*(this + 111);
v30 = ShareLevelLayer::selectRating;
v31 = 0;
StarsButton = (cocos2d::CCObject *)ShareLevelLayer::getStarsButton(
(int)this,
v2,
COERCE_FLOAT(ShareLevelLayer::selectRating),
0,
v8,
1061997773);
cocos2d::CCArray::addObject(*(this + 132), StarsButton);
(*(void (__fastcall **)(cocos2d::CCObject *, const char *))(*(_DWORD *)StarsButton + 36))(StarsButton, v2);
if ( (int)v2++ <= 5 )
v11 = v6;
else
v11 = (cocos2d::CCArray *)LODWORD(v7);
cocos2d::CCArray::addObject(v11, StarsButton);
}
while ( v2 != &byte_9[2] );
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v25,
v24[0] * 0.5,
(float)((float)((float)(v24[1] * 0.5) - 50.0) + 35.0) + 2.0);
v12 = *(this + 111);
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v29, *(this + 115));
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v27, v12);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29, (const cocos2d::CCPoint *)v27);
GameToolbox::alignItemsHorisontally(*(float *)&v6, 17.0, (int)v29, 0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, 0.0, -35.0);
cocos2d::CCPoint::operator+(v29, v27, v28);
GameToolbox::alignItemsHorisontally(v7, 17.0, (int)v29, 0);
v13 = *(this + 130);
*(this + 131) = *((const cocos2d::CCPoint **)v13 + 217);
if ( GJGameLevel::isPlatformer(v13) )
v14 = "Request Moons";
else
v14 = "Request Stars";
v32[0] = 0;
v32[1] = 0;
v33 = nullptr;
std::string::__init(v32, v14, 0xDu);
if ( (v32[0] & 1) != 0 )
v16 = v33;
else
v16 = (cocos2d::CCLabelBMFont *)((char *)v32 + 1);
v17 = cocos2d::CCLabelBMFont::create(v16, "bigFont.fnt", v15);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v17 + 80))(v17, 1056964608);
(*(void (__fastcall **)(_DWORD, int, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), v17, 2);
v18 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v17 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, 0.0, 30.0);
cocos2d::CCPoint::operator+(v29, v25, v28);
v18(v17, v29);
v20 = (const cocos2d::CCPoint *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"difficulty_00_btn_001.png",
v19);
*(this + 133) = v20;
(*(void (__fastcall **)(_DWORD, const cocos2d::CCPoint *, int))(*(_DWORD *)*(this + 115) + 232))(
*(this + 115),
v20,
3);
v21 = (int)*(this + 133);
v22 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v21 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, 155.0, -18.0);
cocos2d::CCPoint::operator+(v29, v25, v28);
v22(v21, v29);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, -170.0, -8.0);
cocos2d::CCPoint::operator+(v29, v25, v28);
ShareLevelLayer::setupNotifyToggles((ShareLevelLayer *)this, (const cocos2d::CCPoint *)v29, 40.0, v26 + 30.0);
ShareLevelLayer::selectRating((ShareLevelLayer *)this, nullptr);
return std::string::~string((int)v32);
}