//
// GJBaseGameLayer::processFollowActions from 0x100124fb0 to 0x10012539f (1007 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::processMoveActionsStep @ 0x100122c39
// > GJBaseGameLayer::update @ 0x100130066
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 12:24:40 +0000
//
__int64 __fastcall GJBaseGameLayer::processFollowActions(__int64 a1)
{
__int64 v1; // rax
_QWORD *v2; // r13
__int64 result; // rax
__int64 v5; // r14
__int64 v6; // rdi
int v7; // eax
__int64 v8; // r12
__int64 v9; // r15
int v10; // ecx
__int64 v11; // r15
__m128d v12; // xmm2
__m128d v13; // xmm1
char v14; // r15
__m128d *v15; // rax
__int64 v16; // r12
unsigned int v17; // eax
unsigned int *v18; // rax
__int64 *v19; // r15
__int64 v20; // r12
int v21; // eax
__int64 v22; // r12
int v23; // eax
__int64 v24; // r12
unsigned int v25; // eax
_QWORD *i; // [rsp+18h] [rbp-48h]
unsigned __int64 v27; // [rsp+20h] [rbp-40h]
__int64 v28; // [rsp+30h] [rbp-30h]
v1 = *(_QWORD *)(a1 + 2152);
v2 = *(_QWORD **)(v1 + 1528);
result = *(_QWORD *)(v1 + 1536);
for ( i = (_QWORD *)result; v2 != i; ++v2 )
{
v5 = *v2;
v6 = *v2;
v7 = (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)*v2 + 64LL))(*v2);
v8 = (unsigned int)v7;
if ( v7 >= 9999 )
v8 = 9999;
if ( (int)v8 <= 0 )
v8 = 0;
v28 = *(_QWORD *)(*(_QWORD *)(a1 + 3616) + 8 * v8);
if ( !v28 )
{
v9 = sub_1007FE900(v6);
cocos2d::CCDictionary::setObject_1(*(_QWORD *)(a1 + 3592), v9, v8);
v28 = v9;
*(_QWORD *)(*(_QWORD *)(a1 + 3616) + 8 * v8) = v9;
}
result = GJBaseGameLayer::tryGetMainObject((_QWORD *)a1, *(_DWORD *)(v5 + 116));
if ( result )
{
v10 = *(_DWORD *)(a1 + 944);
if ( *(_DWORD *)(result + 1236) != v10 )
{
*(_QWORD *)(result + 1224) = *(_QWORD *)(result + 944);
*(_DWORD *)(result + 1236) = v10;
v11 = result;
GameObject::dirtifyObjectRect(result);
result = v11;
}
v12 = (__m128d)*(unsigned __int64 *)(result + 944);
v12.f64[0] = (v12.f64[0] - *(float *)(result + 1224)) * *(double *)(v5 + 128);
*(double *)(v5 + 56) = v12.f64[0];
v13 = (__m128d)*(unsigned __int64 *)(result + 952);
v13.f64[0] = (v13.f64[0] - *(float *)(result + 1228)) * *(double *)(v5 + 136);
*(double *)(v5 + 64) = v13.f64[0];
v14 = _mm_cvtsi128_si32((__m128i)_mm_or_pd(_mm_cmpneq_pd(v13, (__m128d)0LL), _mm_cmpneq_pd(v12, (__m128d)0LL)));
if ( (v14 & 1) != 0
|| *(_BYTE *)(v5 + 120)
|| *(_BYTE *)(result + 1291) == 1
&& (v24 = *(_QWORD *)(a1 + 2152),
v25 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 64LL))(v5),
result = GJEffectManager::wasFollowing(v24, v25, *(unsigned int *)(v5 + 116)),
(_BYTE)result) )
{
v15 = *(__m128d **)(v5 + 200);
if ( v15 )
v15[3] = _mm_add_pd(v15[3], *(__m128d *)(v5 + 56));
v16 = *(_QWORD *)(a1 + 2152);
v17 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 64LL))(v5);
GJEffectManager::setFollowing(v16, v17, *(unsigned int *)(v5 + 116), v14 & 1);
*(_DWORD *)(a1 + 13752) += sub_1007FEF90(v28);
if ( v28 )
{
v18 = *(unsigned int **)(v28 + 56);
if ( *v18 )
{
v19 = *((__int64 **)v18 + 2);
v27 = (unsigned __int64)&v19[*v18 - 1];
if ( v12.f64[0] == 0.0 )
{
do
{
v22 = *v19;
if ( !*v19 )
break;
if ( !*(_BYTE *)(v22 + 1290) )
{
v23 = *(_DWORD *)(a1 + 944);
if ( *(_DWORD *)(v22 + 1236) != v23 )
{
*(_QWORD *)(v22 + 1224) = *(_QWORD *)(v22 + 944);
*(_DWORD *)(v22 + 1236) = v23;
GameObject::dirtifyObjectRect(v22);
}
}
if ( v13.f64[0] != 0.0 )
*(double *)(v22 + 952) = *(double *)(v5 + 64) + *(double *)(v22 + 952);
GameObject::dirtifyObjectPos(v22);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1368LL))(a1, v22);
++v19;
}
while ( (unsigned __int64)v19 <= v27 );
}
else
{
do
{
v20 = *v19;
if ( !*v19 )
break;
if ( !*(_BYTE *)(v20 + 1290) )
{
v21 = *(_DWORD *)(a1 + 944);
if ( *(_DWORD *)(v20 + 1236) != v21 )
{
*(_QWORD *)(v20 + 1224) = *(_QWORD *)(v20 + 944);
*(_DWORD *)(v20 + 1236) = v21;
GameObject::dirtifyObjectRect(v20);
}
}
if ( v13.f64[0] != 0.0 )
*(double *)(v20 + 952) = *(double *)(v5 + 64) + *(double *)(v20 + 952);
GameObject::dirtifyObjectPos(v20);
if ( !*(_BYTE *)(v20 + 708) )
*(double *)(v20 + 944) = *(double *)(v5 + 56) + *(double *)(v20 + 944);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1368LL))(a1, v20);
++v19;
}
while ( (unsigned __int64)v19 <= v27 );
}
}
}
result = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1376LL))(a1, v28);
}
}
}
return result;
}