//
// GJEffectManager::wasFollowing from 0x1002ede30 to 0x1002edf7f (335 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::processFollowActions @ 0x100146f6d
//
// 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
//
bool __fastcall GJEffectManager::wasFollowing(GJEffectManager *a1, int a2, int a3)
{
unsigned __int64 value; // r9
int v4; // ecx
unsigned __int64 v5; // r10
unsigned __int64 v6; // r8
std::__hash_node_base *> *v8; // rax
std::__hash_node_base *>::__next_pointer next; // rdi
unsigned __int64 v10; // r9
std::__hash_node_base *>::__next_pointer v11; // rax
unsigned __int64 v12; // rax
value = a1->m_unkMap4c8.__table_.__bucket_list_.__ptr_.__value_.__data_.__value_;
if ( !value )
return 0;
v4 = a3 + 2000 * a2;
v5 = (0x101010101010101LL
* ((((value - ((value >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((value - ((value >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((value - ((value >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((value - ((value >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v5 > 1 )
{
v6 = v4;
if ( value <= v4 )
{
if ( (value | v4) >> 32 )
v6 = v4 % value;
else
v6 = v4 % (unsigned int)value;
}
}
else
{
v6 = v4 & (value - 1);
}
v8 = a1->m_unkMap4c8.__table_.__bucket_list_.__ptr_.__value_[v6];
if ( v8 )
{
next = v8->__next_;
if ( v8->__next_ )
{
if ( (unsigned int)v5 < 2 )
{
v10 = value - 1;
while ( 1 )
{
v11 = next[1].__next_;
if ( v11 == (std::__hash_node_base *>::__next_pointer)v4 )
{
if ( LODWORD(next[2].__next_) == v4 )
return 1;
}
else if ( (v10 & (unsigned __int64)v11) != v6 )
{
return 0;
}
next = next->__next_;
if ( !next )
return 0;
}
}
do
{
v12 = (unsigned __int64)next[1].__next_;
if ( v12 == v4 )
{
if ( LODWORD(next[2].__next_) == v4 )
return 1;
}
else
{
if ( v12 >= value )
{
if ( (value | v12) >> 32 )
v12 %= value;
else
v12 = (unsigned int)v12 % (unsigned int)value;
}
if ( v12 != v6 )
return 0;
}
next = next->__next_;
}
while ( next );
}
}
return 0;
}