//
// GJGarageLayer::setupIconSelect from 0x1003a061c to 0x1003a10a0 (2692 bytes)
//
// 1 xrefs:
// > GJGarageLayer::init @ 0x10039f208
//
// This function is hookable on this platform (idp: arm, 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:03:46 +0000
//
__int64 __fastcall GJGarageLayer::setupIconSelect(__int64 *a1)
{
__int64 v2; // x0
float v3; // s8
void *v4; // x20
void *v5; // x21
float32x2_t *v6; // x22
double v7; // d0
_QWORD *v8; // x0
__int64 v9; // x21
void *v10; // x23
void *v11; // x0
char *v12; // x23
void *v13; // x23
void *v14; // x0
char *v15; // x23
void *v16; // x23
void *v17; // x0
char *v18; // x23
void *v19; // x23
void *v20; // x0
char *v21; // x23
void *v22; // x23
void *v23; // x0
char *v24; // x23
void *v25; // x23
void *v26; // x0
char *v27; // x23
void *v28; // x23
void *v29; // x0
char *v30; // x23
void *v31; // x23
void *v32; // x0
char *v33; // x23
void *v34; // x23
void *v35; // x0
char *v36; // x23
void *v37; // x23
void *v38; // x0
char *v39; // x23
void *v40; // x23
void *v41; // x0
char *v42; // x22
unsigned int v43; // w22
_QWORD **v44; // x24
__int64 v45; // x0
__int64 v46; // x0
void *v47; // x0
void *v48; // x0
void *v49; // x0
__int64 CString; // x23
void *v51; // x24
void *v52; // x0
__int64 v53; // x24
float32x2_t *v54; // x25
unsigned __int8 *v55; // x23
void *v56; // x0
__int64 v57; // x22
float32x2_t *v58; // x20
_QWORD *v59; // x0
__int64 v60; // x0
__int64 v61; // x20
float32x2_t v63; // [xsp+10h] [xbp-90h] BYREF
float32x2_t v64; // [xsp+18h] [xbp-88h] BYREF
float v65[2]; // [xsp+20h] [xbp-80h] BYREF
float32x2_t v66[2]; // [xsp+28h] [xbp-78h] BYREF
__int64 v67; // [xsp+38h] [xbp-68h] BYREF
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v2, &v67);
v3 = (float)(*((float *)&v67 + 1) * 0.5) + -5.0;
sub_1000262CC((float *)v66, 0.0, 0.0, 80.0, 80.0);
v4 = cocos2d::extension::CCScale9Sprite::create((__int64)"square02_001.png", (__int64)v66);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v4 + 912LL))(v4, 75);
sub_1000262C4(v65, 385.0, 100.0);
(*(void (__fastcall **)(void *, float *))(*(_QWORD *)v4 + 320LL))(v4, v65);
(*(void (__fastcall **)(__int64 *, void *, __int64))(*a1 + 464))(a1, v4, 0xFFFFFFFFLL);
sub_1000262BC((float *)v66, *(float *)&v67 * 0.5, v3 + -60.0);
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v4 + 184LL))(v4, v66);
v5 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_unlockTxt_001.png");
(*(void (__fastcall **)(__int64 *, void *))(*a1 + 456))(a1, v5);
sub_1000262BC((float *)v66, 0.5, 0.5);
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v5 + 296LL))(v5, v66);
v6 = (float32x2_t *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v4 + 192LL))(v4);
sub_1000262BC((float *)&v64, 0.0, (float)(v65[1] * 0.5) + 12.0);
*(float32x2_t *)&v7 = sub_100026318(v6, &v64, v66);
(*(void (__fastcall **)(void *, float32x2_t *, double))(*(_QWORD *)v5 + 184LL))(v5, v66, v7);
v8 = sub_1002E736C();
a1[60] = (__int64)v8;
cocos2d::CCObject::retain((__int64)v8);
v9 = cocos2d::CCMenu::create();
(*(void (__fastcall **)(__int64 *, __int64, __int64))(*a1 + 464))(a1, v9, 100);
v10 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_iconBtn_off_001.png");
v11 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_iconBtn_on_001.png");
v12 = CCMenuItemToggler::create((__int64)v10, (__int64)v11, (__int64)a1, (__int64)GJGarageLayer::onSelectTab, 0);
CCMenuItemToggler::setSizeMult((__int64)v12, 1.2);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v9 + 456LL))(v9, v12);
(*(void (__fastcall **)(char *, _QWORD))(*(_QWORD *)v12 + 72LL))(v12, 0);
sub_1002E74E0(a1[60]);
v13 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_shipBtn_off_001.png");
v14 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_shipBtn_on_001.png");
v15 = CCMenuItemToggler::create((__int64)v13, (__int64)v14, (__int64)a1, (__int64)GJGarageLayer::onSelectTab, 0);
CCMenuItemToggler::setSizeMult((__int64)v15, 1.2);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v9 + 456LL))(v9, v15);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v15 + 72LL))(v15, 1);
sub_1002E74E0(a1[60]);
v16 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_ballBtn_off_001.png");
v17 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_ballBtn_on_001.png");
v18 = CCMenuItemToggler::create((__int64)v16, (__int64)v17, (__int64)a1, (__int64)GJGarageLayer::onSelectTab, 0);
CCMenuItemToggler::setSizeMult((__int64)v18, 1.2);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v9 + 456LL))(v9, v18);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v18 + 72LL))(v18, 2);
sub_1002E74E0(a1[60]);
v19 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_birdBtn_off_001.png");
v20 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_birdBtn_on_001.png");
v21 = CCMenuItemToggler::create((__int64)v19, (__int64)v20, (__int64)a1, (__int64)GJGarageLayer::onSelectTab, 0);
CCMenuItemToggler::setSizeMult((__int64)v21, 1.2);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v9 + 456LL))(v9, v21);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v21 + 72LL))(v21, 3);
sub_1002E74E0(a1[60]);
v22 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_dartBtn_off_001.png");
v23 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_dartBtn_on_001.png");
v24 = CCMenuItemToggler::create((__int64)v22, (__int64)v23, (__int64)a1, (__int64)GJGarageLayer::onSelectTab, 0);
CCMenuItemToggler::setSizeMult((__int64)v24, 1.2);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v9 + 456LL))(v9, v24);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v24 + 72LL))(v24, 4);
sub_1002E74E0(a1[60]);
v25 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_robotBtn_off_001.png");
v26 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_robotBtn_on_001.png");
v27 = CCMenuItemToggler::create((__int64)v25, (__int64)v26, (__int64)a1, (__int64)GJGarageLayer::onSelectTab, 0);
CCMenuItemToggler::setSizeMult((__int64)v27, 1.2);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v9 + 456LL))(v9, v27);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v27 + 72LL))(v27, 5);
sub_1002E74E0(a1[60]);
v28 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_spiderBtn_off_001.png");
v29 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_spiderBtn_on_001.png");
v30 = CCMenuItemToggler::create((__int64)v28, (__int64)v29, (__int64)a1, (__int64)GJGarageLayer::onSelectTab, 0);
CCMenuItemToggler::setSizeMult((__int64)v30, 1.2);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v9 + 456LL))(v9, v30);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v30 + 72LL))(v30, 6);
sub_1002E74E0(a1[60]);
v31 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_swingBtn_off_001.png");
v32 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_swingBtn_on_001.png");
v33 = CCMenuItemToggler::create((__int64)v31, (__int64)v32, (__int64)a1, (__int64)GJGarageLayer::onSelectTab, 0);
CCMenuItemToggler::setSizeMult((__int64)v33, 1.2);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v9 + 456LL))(v9, v33);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v33 + 72LL))(v33, 7);
sub_1002E74E0(a1[60]);
v34 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_jetpackBtn_off_001.png");
v35 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_jetpackBtn_on_001.png");
v36 = CCMenuItemToggler::create((__int64)v34, (__int64)v35, (__int64)a1, (__int64)GJGarageLayer::onSelectTab, 0);
CCMenuItemToggler::setSizeMult((__int64)v36, 1.2);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v9 + 456LL))(v9, v36);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v36 + 72LL))(v36, 8);
sub_1002E74E0(a1[60]);
v37 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_streakBtn_off_001.png");
v38 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_streakBtn_on_001.png");
v39 = CCMenuItemToggler::create((__int64)v37, (__int64)v38, (__int64)a1, (__int64)GJGarageLayer::onSelectTab, 0);
CCMenuItemToggler::setSizeMult((__int64)v39, 1.2);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v9 + 456LL))(v9, v39);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v39 + 72LL))(v39, 99);
sub_1002E74E0(a1[60]);
v40 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_explosionBtn_off_001.png");
v41 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_explosionBtn_on_001.png");
v42 = CCMenuItemToggler::create((__int64)v40, (__int64)v41, (__int64)a1, (__int64)GJGarageLayer::onSelectTab, 0);
CCMenuItemToggler::setSizeMult((__int64)v42, 1.2);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v9 + 456LL))(v9, v42);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v42 + 72LL))(v42, 98);
sub_1002E74E0(a1[60]);
if ( (unsigned int)sub_1002E757C(a1[60]) )
{
v43 = 0;
do
{
v44 = (_QWORD **)sub_1002E75A0(a1[60], v43);
v64.i32[0] = ((__int64 (__fastcall *)(_QWORD **))(*v44)[8])(v44);
v45 = (*(__int64 (__fastcall **)(_QWORD *))(*v44[47] + 1072LL))(v44[47]);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v45 + 160LL))(v45, 0.9);
v46 = (*(__int64 (__fastcall **)(_QWORD *))(*v44[48] + 1072LL))(v44[48]);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v46 + 160LL))(v46, 0.9);
v66[0] = (float32x2_t)&v64;
*((_DWORD *)sub_1001E71D0((__int64)(a1 + 65), (int *)&v64, (__int64)&unk_10076DCF5, (unsigned int **)v66) + 8) = -1;
++v43;
}
while ( v43 < (unsigned int)sub_1002E757C(a1[60]) );
}
cocos2d::CCMenu::alignItemsHorizontallyWithPadding(v9, 2.0);
sub_1000262BC((float *)v66, *(float *)&v67 * 0.5, (float)(*((float *)&v67 + 1) * 0.5) + 30.0);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v9 + 184LL))(v9, v66);
v47 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_select_001.png");
a1[68] = (__int64)v47;
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v47 + 160LL))(v47, 0.85);
(*(void (__fastcall **)(__int64 *, __int64, __int64))(*a1 + 464))(a1, a1[68], 1);
v48 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_select_001.png");
a1[69] = (__int64)v48;
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v48 + 160LL))(v48, 0.85);
(*(void (__fastcall **)(__int64 *, __int64, __int64))(*a1 + 464))(a1, a1[69], 1);
v49 = sub_1003065B0("GJ_arrow_%02d_001.png", 1);
CString = cocos2d::CCString::getCString((__int64)v49);
v51 = cocos2d::CCSprite::createWithSpriteFrameName(CString);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v51 + 160LL))(v51, 0.8);
v52 = CCMenuItemSpriteExtra::create((__int64)v51, 0, (__int64)a1, (__int64)GJGarageLayer::onArrow, 0);
a1[72] = (__int64)v52;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v9 + 456LL))(v9, v52);
CCMenuItemSpriteExtra::setSizeMult(a1[72], 2.2);
v53 = a1[72];
v54 = (float32x2_t *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v4 + 192LL))(v4);
sub_1000262BC((float *)&v63, -220.0, 0.0);
sub_100026318(v54, &v63, &v64);
cocos2d::CCNode::convertToNodeSpace(v9, (__int64)&v64, v66);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v53 + 184LL))(v53, v66);
v55 = (unsigned __int8 *)cocos2d::CCSprite::createWithSpriteFrameName(CString);
(*(void (__fastcall **)(unsigned __int8 *, float))(*(_QWORD *)v55 + 160LL))(v55, 0.8);
cocos2d::CCSprite::setFlipX(v55, 1);
v56 = CCMenuItemSpriteExtra::create((__int64)v55, 0, (__int64)a1, (__int64)GJGarageLayer::onArrow, 0);
a1[73] = (__int64)v56;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v9 + 456LL))(v9, v56);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1[73] + 72LL))(a1[73], 1);
v57 = a1[73];
v58 = (float32x2_t *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v4 + 192LL))(v4);
sub_1000262BC((float *)&v63, 220.0, 0.0);
sub_100026318(v58, &v63, &v64);
cocos2d::CCNode::convertToNodeSpace(v9, (__int64)&v64, v66);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v57 + 184LL))(v57, v66);
CCMenuItemSpriteExtra::setSizeMult(a1[73], 2.2);
v59 = sub_1002E736C();
a1[61] = (__int64)v59;
cocos2d::CCObject::retain((__int64)v59);
v60 = cocos2d::CCMenu::create();
a1[74] = v60;
(*(void (__fastcall **)(__int64 *, __int64))(*a1 + 456))(a1, v60);
v61 = a1[74];
sub_1000262BC((float *)v66, *(float *)&v67 * 0.5, 25.0);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v61 + 184LL))(v61, v66);
return GJGarageLayer::selectTab(a1, 0);
}