//
// GJGarageLayer::setupSpecialPage from 0x8bffc0 to 0x8c051c (1372 bytes)
//
// 2 xrefs:
// > GJGarageLayer::setupPage @ 0x8c0b00
// > ??> @ 0x6f8b0
//
// 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 12:56:30 +0000
//
__int64 __fastcall GJGarageLayer::setupSpecialPage(GJGarageLayer *this)
{
cocos2d::CCDirector *v2; // x0
__int64 v3; // x0
cocos2d::CCArray *Items; // x19
__int64 v5; // x0
__int64 v6; // x1
__int64 v7; // x19
void (__fastcall *v8)(__int64, __int64 *); // x22
cocos2d::CCNode *v9; // x23
const cocos2d::CCPoint *v10; // x0
cocos2d::CCArray *v11; // x19
__int64 v12; // x19
__int64 v13; // x1
__int64 v14; // x19
void (__fastcall *v15)(__int64, __int64 *); // x22
cocos2d::CCNode *v16; // x23
const cocos2d::CCPoint *v17; // x0
cocos2d::CCNode *v18; // x25
unsigned int v19; // w19
int v20; // w23
const char *v21; // x1
GameManager *BrowserItem; // x0
GameManager *v23; // x26
__int64 v24; // x0
GameStatsManager *isIconUnlocked; // x0
int v26; // w24
__int64 v27; // x0
GJItemIcon *v28; // x22
float v29; // s10
_DWORD *v30; // x28
__int64 v31; // x0
__int64 v32; // x0
int v33; // w1
__int64 v35; // x0
char isItemEnabled; // w0
int ItemUnlockState; // [xsp+94h] [xbp+94h]
void (__fastcall *v38)(GJItemIcon *, __int64 *); // [xsp+98h] [xbp+98h]
void (__fastcall *v39)(_DWORD *, __int64); // [xsp+A0h] [xbp+A0h]
__int64 (__fastcall *v40)(_DWORD *, __int64 *); // [xsp+A0h] [xbp+A0h]
__int64 v41; // [xsp+B0h] [xbp+B0h] BYREF
_BYTE v42[8]; // [xsp+B8h] [xbp+B8h] BYREF
__int64 v43; // [xsp+C0h] [xbp+C0h] BYREF
_BYTE v44[8]; // [xsp+C8h] [xbp+C8h] BYREF
__int64 v45; // [xsp+D0h] [xbp+D0h] BYREF
v2 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(_stack_chk_guard);
cocos2d::CCDirector::getWinSize(&v41, v2);
v3 = *((_QWORD *)this + 71);
if ( v3 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v3 + 536LL))(v3);
*((_QWORD *)this + 71) = 0;
}
Items = GJGarageLayer::getItems(this, 99);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v45,
*(float *)&v41 * 0.5,
(float)((float)(*((float *)&v41 + 1) * 0.5) + -5.0) - 60.0);
v5 = ListButtonBar::create(Items, (const cocos2d::CCPoint *)&v45, 12, 3, 1u, 5.0, 5.0, 25.0, 220.0);
*((_QWORD *)this + 71) = v5;
BoomScrollLayer::togglePageIndicators(*(BoomScrollLayer **)(v5 + 320), 0);
(*(void (__fastcall **)(GJGarageLayer *, _QWORD, __int64))(*(_QWORD *)this + 464LL))(
this,
*((_QWORD *)this + 71),
100);
v6 = *((_QWORD *)this + 70);
if ( v6 )
{
v7 = *((_QWORD *)this + 68);
v8 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v7 + 184LL);
v9 = (cocos2d::CCNode *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v6 + 512LL))(*((_QWORD *)this + 70));
v10 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 70) + 192LL))(*((_QWORD *)this + 70));
cocos2d::CCNode::convertToWorldSpace(&v45, v9, v10);
v8(v7, &v45);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 68) + 344LL))(*((_QWORD *)this + 68), 1);
}
else
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 68) + 344LL))(*((_QWORD *)this + 68), 0);
}
v11 = GJGarageLayer::getItems(this, 101);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v45,
*(float *)&v41 * 0.5,
(float)((float)((float)(*((float *)&v41 + 1) * 0.5) + -5.0) - 60.0) - 30.0);
v12 = ListButtonBar::create(v11, (const cocos2d::CCPoint *)&v45, 12, 3, 1u, 5.0, 5.0, 25.0, 220.0);
BoomScrollLayer::togglePageIndicators(*(BoomScrollLayer **)(v12 + 320), 0);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 71) + 464LL))(
*((_QWORD *)this + 71),
v12,
100);
v13 = *((_QWORD *)this + 70);
if ( v13 )
{
v14 = *((_QWORD *)this + 69);
v15 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v14 + 184LL);
v16 = (cocos2d::CCNode *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v13 + 512LL))(*((_QWORD *)this + 70));
v17 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 70) + 192LL))(*((_QWORD *)this + 70));
cocos2d::CCNode::convertToWorldSpace(&v45, v16, v17);
v15(v14, &v45);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 344LL))(*((_QWORD *)this + 69), 1);
}
else
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 69) + 344LL))(*((_QWORD *)this + 69), 0);
}
v18 = (cocos2d::CCNode *)cocos2d::CCMenu::create(nullptr, (cocos2d::CCMenuItem *)&v43);
v19 = 18;
v20 = 0;
(*(void (__fastcall **)(_QWORD, cocos2d::CCNode *, __int64))(**((_QWORD **)this + 71) + 464LL))(
*((_QWORD *)this + 71),
v18,
1000);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v42,
(float)((float)(*(float *)&v41 * 0.5) + -137.5) - 27.5,
(float)((float)((float)(*((float *)&v41 + 1) * 0.5) + -5.0) - 60.0) - 30.0);
cocos2d::CCNode::convertToWorldSpace(&v45, *((cocos2d::CCNode **)this + 71), (const cocos2d::CCPoint *)v42);
cocos2d::CCNode::convertToNodeSpace(&v43, v18, (const cocos2d::CCPoint *)&v45);
BrowserItem = (GameManager *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"playerSquare_001.png",
v21);
v23 = BrowserItem;
do
{
v24 = GameManager::sharedState(BrowserItem);
isIconUnlocked = (GameStatsManager *)GameManager::isIconUnlocked(v24, v19, 0x64u);
v26 = (unsigned __int8)isIconUnlocked;
v27 = GameStatsManager::sharedState(isIconUnlocked);
ItemUnlockState = GameStatsManager::getItemUnlockState(v27, v19, 12);
BrowserItem = (GameManager *)GJItemIcon::createBrowserItem(12, v19);
v28 = BrowserItem;
if ( v26 )
{
v35 = GameStatsManager::sharedState(BrowserItem);
isItemEnabled = GameStatsManager::isItemEnabled(v35, 12, v19);
BrowserItem = (GameManager *)GJItemIcon::toggleEnabledState(v28, isItemEnabled);
}
if ( v28 )
{
v29 = GJItemIcon::scaleForType(12);
(*(void (__fastcall **)(GJItemIcon *))(*(_QWORD *)v28 + 160LL))(v28);
v30 = (_DWORD *)CCMenuItemSpriteExtra::create(
(__int64)v28,
0,
(__int64)this,
(__int64)GJGarageLayer::onToggleItem,
0);
v39 = *(void (__fastcall **)(_DWORD *, __int64))(*(_QWORD *)v30 + 320LL);
v31 = (*(__int64 (__fastcall **)(GameManager *))(*(_QWORD *)v23 + 328LL))(v23);
v39(v30, v31);
v38 = *(void (__fastcall **)(GJItemIcon *, __int64 *))(*(_QWORD *)v28 + 184LL);
*(float *)&v39 = *(float *)(*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)v30 + 328LL))(v30) * 0.5;
v32 = (*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)v30 + 328LL))(v30);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v45, *(float *)&v39, *(float *)(v32 + 4) * 0.5);
v38(v28, &v45);
(*(void (__fastcall **)(_DWORD *, _QWORD))(*(_QWORD *)v30 + 72LL))(v30, v19);
v30[124] = 100;
(*(void (__fastcall **)(cocos2d::CCNode *, _DWORD *))(*(_QWORD *)v18 + 456LL))(v18, v30);
v33 = 30 * v20++;
v40 = *(__int64 (__fastcall **)(_DWORD *, __int64 *))(*(_QWORD *)v30 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v44, (float)v33, 0.0);
cocos2d::CCPoint::operator+(&v45, &v43);
BrowserItem = (GameManager *)v40(v30, &v45);
if ( !v26 )
{
if ( ItemUnlockState )
BrowserItem = (GameManager *)GJItemIcon::changeToLockedState(v28, 1.0 / v29);
else
BrowserItem = GJItemIcon::darkenStoreItem((__int64)v28, (GJItemIcon *)&byte_5);
}
}
++v19;
}
while ( v19 != 21 );
return _stack_chk_guard;
}