//
// GJEffectManager::setFollowing from 0x5cfa24 to 0x5cfbc8 (420 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::processFollowActions @ 0x595042
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:54:03 +0000
//
void __fastcall GJEffectManager::setFollowing(GJEffectManager *this, int a2, int a3, int a4)
{
int v4; // r6
unsigned int v6; // r7
unsigned int v7; // r4
unsigned int v8; // r11
_DWORD *v9; // r3
_DWORD *i; // r9
unsigned int v11; // r0
int v12; // r1
float v13; // s13
float v14; // s15
bool v15; // r6
unsigned int v16; // r4
unsigned int v17; // r1
void **v18; // r3
unsigned int v19; // r0
int v20; // r1
unsigned int v21; // [sp+4h] [bp-18h] BYREF
void *v22; // [sp+8h] [bp-14h] BYREF
v6 = a3 + 2000 * a2;
v21 = v6;
if ( !a4 )
{
std::__hash_table,std::equal_to,std::allocator>::__erase_unique(
(int *)this + 163,
&v21);
return;
}
v7 = *((_DWORD *)this + 164);
if ( v7 )
{
v8 = v7 - 1;
v4 = ((v7 - 1) & v7) != 0 ? v6 % v7 : v6 & v8;
v9 = *(_DWORD **)(*((_DWORD *)this + 163) + 4 * v4);
if ( v9 )
{
for ( i = (_DWORD *)*v9; i; i = (_DWORD *)*i )
{
v11 = i[1];
v12 = ((v7 - 1) & v7) != 0 ? v11 % v7 : v8 & v11;
if ( v12 != v4 )
break;
if ( i[2] == v6 )
return;
}
}
}
std::__hash_table,std::equal_to,std::allocator>::__construct_node_hash(
(int)&v22,
(int)this + 652,
v6,
&v21);
v13 = *((float *)this + 167);
v14 = (float)(unsigned int)(*((_DWORD *)this + 166) + 1);
if ( v14 > (float)((float)v7 * v13) )
{
v15 = v7 > 2 && ((v7 - 1) & v7) == 0;
goto LABEL_16;
}
if ( !v7 )
{
v15 = 0;
LABEL_16:
v16 = 2 * v7 + !v15;
v17 = (unsigned int)ceilf(v14 / v13);
if ( v17 < v16 )
v17 = v16;
std::__hash_table,std::equal_to,std::allocator>::rehash((int)this + 652, v17);
v7 = *((_DWORD *)this + 164);
if ( ((v7 - 1) & v7) != 0 )
v4 = v6 % v7;
else
v4 = (v7 - 1) & v6;
}
v18 = *(void ***)(*((_DWORD *)this + 163) + 4 * v4);
if ( v18 )
{
*(_DWORD *)v22 = *v18;
*v18 = v22;
}
else
{
*(_DWORD *)v22 = *((_DWORD *)this + 165);
*((_DWORD *)this + 165) = v22;
*(_DWORD *)(*((_DWORD *)this + 163) + 4 * v4) = (char *)this + 660;
if ( *(_DWORD *)v22 )
{
v19 = *(_DWORD *)(*(_DWORD *)v22 + 4);
if ( ((v7 - 1) & v7) != 0 )
v20 = v19 % v7;
else
v20 = (v7 - 1) & v19;
*(_DWORD *)(*((_DWORD *)this + 163) + 4 * v20) = v22;
}
}
++*((_DWORD *)this + 166);
}