//
// GameStatsManager::getItemUnlockState from 0x100077500 to 0x1000775a2 (162 bytes)
//
// 4 xrefs:
// > GameStatsManager::getItemUnlockStateLite @ 0x10007765e
// > GJGarageLayer::setupSpecialPage @ 0x10036d7a9
// > ItemInfoPopup::init @ 0x100372015
// > CharacterColorPage::updateColorMode @ 0x10065e175
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// local variable allocation has failed, the output may be wrong!
int __fastcall GameStatsManager::getItemUnlockState(GameStatsManager *a1, int a2, UnlockType a3)
{
double v3; // xmm0_8
cocos2d::CCDictionary *m_unlockedItems; // r12
__int64 v6; // r12
int result; // eax
std::__tree_end_node *>::pointer left; // rcx
size_t v9[8]; // [rsp+0h] [rbp-40h] BYREF
m_unlockedItems = a1->m_unlockedItems;
GameStatsManager::getItemKey(v9, v3, *(__int64 *)&a2, a2, a3);
v6 = cocos2d::CCDictionary::objectForKey_1(m_unlockedItems, v9);
if ( (v9[0] & 1) != 0 )
operator delete((void *)v9[2]);
if ( !v6 )
{
left = a1->m_wraithIcons.__tree_.__pair1_.__value_.__left_;
result = 0;
while ( 1 )
{
if ( !left )
return result;
if ( *((_DWORD *)left + 7) <= a3 )
{
if ( *((_DWORD *)left + 7) < a3 )
goto LABEL_7;
if ( *((_DWORD *)left + 8) <= a2 )
break;
}
LABEL_8:
left = *(std::__tree_end_node *>::pointer *)left;
}
if ( *((_DWORD *)left + 8) >= a2 )
return 3;
LABEL_7:
left = (std::__tree_end_node *>::pointer)((char *)left + 8);
goto LABEL_8;
}
return (*(int (__fastcall **)(__int64))(*(_QWORD *)v6 + 64LL))(v6);
}