//
// GJSongBrowser::customSetup from 0x1403bd980 to 0x1403bdd46 (966 bytes)
//
// 2 xrefs:
// > ??> @ 0x140782c98
// > ??> @ 0x140923f0c
//
// 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:31:27 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall GJSongBrowser::customSetup(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rcx
__int64 v4; // rsi
float v5; // xmm7_4
int v6; // eax
cocos2d::CCObject *v7; // rax
__int64 v8; // rdi
__int64 v9; // rcx
cocos2d::CCDirector *v10; // rax
float v11; // xmm0_4
__int64 v12; // rbx
__int64 v13; // rax
__int64 v14; // rax
cocos2d::CCSprite *v15; // rax
cocos2d::CCObject *v16; // rax
__int64 v17; // rdi
__int64 v18; // rcx
cocos2d::CCDirector *v19; // rax
float v20; // xmm0_4
__int64 v21; // rbx
__int64 v22; // rax
__int64 v23; // rax
struct cocos2d::CCSprite *v24; // rbx
cocos2d::CCObject *v25; // rdi
float v26; // xmm7_4
__int64 v27; // rbx
__int64 v28; // rcx
cocos2d::CCDirector *v29; // rax
float v30; // xmm6_4
__int64 v31; // rcx
cocos2d::CCDirector *v32; // rax
float v33; // xmm0_4
__int64 v34; // rax
__int64 v35; // rax
struct cocos2d::CCLabelBMFont *v36; // rax
__int64 v37; // rdi
__int64 v38; // rcx
cocos2d::CCDirector *v39; // rax
float v40; // xmm6_4
__int64 v41; // rcx
cocos2d::CCDirector *v42; // rax
float v43; // xmm1_4
__int64 v44; // rbx
__int64 v45; // rax
__int64 v46; // rdi
__int64 v47; // rbx
__int64 v48; // rax
cocos2d::CCObject *DownloadedSongs; // rax
__int64 v50; // rdx
void *v52; // [rsp+60h] [rbp+8h] BYREF
char v53; // [rsp+68h] [rbp+10h] BYREF
float v54; // [rsp+6Ch] [rbp+14h]
char v55; // [rsp+70h] [rbp+18h] BYREF
v2 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v2, &v53);
v4 = cocos2d::CCMenu::create(v3);
v5 = v54 * 0.5;
v6 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v7 = CCMenuItemSpriteExtra::create(v6, 0, a1, (__int64)GJSongBrowser::onPrevPage);
*(_QWORD *)(a1 + 648) = v7;
(*(void (__fastcall **)(__int64, cocos2d::CCObject *))(*(_QWORD *)v4 + 464LL))(v4, v7);
v8 = **(_QWORD **)(a1 + 648);
v10 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v9);
v11 = cocos2d::CCDirector::getScreenLeft(v10) + 24.0;
v12 = *(_QWORD *)(a1 + 648);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, v11, v5);
cocos2d::CCNode::convertToNodeSpace(v4, &v55, v13);
(*(void (__fastcall **)(__int64, __int64))(v8 + 184))(v12, v14);
v15 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
LODWORD(v12) = (_DWORD)v15;
cocos2d::CCSprite::setFlipX(v15, 1);
v16 = CCMenuItemSpriteExtra::create(v12, 0, a1, (__int64)GJSongBrowser::onNextPage);
*(_QWORD *)(a1 + 640) = v16;
(*(void (__fastcall **)(__int64, cocos2d::CCObject *))(*(_QWORD *)v4 + 464LL))(v4, v16);
v17 = **(_QWORD **)(a1 + 640);
v19 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v18);
v20 = cocos2d::CCDirector::getScreenRight(v19) - 24.0;
v21 = *(_QWORD *)(a1 + 640);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, v20, v5);
cocos2d::CCNode::convertToNodeSpace(v4, &v55, v22);
(*(void (__fastcall **)(__int64, __int64))(v17 + 184))(v21, v23);
v24 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_deleteBtn_001.png");
v25 = CCMenuItemSpriteExtra::create((int)v24, 0, a1, (__int64)GJSongBrowser::onDeleteAll);
(*(void (__fastcall **)(__int64, cocos2d::CCObject *))(*(_QWORD *)v4 + 464LL))(v4, v25);
v26 = (float)(*((float *)v24 + 108) * 0.5) + 4.0;
v27 = *(_QWORD *)v25;
v29 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v28);
v30 = cocos2d::CCDirector::getScreenBottom(v29) + v26;
v32 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v31);
v33 = cocos2d::CCDirector::getScreenRight(v32) - v26;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, v33, v30);
cocos2d::CCNode::convertToNodeSpace(v4, &v55, v34);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v27 + 184))(v25, v35);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 576) + 456LL))(*(_QWORD *)(a1 + 576), v4, 10);
v36 = cocos2d::CCLabelBMFont::create(" ", "goldFont.fnt");
*(_QWORD *)(a1 + 656) = v36;
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 576) + 464LL))(
*(_QWORD *)(a1 + 576),
v36);
v37 = **(_QWORD **)(a1 + 656);
v39 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v38);
v40 = cocos2d::CCDirector::getScreenTop(v39) - 4.0;
v42 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v41);
v43 = cocos2d::CCDirector::getScreenRight(v42) - 7.0;
v44 = *(_QWORD *)(a1 + 656);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, v43 - 0.0, v40);
(*(void (__fastcall **)(__int64, __int64))(v37 + 184))(v44, v45);
v46 = **(_QWORD **)(a1 + 656);
v47 = *(_QWORD *)(a1 + 656);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 1.0, 1.0);
(*(void (__fastcall **)(__int64, __int64))(v46 + 288))(v47, v48);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 656) + 160LL))(*(_QWORD *)(a1 + 656));
if ( !qword_14090C070 )
{
v52 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v52);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
}
DownloadedSongs = (cocos2d::CCObject *)MusicDownloadManager::getDownloadedSongs();
*(_QWORD *)(a1 + 672) = DownloadedSongs;
cocos2d::CCObject::retain(DownloadedSongs);
LOBYTE(v50) = -1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)(*(_QWORD *)(a1 + 568) + 408LL) + 40LL))(
*(_QWORD *)(a1 + 568) + 408LL,
v50);
memset(&v52, 50, 3);
return (**(__int64 (__fastcall ***)(__int64, void **))(*(_QWORD *)(a1 + 568) + 408LL))(
*(_QWORD *)(a1 + 568) + 408LL,
&v52);
}