//
// GJEffectManager::countForItem from 0x1402623f0 to 0x1402624a5 (181 bytes)
//
// 9 xrefs:
// > GJBaseGameLayer::getItemValue @ 0x140234231
// > GJBaseGameLayer::refreshCounterLabels @ 0x140235631
// > GJEffectManager::updateCountForItem @ 0x1402624df
// > EffectGameObject::triggerObject @ 0x1404a6026
// > CountTriggerGameObject::triggerObject @ 0x1404bb2f6
// > CountTriggerGameObject::triggerObject @ 0x1404bb323
// > CountTriggerGameObject::triggerObject @ 0x1404bb359
// > CountTriggerGameObject::triggerObject @ 0x1404bb3cc
// > CountTriggerGameObject::triggerObject @ 0x1404bb525
//
// 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
//
int GJEffectManager::countForItem(GJEffectManager *a1, int a2)
{
int v3; // r10d
std::_List_val>>::_Nodeptr v4; // rax
std::_List_val>>::_Nodeptr Myhead; // r8
std::_Simple_types>>>>::value_type *v6; // rdx
std::_List_unchecked_const_iterator>>, std::_Iterator_base0>::_Nodeptr Ptr; // rcx
std::_List_unchecked_const_iterator>>, std::_Iterator_base0>::_Nodeptr v8; // rdx
v3 = a2;
v4 = nullptr;
if ( a2 < 0 )
v3 = 0;
if ( v3 > 9999 )
v3 = 9999;
Myhead = a1->m_itemCountMap._List._Mypair._Myval2._Myhead;
v6 = &a1->m_itemCountMap._Vec._Mypair._Myval2._Myfirst[2
* ((0x100000001B3LL
* (HIBYTE(v3)
^ (0x100000001B3LL
* (BYTE2(v3)
^ (0x100000001B3LL
* (BYTE1(v3)
^ (0x100000001B3LL
* ((unsigned __int8)v3 ^ 0xCBF29CE484222325uLL))))))))
& a1->m_itemCountMap._Mask)];
Ptr = v6[1]._Ptr;
if ( Ptr != Myhead )
{
v8 = v6->_Ptr;
if ( v3 == *((_DWORD *)Ptr + 4) )
{
LABEL_9:
v4 = Ptr;
}
else
{
while ( Ptr != v8 )
{
Ptr = *((std::_List_unchecked_const_iterator>>, std::_Iterator_base0>::_Nodeptr *)Ptr
+ 1);
if ( v3 == *((_DWORD *)Ptr + 4) )
goto LABEL_9;
}
}
}
if ( !v4 )
v4 = a1->m_itemCountMap._List._Mypair._Myval2._Myhead;
if ( v4 == Myhead )
return 0;
else
return *((_DWORD *)v4 + 5);
}