//
// GameStatsManager::getItemUnlockState from 0x1401e5b00 to 0x1401e5bc8 (200 bytes)
//
// 4 xrefs:
// > CharacterColorPage::updateColorMode @ 0x140089a96
// > GJGarageLayer::setupSpecialPage @ 0x140276ed3
// > ItemInfoPopup::init @ 0x14027c210
// > ??> @ 0x1406cc600
//
// 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
//
// Hidden C++ exception states: #wind=1
int GameStatsManager::getItemUnlockState(GameStatsManager *a1, int a2, UnlockType a3)
{
_QWORD *ItemKey; // rax
__int64 v7; // rsi
std::_Tree_val>>::_Nodeptr Myhead; // rdx
std::_Tree_simple_types>::_Node *v10; // rax
_QWORD v11[4]; // [rsp+20h] [rbp-48h] BYREF
ItemKey = GameStatsManager::getItemKey((__int64)a1, v11, a2, a3);
v7 = cocos2d::CCDictionary::objectForKey(a1->m_unlockedItems, ItemKey);
sub_14003A830((__int64)v11);
if ( v7 )
return (*(int (__fastcall **)(__int64))(*(_QWORD *)v7 + 56LL))(v7);
Myhead = a1->m_wraithIcons._Mypair._Myval2._Myval2._Myhead;
v10 = *((std::_Tree_simple_types>::_Node **)Myhead + 1);
while ( !*((_BYTE *)v10 + 25) )
{
if ( *((_DWORD *)v10 + 7) < a3 || *((_DWORD *)v10 + 7) <= a3 && *((_DWORD *)v10 + 8) < a2 )
{
v10 = *((std::_Tree_simple_types>::_Node **)v10 + 2);
}
else
{
Myhead = v10;
v10 = *(std::_Tree_simple_types>::_Node **)v10;
}
}
if ( *((_BYTE *)Myhead + 25)
|| a3 < *((_DWORD *)Myhead + 7)
|| a3 <= *((_DWORD *)Myhead + 7) && a2 < *((_DWORD *)Myhead + 8) )
{
return 0;
}
else
{
return 3;
}
}