//
// GameStatsManager::getItemUnlockState from 0x10003d550 to 0x10003d5f2 (162 bytes)
//
// 4 xrefs:
// > GameStatsManager::getItemUnlockStateLite @ 0x10003d6ae
// > GJGarageLayer::setupSpecialPage @ 0x100356bc9
// > ItemInfoPopup::init @ 0x10035b4e5
// > CharacterColorPage::updateColorMode @ 0x10073d7c5
//
// 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:19:34 +0000
//
__int64 __fastcall GameStatsManager::getItemUnlockState(__int64 a1, __int64 a2, signed int a3)
{
__int64 v4; // r12
__int64 v5; // r12
__int64 result; // rax
__int64 *v7; // rcx
size_t v8[8]; // [rsp+0h] [rbp-40h] BYREF
v4 = *(_QWORD *)(a1 + 832);
GameStatsManager::getItemKey(v8, a2, a2, a3);
v5 = cocos2d::CCDictionary::objectForKey(v4, v8);
if ( (v8[0] & 1) != 0 )
operator delete((void *)v8[2]);
if ( !v5 )
{
v7 = *(__int64 **)(a1 + 896);
result = 0;
while ( 1 )
{
if ( !v7 )
return result;
if ( *((_DWORD *)v7 + 7) <= a3 )
{
if ( *((_DWORD *)v7 + 7) < a3 )
goto LABEL_7;
if ( *((_DWORD *)v7 + 8) <= (int)a2 )
break;
}
LABEL_8:
v7 = (__int64 *)*v7;
}
if ( *((_DWORD *)v7 + 8) >= (int)a2 )
return 3;
LABEL_7:
++v7;
goto LABEL_8;
}
return (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 64LL))(v5);
}