//
// GJBaseGameLayer::processDynamicObjectActions from 0x1001f7180 to 0x1001f7544 (964 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::processMoveActionsStep @ 0x1001f70d0
// > GJBaseGameLayer::processMoveActionsStep @ 0x1001f70f4
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void __fastcall GJBaseGameLayer::processDynamicObjectActions(GJBaseGameLayer *a1, int a2, float a3)
{
int v4; // w19
__int64 v6; // x8
__int64 *v7; // x24
__int64 v8; // x8
__int64 v9; // x9
__int64 v10; // x27
int v11; // w25
__int64 v12; // x21
__int64 v13; // x22
CCMoveCNode *MoveCommandNode; // x0
__int64 v15; // d0
GJEffectManager *m_effectManager; // x8
_QWORD *v17; // x0
GroupCommandObject2 *TempGroupCommand; // x23
float v19; // s9
float v20; // s0
float v21; // s1
float v22; // s13
GroupCommandObject2 *v23; // x0
__int64 v24; // x9
__int64 v25; // x22
__int64 v26; // x21
float v27; // s2
float v28; // s0
int v29; // w8
GroupCommandObject2 *v30; // x0
float v31; // s12
float EasedValue; // s0
float v33; // s1
bool v34; // cc
float v35; // s2
float v36; // s0
float v37; // s0
float v38; // s9
float64x2_t v39; // q0
float v40; // [xsp+0h] [xbp-B0h]
float32x2_t v41; // [xsp+10h] [xbp-A0h] BYREF
float32x2_t v42; // [xsp+18h] [xbp-98h] BYREF
CCMoveCNode *v43; // [xsp+20h] [xbp-90h] BYREF
float32x2_t *v44; // [xsp+28h] [xbp-88h] BYREF
v4 = a2;
if ( a2 )
{
if ( a2 != 1 )
return;
v6 = 1696;
}
else
{
v6 = 1672;
}
v7 = (__int64 *)((char *)a1 + v6);
v9 = *(__int64 *)((char *)&a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable + v6);
v8 = *(_QWORD *)((char *)&a1->m_uID + v6);
if ( v8 != v9 )
{
v10 = 0;
v11 = 0;
while ( 1 )
{
v12 = v9 + 96 * v10;
if ( *(_BYTE *)(v12 + 78) != 1 || *(_BYTE *)(v12 + 79) == 1 )
break;
++v11;
LABEL_28:
v10 = v11;
if ( 0xAAAAAAAAAAAAAAABLL * ((v8 - v9) >> 5) <= v11 )
return;
}
v13 = *(_QWORD *)v12;
MoveCommandNode = GJEffectManager::getMoveCommandNode(a1->m_effectManager, *(GroupCommandObject2 **)&a2);
v43 = MoveCommandNode;
v15 = *(_QWORD *)(v12 + 84);
*(_QWORD *)&MoveCommandNode->m_unknown2 = v15;
LODWORD(MoveCommandNode[1].m_unk068) = *(_DWORD *)(v13 + 916);
HIDWORD(MoveCommandNode[1].m_unk068) = *(_DWORD *)(v12 + 80);
if ( v4 )
{
m_effectManager = a1->m_effectManager;
v42.i32[0] = v15;
v44 = &v42;
v17 = sub_10001A284(
(unsigned __int64)&m_effectManager->m_unkMap5c8,
(int *)&v42,
(__int64)&unk_10063A31C,
(_DWORD **)&v44);
sub_1000115B8((__int64)(v17 + 3), &v43);
GJEffectManager::registerRotationCommand(
a1->m_effectManager,
(GroupCommandObject2 *)v43,
a1->m_effectManager->m_unk798);
TempGroupCommand = nullptr;
}
else
{
TempGroupCommand = GJEffectManager::getTempGroupCommand(a1->m_effectManager);
}
v19 = *(float *)(v13 + 1452);
v20 = *(float *)(v12 + 64);
v21 = *(float *)(v12 + 68);
v22 = v19 - v20;
if ( (v19 == -1.0 || v22 > 0.0 || *(_BYTE *)(v12 + 76) == 1)
&& (*(_BYTE *)(v12 + 77) & 1) == 0
&& (*(_BYTE *)(v12 + 78) & 1) == 0 )
{
if ( *(_BYTE *)(v12 + 76) == 1 )
{
*(_BYTE *)(v12 + 76) = 0;
}
else if ( v19 != -1.0 )
{
if ( v22 <= a3 )
v27 = v19 - v20;
else
v27 = a3;
v20 = v20 + v27;
*(float *)(v12 + 64) = v20;
}
if ( v4 )
{
sub_1001EEEE0(
v13,
*(_QWORD *)(v12 + 8),
*(_QWORD *)(v12 + 24),
*(_QWORD *)(v12 + 16),
*(_QWORD *)(v12 + 32),
*(_QWORD *)(v12 + 40),
*(_QWORD *)(v12 + 48),
*(_QWORD *)(v12 + 56));
v29 = *(_DWORD *)(v13 + 1564);
if ( v29 <= 1 )
v29 = 1;
v30 = (GroupCommandObject2 *)v43;
v43->m_unk098 = (float)(v28 / (float)(unsigned int)v29);
GroupCommandObject2::stepTransformCommand(v30, 0.0, 0, 1);
}
else
{
v31 = v19 - v21;
EasedValue = GameToolbox::getEasedValue(v20 / v19, *(_DWORD *)(v13 + 1496), *(float *)(v13 + 1500));
v33 = *(float *)(v12 + 68);
v34 = EasedValue != 1.0 || v22 <= a3;
v35 = EasedValue + flt_10063A558[*(float *)(v12 + 72) < 1.0];
if ( v34 )
v35 = EasedValue;
*(float *)(v12 + 68) = v19 * v35;
*(float *)(v12 + 72) = v35;
if ( v31 == 0.0 )
v36 = 0.0;
else
v36 = (float)((float)(v19 * v35) - v33) / v31;
if ( v19 <= 0.0 )
v36 = 1.0;
v40 = v36;
(*(void (__fastcall **)(float32x2_t *__return_ptr))(**(_QWORD **)(v12 + 16) + 1344LL))(&v42);
(*(void (__fastcall **)(float32x2_t *__return_ptr))(**(_QWORD **)(v12 + 8) + 1344LL))(&v41);
sub_1000229F0(&v42, &v41, (float32x2_t *)&v44);
if ( *(_BYTE *)(v13 + 1525) == 1 )
{
v37 = v31 / v19;
if ( v19 <= 0.0 )
v37 = 1.0;
v38 = v37 * *(float *)(v13 + 1532);
cocos2d::ccpNormalize((const cocos2d::CCPoint *)&v44);
sub_100022A14(&v41, &v42, v38);
sub_1000229D0(&v44, (double *)&v42);
}
v39 = vcvtq_f64_f32(vmul_n_f32((float32x2_t)v44, v40));
*(float64x2_t *)&TempGroupCommand->m_currentYOffset = vaddq_f64(
*(float64x2_t *)&TempGroupCommand->m_currentYOffset,
v39);
*(float64x2_t *)&TempGroupCommand->m_currentRotateOrTransformValue = vaddq_f64(
*(float64x2_t *)&TempGroupCommand->m_currentRotateOrTransformValue,
v39);
}
}
else
{
if ( v4 )
{
v23 = (GroupCommandObject2 *)v43;
*(&v43->m_unk071 + 1) = 1;
GroupCommandObject2::stepTransformCommand(v23, 0.0, 0, 1);
}
else
{
TempGroupCommand->m_lockedInY = 1;
}
if ( *(_BYTE *)(v12 + 78) != 1 )
{
v24 = v7[1];
v25 = *v7 + 96 * v10;
*(_QWORD *)&a2 = v25 + 96;
v26 = v24 - (v25 + 96);
if ( v24 != v25 + 96 )
memmove((void *)(*v7 + 96 * v10), *(const void **)&a2, v26 - 4);
v7[1] = v25 + v26;
goto LABEL_27;
}
*(_BYTE *)(v12 + 79) = 0;
}
++v11;
LABEL_27:
v9 = *v7;
v8 = v7[1];
goto LABEL_28;
}
}