//
// GJGarageLayer::getItems from 0x50ec1c to 0x50ed94 (376 bytes)
//
// 2 xrefs:
// > GJGarageLayer::getItems @ 0x50edc6
// > GJGarageLayer::setupPage @ 0x50f24e
//
// 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:51:30 +0000
//
cocos2d::CCArray *__fastcall GJGarageLayer::getItems(int a1, int a2, int a3, unsigned int a4, int a5)
{
int v8; // r5
GameManager *v9; // r0
int v10; // r4
int v11; // r0
cocos2d::CCArray *v12; // r9
cocos2d::CCArray *v13; // r8
const char *v14; // r1
int *BrowserItem; // r0
int v16; // r2
int *v17; // r10
int v18; // r0
GJItemIcon *v19; // r5
float v20; // s18
cocos2d::CCObject *v21; // r6
int v22; // r0
float v23; // s16
int v24; // r0
int v26; // [sp+Ch] [bp-30h]
int isIconUnlocked; // [sp+10h] [bp-2Ch]
void (__fastcall *v28)(cocos2d::CCObject *, int); // [sp+18h] [bp-24h]
void (__fastcall *v29)(GJItemIcon *, _BYTE *); // [sp+18h] [bp-24h]
unsigned int v30; // [sp+1Ch] [bp-20h] BYREF
_BYTE v31[8]; // [sp+24h] [bp-18h] BYREF
GameManager *(__fastcall *v32)(SimplePlayer **, cocos2d::CCObject *); // [sp+2Ch] [bp-10h]
int v33; // [sp+30h] [bp-Ch]
v30 = a4;
v8 = 36 * a3 + 36;
v9 = (GameManager *)std::map::operator[]((int **)(a1 + 376), (int *)&v30);
*(_DWORD *)v9 = a3;
v10 = v8 - 35;
v11 = GameManager::sharedState(v9);
v12 = (cocos2d::CCArray *)GameManager::iconTypeToUnlockType(v11, v30);
v13 = (cocos2d::CCArray *)cocos2d::CCArray::create(v12);
BrowserItem = (int *)cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"playerSquare_001.png", v14);
v16 = a2;
*(_DWORD *)(a1 + 396) = 0;
if ( a2 >= v8 )
v16 = v8;
v26 = v16;
v17 = BrowserItem;
while ( v10 <= v26 )
{
v18 = GameManager::sharedState((GameManager *)BrowserItem);
isIconUnlocked = GameManager::isIconUnlocked(v18, v10, v30);
BrowserItem = GJItemIcon::createBrowserItem((int)v12, v10);
v19 = (GJItemIcon *)BrowserItem;
if ( BrowserItem )
{
v20 = COERCE_FLOAT(GJItemIcon::scaleForType((int)v12));
(*(void (__fastcall **)(GJItemIcon *, float))(*(_DWORD *)v19 + 80))(v19, COERCE_FLOAT(LODWORD(v20)));
v33 = 0;
v32 = GJGarageLayer::onSelect;
v21 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create((int)v19, 0, a1, (int)GJGarageLayer::onSelect, 0);
v28 = *(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v21 + 160);
v22 = (*(int (__fastcall **)(int *))(*v17 + 164))(v17);
v28(v21, v22);
v29 = *(void (__fastcall **)(GJItemIcon *, _BYTE *))(*(_DWORD *)v19 + 92);
v23 = *(float *)(*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v21 + 164))(v21);
v24 = (*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v21 + 164))(v21);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v31, v23 * 0.5, *(float *)(v24 + 4) * 0.5);
v29(v19, v31);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v21 + 36))(v21, v10);
*((_DWORD *)v21 + 96) = v30;
BrowserItem = (int *)cocos2d::CCArray::addObject(v13, v21);
if ( v10 == a5 )
*(_DWORD *)(a1 + 396) = v21;
if ( !isIconUnlocked )
BrowserItem = (int *)GJItemIcon::changeToLockedState(v19, 1.0 / v20);
}
++v10;
}
return v13;
}