//
// GJItemIcon::darkenStoreItem from 0x140383d90 to 0x140383fac (540 bytes)
//
// 6 xrefs:
// > GJGarageLayer::setupSpecialPage @ 0x14037faf3
// > GJItemIcon::darkenStoreItem_1 @ 0x140383d84
// > GJItemIcon::changeToLockedState @ 0x140384096
// > GJShopLayer::init @ 0x1403b16cc
// > ShardsPage::init @ 0x14062ced4
// > ??> @ 0x140922a3c
//
// 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:06 +0000
//
int __fastcall GJItemIcon::darkenStoreItem(__int64 a1, __int64 a2)
{
__int64 v2; // rbx
bool v4; // zf
__int64 v5; // rdi
void (__fastcall **v6)(__int64, void *); // rax
__int64 v7; // rcx
__int64 v8; // rdx
cocos2d::CCArray *v9; // rax
__int64 v10; // rcx
__int64 v11; // rcx
__int64 v12; // rcx
__int64 v13; // rcx
__int64 v14; // rcx
__int64 v15; // rdx
__int64 v16; // rcx
__int64 v17; // rdx
__int64 v18; // rdx
cocos2d::CCArray *v19; // rdi
unsigned int v20; // ebx
struct cocos2d::CCObject *v21; // rax
v2 = *(_QWORD *)(a1 + 600);
v4 = *(_BYTE *)(a1 + 620) == 0;
v5 = v2 + 320;
v6 = *(void (__fastcall ***)(__int64, void *))(v2 + 320);
v7 = v2 + 320;
if ( v4 )
{
(*v6)(v7, &unk_140703468);
LOBYTE(v18) = 120;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v5 + 40LL))(v2 + 320, v18);
v9 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 480LL))(v2);
v19 = v9;
if ( v9 )
{
v20 = 0;
for ( LODWORD(v9) = cocos2d::CCArray::count(v9); v20 < (unsigned int)v9; LODWORD(v9) = cocos2d::CCArray::count(v19) )
{
v21 = cocos2d::CCArray::objectAtIndex(v19, v20);
(*(void (__fastcall **)(struct cocos2d::CCObject *, _QWORD))(*(_QWORD *)v21 + 336LL))(v21, 0);
++v20;
}
}
}
else
{
(*v6)(v7, &unk_140703468);
LOBYTE(v8) = 120;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v5 + 40LL))(v2 + 320, v8);
*(_BYTE *)(v2 + 660) = 0;
SimplePlayer::updateColors(v2);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v2 + 608) + 336LL))(*(_QWORD *)(v2 + 608), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v2 + 616) + 336LL))(*(_QWORD *)(v2 + 616), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v2 + 632) + 336LL))(*(_QWORD *)(v2 + 632), 0);
LODWORD(v9) = (*(__int64 (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v2 + 624) + 336LL))(
*(_QWORD *)(v2 + 624),
0);
v10 = *(_QWORD *)(v2 + 640);
if ( v10 )
LODWORD(v9) = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 1104LL))(v10);
v11 = *(_QWORD *)(v2 + 640);
if ( v11 )
LODWORD(v9) = (*(__int64 (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v11 + 768) + 336LL))(
*(_QWORD *)(v11 + 768),
0);
v12 = *(_QWORD *)(v2 + 648);
if ( v12 )
LODWORD(v9) = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v12 + 1104LL))(v12);
v13 = *(_QWORD *)(v2 + 648);
if ( v13 )
LODWORD(v9) = (*(__int64 (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v13 + 768) + 336LL))(
*(_QWORD *)(v13 + 768),
0);
v14 = *(_QWORD *)(v2 + 640);
if ( v14 )
{
*(_WORD *)(v14 + 753) = *(_WORD *)a2;
*(_BYTE *)(v14 + 755) = *(_BYTE *)(a2 + 2);
GJRobotSprite::updateColors();
LOBYTE(v15) = -66;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)(*(_QWORD *)(v2 + 640) + 320LL) + 40LL))(
*(_QWORD *)(v2 + 640) + 320LL,
v15);
LODWORD(v9) = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v2 + 640) + 1104LL))(*(_QWORD *)(v2 + 640));
}
v16 = *(_QWORD *)(v2 + 648);
if ( v16 )
{
*(_WORD *)(v16 + 753) = *(_WORD *)a2;
*(_BYTE *)(v16 + 755) = *(_BYTE *)(a2 + 2);
GJRobotSprite::updateColors();
LOBYTE(v17) = -66;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)(*(_QWORD *)(v2 + 648) + 320LL) + 40LL))(
*(_QWORD *)(v2 + 648) + 320LL,
v17);
LODWORD(v9) = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v2 + 648) + 1104LL))(*(_QWORD *)(v2 + 648));
}
}
return (int)v9;
}