//
// GameStatsManager::getItemUnlockState from 0x100336144 to 0x100336200 (188 bytes)
//
// 3 xrefs:
// > CharacterColorPage::updateColorMode @ 0x100129f08
// > GJGarageLayer::setupSpecialPage @ 0x100305498
// > ItemInfoPopup::init @ 0x100308700
//
// 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)
{
cocos2d::CCDictionary *m_unlockedItems; // x22
__int64 v7; // x0
__int64 v8; // x22
std::__tree_end_node *>::pointer left; // x8
UnlockType v11; // w9
int v12; // w9
void *__p[2]; // [xsp+8h] [xbp-38h] BYREF
char v14; // [xsp+1Fh] [xbp-21h]
m_unlockedItems = a1->m_unlockedItems;
GameStatsManager::getItemKey(*(__int64 *)&a2, *(__int64 *)&a3, __p);
v7 = cocos2d::CCDictionary::objectForKey_1(m_unlockedItems, __p);
v8 = v7;
if ( v14 < 0 )
{
operator delete(__p[0]);
if ( v8 )
return (*(int (__fastcall **)(__int64))(*(_QWORD *)v8 + 64LL))(v8);
}
else if ( v7 )
{
return (*(int (__fastcall **)(__int64))(*(_QWORD *)v8 + 64LL))(v8);
}
left = a1->m_wraithIcons.__tree_.__pair1_.__value_.__left_;
if ( left )
{
while ( 1 )
{
v11 = *((_DWORD *)left + 7);
if ( v11 <= a3 )
{
if ( v11 < a3 )
goto LABEL_11;
v12 = *((_DWORD *)left + 8);
if ( v12 <= a2 )
break;
}
LABEL_12:
left = *(std::__tree_end_node *>::pointer *)left;
if ( !left )
return 0;
}
if ( v12 >= a2 )
return 3;
LABEL_11:
left = (std::__tree_end_node *>::pointer)((char *)left + 8);
goto LABEL_12;
}
return 0;
}