//
// GJItemIcon::darkenStoreItem from 0x10035ac80 to 0x10035adc4 (324 bytes)
//
// 11 xrefs:
// > GJPathPage::init @ 0x1002eadd9
// > GJGarageLayer::setupSpecialPage @ 0x100356df1
// > GJGarageLayer::getItems @ 0x100357158
// > GJItemIcon::darkenStoreItem_1 @ 0x100357971
// > GJItemIcon::darkenStoreItem_1 @ 0x10035797c
// > GJItemIcon::darkenStoreItem_1 @ 0x100357987
// > GJItemIcon::darkenStoreItem_1 @ 0x100357992
// > GJItemIcon::darkenStoreItem_1 @ 0x10035799d
// > GJItemIcon::darkenStoreItem_1 @ 0x1003579a8
// > GJItemIcon::changeToLockedState @ 0x1003579e8
// > ShardsPage::init @ 0x1004c0e87
//
// 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 12:28:53 +0000
//
__int64 __fastcall GJItemIcon::darkenStoreItem(__int64 a1, unsigned int a2)
{
char v2; // r15
__int64 v3; // rbx
__int64 result; // rax
__int64 v5; // rdi
__int64 v6; // rdi
__int64 v7; // rbx
unsigned int v8; // r14d
__int64 v9; // rax
v2 = *(_BYTE *)(a1 + 620);
v3 = *(_QWORD *)(a1 + 600);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v3 + 960LL))(v3, &unk_100A083D0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v3 + 912LL))(v3, 120);
if ( v2 == 1 )
{
*(_BYTE *)(v3 + 660) = 0;
SimplePlayer::updateColors(v3);
result = SimplePlayer::hideSecondary(v3);
v5 = *(_QWORD *)(v3 + 640);
if ( v5 )
{
GJRobotSprite::updateColor01(v5, a2);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(v3 + 640) + 912LL))(*(_QWORD *)(v3 + 640), 190);
result = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 640) + 1256LL))(*(_QWORD *)(v3 + 640));
}
v6 = *(_QWORD *)(v3 + 648);
if ( v6 )
{
GJRobotSprite::updateColor01(v6, a2);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(v3 + 648) + 912LL))(*(_QWORD *)(v3 + 648), 190);
return (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 648) + 1256LL))(*(_QWORD *)(v3 + 648));
}
}
else
{
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 488LL))(v3);
if ( result )
{
v7 = result;
result = sub_1007FEF90(result);
if ( (_DWORD)result )
{
v8 = 0;
do
{
v9 = sub_1007FEFE0(v7, v8);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v9 + 344LL))(v9, 0);
++v8;
result = sub_1007FEF90(v7);
}
while ( v8 < (unsigned int)result );
}
}
}
return result;
}