//
// GJBaseGameLayer::triggerDynamicMoveCommand from 0x5a1f8c to 0x5a2128 (412 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::triggerMoveCommand @ 0x5a22e6
//
// 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:53:17 +0000
//
void __fastcall GJBaseGameLayer::triggerDynamicMoveCommand(GJBaseGameLayer *this, EffectGameObject *a2)
{
int v3; // r1
int Object; // r7
int v6; // r8
unsigned int v7; // r2
unsigned int v8; // r9
int v9; // r3
int v10; // lr
int v11; // r2
unsigned int v12; // r1
int v13; // r3
int v14; // r2
void *v15[2]; // [sp+0h] [bp-1Ch] BYREF
int v16; // [sp+8h] [bp-14h]
v3 = *((_DWORD *)a2 + 337);
if ( v3 <= 0 )
v3 = *((_DWORD *)a2 + 321);
Object = GJBaseGameLayer::tryGetObject((cocos2d::CCDictionary **)this, v3);
if ( *((_BYTE *)a2 + 1504) )
goto LABEL_6;
if ( !*((_BYTE *)a2 + 1505) )
{
v6 = GJBaseGameLayer::tryGetObject((cocos2d::CCDictionary **)this, *((_DWORD *)a2 + 322));
goto LABEL_9;
}
if ( *((_BYTE *)this + 866) )
v6 = *((_DWORD *)this + 520);
else
LABEL_6:
v6 = *((_DWORD *)this + 519);
LABEL_9:
if ( Object && v6 )
{
v7 = *((_DWORD *)this + 315);
v8 = *((_DWORD *)this + 316);
if ( v7 >= v8 )
{
v10 = *((_DWORD *)this + 314);
v11 = -286331153 * ((int)(v7 - v10) >> 2);
if ( (unsigned int)(v11 + 1) > 0x4444444 )
sub_388B48();
if ( (unsigned int)(-286331153 * ((int)(v8 - v10) >> 2)) > 0x2222221 )
{
v12 = 71582788;
}
else
{
v12 = -572662306 * ((int)(v8 - v10) >> 2);
if ( v12 < v11 + 1 )
v12 = v11 + 1;
}
std::__split_buffer::__split_buffer(v15, v12, v11, (int)this + 1264);
v13 = v16;
if ( v16 )
{
*(_DWORD *)(v16 + 4) = 0;
*(_DWORD *)(v13 + 8) = 0;
*(_DWORD *)(v13 + 32) = 0;
*(_DWORD *)(v13 + 36) = 0;
*(_DWORD *)(v13 + 40) = 0;
*(_DWORD *)(v13 + 48) = 0;
*(_DWORD *)(v13 + 52) = 0;
*(_DWORD *)(v13 + 56) = 0;
*(_DWORD *)(v13 + 12) = 0;
*(_DWORD *)(v13 + 16) = 0;
*(_DWORD *)(v13 + 20) = 0;
*(_DWORD *)(v13 + 24) = 0;
*(_DWORD *)(v13 + 28) = 0;
*(_BYTE *)(v13 + 44) = 1;
*(_BYTE *)(v13 + 45) = 0;
*(_BYTE *)(v13 + 46) = 0;
*(_BYTE *)(v13 + 47) = 0;
*(_DWORD *)v13 = a2;
*(_DWORD *)(v13 + 48) = *((_DWORD *)a2 + 373);
*(_DWORD *)(v13 + 52) = *((_DWORD *)a2 + 321);
v14 = *((_DWORD *)a2 + 322);
*(_DWORD *)(v13 + 4) = Object;
*(_DWORD *)(v13 + 8) = v6;
*(_DWORD *)(v13 + 56) = v14;
}
v16 += 60;
std::vector::__swap_out_circular_buffer((int *)this + 314, v15);
v16 -= 60 * ((787410671 * ((v16 - (unsigned int)v15[1]) >> 2)) & 0x3FFFFFFF);
if ( v15[0] )
operator delete(v15[0]);
}
else
{
if ( v7 )
{
*(_DWORD *)(v7 + 4) = 0;
*(_DWORD *)(v7 + 8) = 0;
*(_DWORD *)(v7 + 32) = 0;
*(_DWORD *)(v7 + 36) = 0;
*(_DWORD *)(v7 + 40) = 0;
*(_DWORD *)(v7 + 48) = 0;
*(_DWORD *)(v7 + 52) = 0;
*(_DWORD *)(v7 + 56) = 0;
*(_DWORD *)(v7 + 12) = 0;
*(_DWORD *)(v7 + 16) = 0;
*(_DWORD *)(v7 + 20) = 0;
*(_DWORD *)(v7 + 24) = 0;
*(_DWORD *)(v7 + 28) = 0;
*(_BYTE *)(v7 + 44) = 1;
*(_BYTE *)(v7 + 45) = 0;
*(_BYTE *)(v7 + 46) = 0;
*(_BYTE *)(v7 + 47) = 0;
*(_DWORD *)v7 = a2;
*(_DWORD *)(v7 + 48) = *((_DWORD *)a2 + 373);
*(_DWORD *)(v7 + 52) = *((_DWORD *)a2 + 321);
v9 = *((_DWORD *)a2 + 322);
*(_DWORD *)(v7 + 4) = Object;
*(_DWORD *)(v7 + 8) = v6;
*(_DWORD *)(v7 + 56) = v9;
}
*((_DWORD *)this + 315) += 60;
}
}
}