//
// GJSongBrowser::customSetup from 0x5be5b4 to 0x5be900 (844 bytes)
//
// 2 xrefs:
// > ??> @ 0xa4fd0
// > ??> @ 0x1145bd8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void GJSongBrowser::customSetup(GJSongBrowser *a1)
{
cocos2d::CCDirector *v2; // x0
cocos2d::CCMenu *v3; // x21
cocos2d::CCSprite *v4; // x0
CCMenuItemSpriteExtra *v5; // x0
cocos2d::CCMenu_vtbl *v6; // x2
CCMenuItemSpriteExtra *m_leftArrow; // x25
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCDirector *v9; // x0
float v10; // s0
cocos2d::CCSprite *v11; // x24
CCMenuItemSpriteExtra *v12; // x0
cocos2d::CCMenu_vtbl *v13; // x2
CCMenuItemSpriteExtra *m_rightArrow; // x24
void (__fastcall *v15)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCDirector *v16; // x0
float v17; // s0
cocos2d::CCSprite *v18; // x25
CCMenuItemSpriteExtra *v19; // x24
float v20; // s8
void (__fastcall *v21)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCDirector *v22; // x0
float v23; // s0
float v24; // s10
cocos2d::CCDirector *v25; // x0
float v26; // s0
cocos2d::CCLabelBMFont *v27; // x0
cocos2d::CCLayer *m_mainLayer; // x2
cocos2d::CCLabelBMFont *m_countText; // x21
void (__fastcall *v30)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x22
cocos2d::CCDirector *v31; // x0
float v32; // s0
float v33; // s8
cocos2d::CCDirector *v34; // x0
float v35; // s0
cocos2d::CCLabelBMFont *v36; // x21
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x22
MusicDownloadManager *v38; // x0
cocos2d::CCArray *DownloadedSongs; // x0
GJListLayer *m_listLayer; // x0
void (__fastcall *setColor)(cocos2d::CCLayerColor *__hidden, const cocos2d::ccColor3B *); // x3
float v42; // [xsp+74h] [xbp+74h]
cocos2d::CCPoint v43; // [xsp+78h] [xbp+78h] BYREF
cocos2d::CCPoint v44; // [xsp+80h] [xbp+80h] BYREF
cocos2d::CCPoint v45; // 0:kr08_8.8
cocos2d::CCPoint v46; // 0:kr10_8.8
cocos2d::CCPoint v47; // 0:kr18_8.8
cocos2d::SEL_MenuHandler v48; // 0:x2.16
cocos2d::SEL_MenuHandler v49; // 0:x2.16
cocos2d::SEL_MenuHandler v50; // 0:x2.16
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v2);
v3 = cocos2d::CCMenu::create();
v4 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v48.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v48.adj = (size_t)GJSongBrowser::onPrevPage;
v5 = CCMenuItemSpriteExtra::create(v4, nullptr, v48);
v6 = v3->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_leftArrow = v5;
v6->addChild(v3, v5);
m_leftArrow = a1->m_leftArrow;
setPosition = m_leftArrow->setPosition;
v9 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getScreenLeft(v9);
cocos2d::CCPoint::CCPoint(&v43, v10 + 24.0, v42 * 0.5);
v45 = cocos2d::CCNode::convertToNodeSpace(v3, &v43);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCPoint *, float, float))setPosition)(
m_leftArrow,
&v44,
v45.x,
v45.y);
v11 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v11, 1);
v49.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v49.adj = (size_t)GJSongBrowser::onNextPage;
v12 = CCMenuItemSpriteExtra::create(v11, nullptr, v49);
v13 = v3->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_rightArrow = v12;
v13->addChild(v3, v12);
m_rightArrow = a1->m_rightArrow;
v15 = m_rightArrow->setPosition;
v16 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getScreenRight(v16);
cocos2d::CCPoint::CCPoint(&v43, v17 - 24.0, v42 * 0.5);
v46 = cocos2d::CCNode::convertToNodeSpace(v3, &v43);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCPoint *, float, float))v15)(
m_rightArrow,
&v44,
v46.x,
v46.y);
v18 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_deleteBtn_001.png");
v50.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v50.adj = (size_t)GJSongBrowser::onDeleteAll;
v19 = CCMenuItemSpriteExtra::create(v18, nullptr, v50);
v3->addChild(v3, v19);
v20 = (float)(v18->m_obRect.size.width * 0.5) + 4.0;
v21 = v19->setPosition;
v22 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getScreenRight(v22);
v24 = v23 - v20;
v25 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getScreenBottom(v25);
cocos2d::CCPoint::CCPoint(&v43, v24, v20 + v26);
v47 = cocos2d::CCNode::convertToNodeSpace(v3, &v43);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCPoint *, float, float))v21)(v19, &v44, v47.x, v47.y);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v3, 10);
v27 = cocos2d::CCLabelBMFont::create();
m_mainLayer = a1->m_mainLayer;
a1->m_countText = v27;
m_mainLayer->addChild(m_mainLayer, v27);
m_countText = a1->m_countText;
v30 = m_countText->setPosition;
v31 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getScreenRight(v31);
v33 = v32;
v34 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getScreenTop(v34);
cocos2d::CCPoint::CCPoint(&v44, v33 - 7.0, v35 - 4.0);
v30(m_countText, &v44);
v36 = a1->m_countText;
setAnchorPoint = v36->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v44, 1.0, 1.0);
setAnchorPoint(v36, &v44);
a1->m_countText->setScale(a1->m_countText, 0.6);
v38 = MusicDownloadManager::sharedState();
DownloadedSongs = MusicDownloadManager::getDownloadedSongs(v38);
a1->m_downloadedSongs = DownloadedSongs;
cocos2d::CCObject::retain(DownloadedSongs);
a1->m_listLayer->setOpacity(a1->m_listLayer, 0xFFFFFFFFLL);
m_listLayer = a1->m_listLayer;
setColor = m_listLayer->setColor;
memset(&v44, 50, 3);
setColor(m_listLayer, (const cocos2d::ccColor3B *)&v44);
}