//
// GJEffectManager::timeForItem from 0x140263930 to 0x1402639e9 (185 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::getItemValue @ 0x140234222
// > GJBaseGameLayer::updateTimerLabels @ 0x1402352ea
//
// 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
//
double GJEffectManager::timeForItem(GJEffectManager *a1, int a2)
{
int v2; // r9d
std::_List_val>>::_Nodeptr v4; // rax
std::_List_val>>::_Nodeptr Myhead; // r10
std::_Vector_val>>>>>::pointer Myfirst; // rdx
unsigned __int64 v7; // r11
__int64 v8; // rcx
__int64 v9; // rdx
v2 = a2;
v4 = nullptr;
if ( a2 < 0 )
v2 = 0;
if ( v2 > 9999 )
v2 = 9999;
Myhead = a1->m_timerItemMap._List._Mypair._Myval2._Myhead;
Myfirst = a1->m_timerItemMap._Vec._Mypair._Myval2._Myfirst;
v7 = 2
* ((0x100000001B3LL
* (HIBYTE(v2)
^ (0x100000001B3LL
* (BYTE2(v2)
^ (0x100000001B3LL * (BYTE1(v2) ^ (0x100000001B3LL * ((unsigned __int8)v2 ^ 0xCBF29CE484222325uLL))))))))
& a1->m_timerItemMap._Mask);
v8 = *((_QWORD *)Myfirst
+ 2
* ((0x100000001B3LL
* (HIBYTE(v2)
^ (0x100000001B3LL
* (BYTE2(v2)
^ (0x100000001B3LL * (BYTE1(v2) ^ (0x100000001B3LL * ((unsigned __int8)v2 ^ 0xCBF29CE484222325uLL))))))))
& a1->m_timerItemMap._Mask)
+ 1);
if ( (std::_List_val>>::_Nodeptr)v8 != Myhead )
{
v9 = *((_QWORD *)Myfirst + v7);
if ( v2 == *(_DWORD *)(v8 + 16) )
{
LABEL_9:
v4 = (std::_List_val>>::_Nodeptr)v8;
}
else
{
while ( v8 != v9 )
{
v8 = *(_QWORD *)(v8 + 8);
if ( v2 == *(_DWORD *)(v8 + 16) )
goto LABEL_9;
}
}
}
if ( !v4 )
v4 = a1->m_timerItemMap._List._Mypair._Myval2._Myhead;
if ( v4 == Myhead )
return 0.0;
else
return *((double *)v4 + 4);
}