//
// GJBaseGameLayer::processAreaRotateGroupAction from 0x8724c8 to 0x872c4c (1924 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::processAreaEffects @ 0x89c670
// > ??> @ 0x92640
//
// 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 GJBaseGameLayer::processAreaRotateGroupAction(
GJBaseGameLayer *a1,
cocos2d::CCArray *a2,
EnterEffectInstance *a3,
cocos2d::CCPoint a4,
int a5,
int a6,
int a7,
int a8,
int a9,
bool a10,
bool a11)
{
float *v13; // x23
int m_areaRotatedCount; // w0
cocos2d::ccArray *data; // x2
cocos2d::CCObject **arr; // x27
__int64 v17; // x1
char *v18; // x20
cocos2d::CCObject *v19; // x28
int v20; // w25
int v21; // w19
signed int m_commandIndex; // w0
int v23; // w21
long double v24; // q0
EnterEffectObject *m_gameObject; // x2
int m_directionType; // w0
float v27; // s2
float v28; // s1
float m_offsetYVariance; // s3
float v30; // s2
float v31; // s2
bool v32; // nf
_BOOL4 v33; // w1
float m_lengthVariance; // s3
float v35; // s2
float m_deadzone; // s3
float v37; // s1
bool v38; // nf
int v39; // w19
int m_areaRotatedCountTotal; // w1
float v41; // s11
float v42; // s11
int m_nLuaID; // w0
int m_nTag; // w0
float v45; // s0
double v46; // d1
float v47; // s0
double v48; // d1
float v49; // s0
float v50; // s5
unsigned int v51; // s4
unsigned int v52; // s2
int v53; // s0
unsigned int v54; // s1
float v55; // s2
float v56; // s4
float v57; // s1
int v58; // s0
int m_areaObjectsCount; // w1
int m_areaObjectsIndex; // w3
GameObject **m_finish; // x2
float m_offsetVariance; // s4
float x; // s3
float v64; // s2
float v65; // s1
float v66; // s0
float v67; // s0
float m_modFront; // s1
unsigned int m_nZOrder; // w1
double v70; // d1
int v71; // s0
unsigned int v72; // w2
unsigned int m_uReference; // w1
int m_easeIndex; // w3
int *v75; // x6
_BOOL4 v76; // w0
unsigned int v77; // s2
int v78; // s1
int m_nTag_low; // w1
GameObject *TargetGroupOrigin; // [xsp+88h] [xbp+88h]
cocos2d::CCArray *TargetGroup; // [xsp+90h] [xbp+90h]
__int64 v87; // [xsp+B8h] [xbp+B8h]
cocos2d::CCObject *v88; // [xsp+C0h] [xbp+C0h] BYREF
cocos2d::CCPoint v89; // [xsp+C8h] [xbp+C8h] BYREF
cocos2d::CCPoint v90; // [xsp+D0h] [xbp+D0h] BYREF
bool v91; // [xsp+F0h] [xbp+F0h]
v13 = *(float **)&a5;
m_areaRotatedCount = cocos2d::CCArray::count(a2) + a1->m_areaRotatedCount;
a1->m_areaRotatedCount = m_areaRotatedCount;
if ( !a2
|| (data = a2->data, !data->num)
|| (arr = data->arr,
v17 = 8LL * data->num - 8,
v18 = (char *)arr + v17,
arr > (cocos2d::CCObject **)((char *)arr + v17))
|| (v19 = *arr) == nullptr )
{
v39 = 0;
v20 = 0;
goto LABEL_33;
}
v20 = 0;
v21 = 0;
v87 = a10;
do
{
if ( BYTE1(v19[13].m_nZOrder) )
{
m_commandIndex = a1->m_gameState.m_commandIndex;
++v21;
if ( v19[21].m_uOrderOfArrival >= m_commandIndex )
goto LABEL_8;
}
else
{
m_nLuaID = v19[11].m_nLuaID;
if ( m_nLuaID > a7 )
goto LABEL_29;
if ( m_nLuaID < a6 )
goto LABEL_29;
m_nTag = v19[11].m_nTag;
if ( m_nTag > a9 || m_nTag < a8 )
goto LABEL_29;
m_commandIndex = a1->m_gameState.m_commandIndex;
++v21;
if ( v19[21].m_uOrderOfArrival >= m_commandIndex )
{
LABEL_8:
v23 = 0;
goto LABEL_9;
}
}
if ( !BYTE2(v19[22].m_unknown2) )
{
m_nZOrder = v19[21].m_nZOrder;
if ( m_commandIndex != m_nZOrder )
{
v70 = *(double *)&v19[16].m_uIndexInArray;
v19[21].m_nZOrder = m_commandIndex;
*(float *)&v70 = v70;
*(float *)&v71 = *(double *)&v19[16].m_unknown2;
v19[21].m_uIndexInArray = LODWORD(v70);
v19[21].m_uUnknown = v71;
GameObject::dirtifyObjectRect((GameObject *)v19);
m_nZOrder = a1->m_gameState.m_commandIndex;
}
m_commandIndex = m_nZOrder;
if ( v19[21].m_unknown5 != m_nZOrder )
{
v72 = v19[20].m_nTag;
v19[21].m_unknown5 = m_nZOrder;
m_uReference = v19[20].m_uReference;
v19[17].m_uReference = v72;
v19[17].m_uAutoReleaseCount = m_uReference;
GameObject::dirtifyObjectRect((GameObject *)v19);
m_commandIndex = a1->m_gameState.m_commandIndex;
}
}
v45 = *(float *)&v19[11].m_unknown5;
v23 = 0;
if ( v45 != 0.0 )
{
v46 = *(double *)&v19[16].m_uIndexInArray;
BYTE2(v19[14].m_unknown2) = 1;
v23 = 1;
v19[11].m_unknown5 = 0;
*(double *)&v19[16].m_uIndexInArray = v46 - v45;
}
v47 = *(float *)&v19[12].__vftable;
if ( v47 != 0.0 )
{
v48 = *(double *)&v19[16].m_unknown2;
BYTE2(v19[14].m_unknown2) = 1;
v23 = 1;
LODWORD(v19[12].__vftable) = 0;
*(double *)&v19[16].m_unknown2 = v48 - v47;
}
v49 = *(float *)&v19[12].m_eObjType;
v50 = *(float *)&v19[12].m_uIndexInArray;
if ( v49 != 0.0 || v50 != 0.0 )
{
*(float *)&v51 = *(float *)&v19[12].m_uReference - v49;
*(float *)&v52 = *(float *)&v19[12].m_uAutoReleaseCount - v50;
*(float *)&v53 = *(float *)&v19[20].m_nTag - v49;
*(float *)&v54 = *(float *)&v19[20].m_uReference - v50;
v19[12].m_uReference = v51;
v19[12].m_eObjType = 0;
v19[20].m_nTag = v53;
v19[12].m_uAutoReleaseCount = v52;
v19[20].m_uReference = v54;
v19[12].m_uIndexInArray = 0;
}
v55 = *(float *)&v19[12].m_uID;
v56 = *(float *)&v19[12].m_nTag;
if ( v55 != 0.0 || v56 != 0.0 )
{
v57 = *((float *)&v19[12].__vftable + 1) - v55;
*(float *)&v58 = *(float *)&v19[12].m_nLuaID - v56;
v19[12].m_uID = 0;
*((float *)&v19[12].__vftable + 1) = v57;
v19[12].m_nLuaID = v58;
v19[12].m_nTag = 0;
}
m_areaObjectsCount = a1->m_areaObjectsCount;
m_areaObjectsIndex = a1->m_areaObjectsIndex;
v88 = v19;
v19[21].m_uOrderOfArrival = m_commandIndex;
if ( m_areaObjectsIndex > m_areaObjectsCount )
{
a1->m_areaObjects.m_start[m_areaObjectsCount] = (GameObject *)v19;
}
else
{
m_finish = a1->m_areaObjects.m_finish;
if ( m_finish == a1->m_areaObjects.m_reserveEnd )
{
std::vector::_M_emplace_back_aux((__int64)&a1->m_areaObjects, &v88);
m_areaObjectsCount = a1->m_areaObjectsCount;
m_areaObjectsIndex = a1->m_areaObjectsIndex;
}
else
{
if ( m_finish )
{
*m_finish = (GameObject *)v19;
m_finish = a1->m_areaObjects.m_finish;
}
a1->m_areaObjects.m_finish = m_finish + 1;
}
a1->m_areaObjectsIndex = m_areaObjectsIndex + 1;
}
a1->m_areaObjectsCount = m_areaObjectsCount + 1;
LABEL_9:
v19->__vftable[16].getTag(v19);
m_gameObject = a3->m_gameObject;
m_directionType = m_gameObject->m_directionType;
if ( m_directionType == 1 )
{
m_offsetVariance = a3->m_offsetVariance;
x = v89.x;
v64 = *v13;
v65 = 0.0;
v66 = v89.x - *v13;
if ( m_offsetVariance == 0.0 )
goto LABEL_73;
goto LABEL_72;
}
if ( m_directionType == 2 )
{
m_offsetVariance = a3->m_offsetVariance;
x = v89.y;
v64 = v13[1];
v66 = v89.y - v64;
if ( m_offsetVariance == 0.0 )
{
v67 = v66 + 0.0;
if ( v67 < 0.0 )
goto LABEL_80;
goto LABEL_74;
}
LABEL_72:
v65 = m_offsetVariance * a1->m_varianceValues.__elems_[SLOWORD(v19[17].m_uUnknown) + 1];
LABEL_73:
v67 = v66 + v65;
if ( v67 < 0.0 )
{
LABEL_80:
m_modFront = a3->m_modFront;
LABEL_75:
*(float *)&v24 = v67 * m_modFront;
v32 = x < v64;
if ( a3->m_reversed )
{
v33 = x <= v64;
goto LABEL_20;
}
goto LABEL_17;
}
LABEL_74:
m_modFront = a3->m_modBack;
goto LABEL_75;
}
v27 = a3->m_offsetVariance;
v28 = 0.0;
if ( v27 != 0.0 )
v28 = v27 * a1->m_varianceValues.__elems_[SLOWORD(v19[17].m_uUnknown) + 1];
m_offsetYVariance = a3->m_offsetYVariance;
v30 = 0.0;
if ( m_offsetYVariance != 0.0 )
v30 = m_offsetYVariance * *((float *)&a1->m_uID + SLOWORD(v19[17].m_uUnknown) + 1097);
cocos2d::CCPoint::CCPoint(&v90, *v13 + v28, v13[1] + v30);
*(float *)&v24 = cocos2d::ccpDistance(&v89, &v90);
v31 = *v13;
m_gameObject = a3->m_gameObject;
if ( !a3->m_reversed )
{
v33 = v31 <= v89.y;
goto LABEL_20;
}
v32 = v31 < v89.x;
LABEL_17:
v33 = !v32;
LABEL_20:
m_lengthVariance = a3->m_lengthVariance;
v35 = 0.0;
if ( m_lengthVariance != 0.0 )
v35 = m_lengthVariance * a1->m_varianceValues.__elems_[SLOWORD(v19[17].m_uUnknown)];
m_deadzone = a3->m_deadzone;
v37 = (float)(int)(float)(a3->m_length + v35);
if ( m_deadzone == 0.0 )
{
*(float *)&v24 = *(float *)&v24 / v37;
v38 = *(float *)&v24 < 1.0;
if ( *(float *)&v24 < 1.0 )
goto LABEL_24;
}
else
{
*(float *)&v24 = (float)((float)(*(float *)&v24 / v37) - m_deadzone) / (float)(1.0 - m_deadzone);
v38 = *(float *)&v24 < 1.0;
if ( *(float *)&v24 < 1.0 )
{
LABEL_24:
if ( *(float *)&v24 > 0.0 )
{
if ( m_gameObject->m_inbound )
*(float *)&v24 = 1.0 - *(float *)&v24;
}
else
{
if ( !m_gameObject->m_inbound )
{
LODWORD(v24) = 0;
goto LABEL_35;
}
LODWORD(v24) = 1.0;
}
goto LABEL_27;
}
}
if ( v38 )
{
if ( !m_gameObject->m_inbound )
goto LABEL_35;
*(float *)&v24 = 1.0 - *(float *)&v24;
}
else
{
LODWORD(v24) = 0;
if ( !m_gameObject->m_inbound )
goto LABEL_28;
}
LABEL_27:
if ( *(float *)&v24 >= 1.0 )
goto LABEL_28;
LABEL_35:
v41 = a3->m_rotation + (float)(a3->m_rotationVariance * *(&a1->m_fVertexZ + SLOWORD(v19[17].m_uUnknown) + 1097));
if ( v41 == 0.0 )
{
if ( !a11 )
goto LABEL_28;
v42 = 0.0;
}
else
{
if ( !m_gameObject->m_easeOutEnabled )
goto LABEL_98;
if ( *(float *)&v24 > 0.01 && *(float *)&v24 < 0.99 )
{
m_easeIndex = a3->m_easeIndex;
v75 = &a3->m_easeIndices.m_start[v87];
if ( *v75 == m_easeIndex - 2 )
{
v76 = 0;
v33 = 0;
}
else
{
if ( *v75 == m_easeIndex - 1 )
v33 = 1;
v76 = v33;
}
*v75 = m_easeIndex + v76;
}
if ( v33 )
LABEL_98:
*(float *)&v24 = GJBaseGameLayer::getEnterEasingValue(
a1,
*(float *)&v24,
m_gameObject->m_easingInType,
m_gameObject->m_easingInRate,
m_gameObject->m_easingInBuffer);
else
*(float *)&v24 = GJBaseGameLayer::getEnterEasingValue(
a1,
*(float *)&v24,
m_gameObject->m_easingOutType,
m_gameObject->m_easingOutRate,
m_gameObject->m_easingOutBuffer);
*(float *)&v24 = 1.0 - *(float *)&v24;
v42 = *(float *)&v24 * v41;
if ( !a11 )
{
if ( v42 != 0.0 )
{
*(float *)&v77 = *(float *)&v19[12].m_uID + v42;
*(float *)&v78 = *(float *)&v19[12].m_nLuaID + v42;
*(float *)&v24 = *(float *)&v19[12].m_nTag + v42;
*((float *)&v19[12].__vftable + 1) = *((float *)&v19[12].__vftable + 1) + v42;
v19[12].m_uID = v77;
v19[12].m_nLuaID = v78;
v19[12].m_nTag = LODWORD(v24);
if ( v91 )
((void (__fastcall *)(cocos2d::CCObject *, float))v19->__vftable[18].isEqual)(v19, 0.0);
if ( v19[16].m_uID != 7 )
{
m_nTag_low = LOBYTE(v19[13].m_nTag);
LOBYTE(v19[15].m_uID) = 1;
BYTE1(v19[15].m_uID) = 1;
if ( !m_nTag_low )
GameObject::calculateOrientedBox((GameObject *)v19);
}
}
LABEL_28:
if ( v23 )
goto LABEL_41;
goto LABEL_29;
}
}
TargetGroup = GJBaseGameLayer::getTargetGroup(a1, a3->m_targetGroupIndex, HIDWORD(v19[16].__vftable));
TargetGroupOrigin = (GameObject *)GJBaseGameLayer::getTargetGroupOrigin(
a1,
a3->m_targetGroupIndex,
HIDWORD(v19[16].__vftable));
v20 = v20 - 1 + cocos2d::CCArray::count(TargetGroup);
if ( a3->m_gameObject->m_dontEditAreaParent )
LOBYTE(v19[23].__vftable) = 1;
GJBaseGameLayer::rotateAreaObjects(a1, TargetGroupOrigin, TargetGroup, v42, v91);
LOBYTE(v19[23].__vftable) = 0;
if ( v23 )
LABEL_41:
((void (__fastcall *)(GJBaseGameLayer *, cocos2d::CCObject *, long double))a1->updateObjectSection)(a1, v19, v24);
LABEL_29:
if ( v18 < (char *)++arr )
break;
v19 = *arr;
++v87;
}
while ( *arr );
m_areaRotatedCount = a1->m_areaRotatedCount;
v39 = v21 + v20;
LABEL_33:
m_areaRotatedCountTotal = a1->m_areaRotatedCountTotal;
a1->m_areaRotatedCount = v20 + m_areaRotatedCount;
a1->m_areaRotatedCountTotal = m_areaRotatedCountTotal + v39;
}