//
// GJBaseGameLayer::processTransformActions from 0x9c03b0 to 0x9c0eec (2876 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::processMoveActionsStep @ 0x9ebb48
// > ??> @ 0xb5090
//
// This function is hookable on this platform (idp: arm, 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:58:29 +0000
//
__int64 __fastcall GJBaseGameLayer::processTransformActions(GJBaseGameLayer *this, unsigned __int8 a2)
{
const cocos2d::CCPoint *v3; // x0
__int64 v4; // x19
signed __int64 v5; // x0
char *v7; // x0
const void *v8; // x1
signed __int64 v9; // x2
double **v10; // x19
char *v11; // x21
double **v12; // x28
int v13; // w19
double *v14; // x0
double *v15; // x25
double v16; // d11
double v17; // d14
int v18; // w24
double v19; // x21
double v20; // d15
GameObject *MainObject; // x26
cocos2d::CCObject *StaticGroup; // x19
double v23; // d9
double v24; // d1
double v25; // d8
double v26; // d12
double v27; // d13
double v28; // d8
float v29; // s0
float v30; // s0
float v31; // s0
float v32; // s0
float v33; // s0
float v34; // s0
float v35; // s0
float v36; // s0
unsigned int *v37; // x1
__int64 *v38; // x23
__int64 v39; // x19
float v40; // s8
int v41; // w0
double v42; // d11
double v43; // d11
double v44; // d12
int v45; // w0
float v46; // s1
float v47; // s0
float v48; // s0
float v49; // s1
__int64 v50; // x24
float v51; // s0
void (__fastcall *v52)(__int64, _QWORD *); // x27
float v53; // s1
float v54; // s9
float v55; // s8
double v56; // d11
double v57; // d12
float v58; // s13
float v59; // s14
float v60; // s11
float v61; // s12
double v62; // d15
float v63; // s0
__int64 v64; // x1
double v65; // d14
float v66; // s8
double v67; // d13
float v68; // s1
float v69; // s8
unsigned int *v70; // x1
__int64 *v71; // x21
__int64 v72; // x0
char *v73; // x22
__int64 i; // x19
float v75; // s0
float v76; // s0
int v77; // [xsp+B0h] [xbp+B0h]
float v78; // [xsp+B4h] [xbp+B4h]
void *v79; // [xsp+B8h] [xbp+B8h]
void *v80; // [xsp+C0h] [xbp+C0h]
char *v81; // [xsp+C0h] [xbp+C0h]
float v82; // [xsp+C8h] [xbp+C8h]
int v83; // [xsp+CCh] [xbp+CCh]
cocos2d::CCObject *OptimizedGroup; // [xsp+D0h] [xbp+D0h]
__int64 *v85; // [xsp+D8h] [xbp+D8h]
float v86; // [xsp+E0h] [xbp+E0h]
char v87; // [xsp+E8h] [xbp+E8h]
unsigned int v88; // [xsp+ECh] [xbp+ECh]
float v89; // [xsp+F0h] [xbp+F0h] BYREF
float v90; // [xsp+F4h] [xbp+F4h] BYREF
char v91[8]; // [xsp+F8h] [xbp+F8h] BYREF
_DWORD v92[2]; // [xsp+100h] [xbp+100h] BYREF
float v93[2]; // [xsp+108h] [xbp+108h] BYREF
__int64 v94[3]; // [xsp+110h] [xbp+110h] BYREF
_QWORD v95[3]; // [xsp+128h] [xbp+128h] BYREF
_QWORD v96[3]; // [xsp+140h] [xbp+140h] BYREF
__int64 v97; // [xsp+158h] [xbp+158h] BYREF
float v98; // [xsp+160h] [xbp+160h]
float v99; // [xsp+164h] [xbp+164h]
float v100; // [xsp+168h] [xbp+168h]
float v101; // [xsp+16Ch] [xbp+16Ch]
_QWORD v102[3]; // [xsp+170h] [xbp+170h] BYREF
v77 = a2;
v80 = nullptr;
v82 = (*(float (__fastcall **)(_QWORD))(**((_QWORD **)this + 490) + 136LL))(*((_QWORD *)this + 490));
v78 = (*(float (__fastcall **)(_QWORD))(**((_QWORD **)this + 490) + 152LL))(*((_QWORD *)this + 490));
v3 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 490) + 192LL))(*((_QWORD *)this + 490));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v91, v3);
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 490) + 160LL))(*((_QWORD *)this + 490), 1.0);
(*(void (__fastcall **)(_QWORD, void *))(**((_QWORD **)this + 490) + 184LL))(*((_QWORD *)this + 490), &unk_155D2C8);
v4 = *((_QWORD *)this + 269);
v5 = *(_QWORD *)(v4 + 1368) - *(_QWORD *)(v4 + 1360);
if ( !(v5 >> 3) )
goto LABEL_2;
if ( (unsigned __int64)(v5 >> 3) > 0x1FFFFFFFFFFFFFFFLL )
sub_62D87C();
v7 = (char *)operator new(v5);
v79 = v7;
v8 = *(const void **)(v4 + 1360);
v80 = v7;
v9 = *(_QWORD *)(v4 + 1368) - (_QWORD)v8;
if ( v9 > 7 )
{
v10 = (double **)v7;
v11 = &v7[v9];
v81 = &v7[v9];
memcpy(v7, v8, v9);
if ( v10 != (double **)v11 )
{
v12 = v10;
while ( 1 )
{
MainObject = (GameObject *)GJBaseGameLayer::tryGetMainObject(
(cocos2d::CCDictionary **)this,
*((_DWORD *)*v12 + 11));
StaticGroup = GJBaseGameLayer::getStaticGroup(this, *((_DWORD *)*v12 + 10));
OptimizedGroup = GJBaseGameLayer::getOptimizedGroup(this, *((_DWORD *)*v12 + 10));
if ( (unsigned int)cocos2d::CCArray::count(StaticGroup) )
{
OptimizedGroup = GJBaseGameLayer::getGroup(this, *((_DWORD *)*v12 + 10));
v13 = 0;
}
else
{
v13 = 1;
}
*((_DWORD *)this + 3436) += cocos2d::CCArray::count(OptimizedGroup);
v14 = *v12;
v15 = *v12;
if ( v13 )
{
v16 = v14[21];
v17 = v14[35];
}
else
{
v16 = v14[20];
v17 = v14[34];
}
v87 = *((_BYTE *)v15 + 114);
v88 = *((unsigned __int8 *)v15 + 288);
v18 = *((unsigned __int8 *)v15 + 290);
v19 = v15[32];
v20 = v15[33];
if ( v87 )
break;
if ( v16 != v17 )
{
v83 = v77 | *((unsigned __int8 *)v15 + 512);
goto LABEL_19;
}
LABEL_15:
if ( v81 == (char *)++v12 )
goto LABEL_3;
}
v83 = 1;
LABEL_19:
v23 = v15[37];
v24 = v15[30] - 1.0;
v25 = v15[31] - 1.0;
v26 = v16 * v24 + 1.0;
v27 = v16 * v25 + 1.0;
if ( v23 == 0.0 )
{
v23 = v24 * v17 + 1.0;
v28 = v25 * v17 + 1.0;
}
else
{
v28 = v15[38];
}
if ( fabs(v23) < 0.01 )
{
if ( v23 < 0.0 )
v23 = -0.01;
else
v23 = 0.01;
}
if ( fabs(v26) < 0.01 )
{
if ( v26 < 0.0 )
v26 = -0.01;
else
v26 = 0.01;
}
if ( fabs(v28) < 0.01 )
{
if ( v28 < 0.0 )
v28 = -0.01;
else
v28 = 0.01;
}
if ( fabs(v27) < 0.01 )
{
if ( v27 < 0.0 )
v27 = -0.01;
else
v27 = 0.01;
}
if ( !MainObject )
{
if ( (OptimizedGroup != nullptr) > v88 )
{
v70 = *((unsigned int **)OptimizedGroup + 7);
if ( *v70 )
{
v71 = *((__int64 **)v70 + 2);
v72 = 8LL * *v70 - 8;
v73 = (char *)v71 + v72;
if ( v71 <= (__int64 *)((char *)v71 + v72) )
{
for ( i = *v71; *v71; i = *v71 )
{
if ( !*(_BYTE *)(i + 1290) && *(_DWORD *)(i + 1244) != *((_DWORD *)this + 236) )
{
*(_QWORD *)(i + 988) = *(_QWORD *)(i + 1152);
*(_DWORD *)(i + 1244) = *((_DWORD *)this + 236);
GameObject::dirtifyObjectRect(i);
}
*(_BYTE *)(i + 840) = 1;
v75 = -(*(float *)(i + 1152) - *(float *)(i + 1152) * (v26 / v23));
GameObject::addToCustomScaleX(i, v75);
v76 = -(*(float *)(i + 1156) - *(float *)(i + 1156) * (v27 / v28));
GameObject::addToCustomScaleY(i, v76);
if ( v83 )
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)i + 1456LL))(i, 1.0);
if ( v73 < (char *)++v71 )
break;
}
}
}
}
goto LABEL_15;
}
GameObject::getUnmodifiedPosition(MainObject, (cocos2d::CCPoint *)v92);
if ( v18 )
v86 = (*(float (__fastcall **)(GameObject *))(*(_QWORD *)MainObject + 384LL))(MainObject) + 0.0;
else
v86 = 0.0;
v89 = 0.0;
v90 = 0.0;
GJBaseGameLayer::claimRotationAction(this, *((_DWORD *)*v12 + 10), *((_DWORD *)*v12 + 11), &v89, &v90, v13);
GJBaseGameLayer::claimMoveAction(this, *((_DWORD *)*v12 + 10), v13, (cocos2d::CCPoint *)v93);
(*(void (__fastcall **)(_QWORD, _DWORD *))(**((_QWORD **)this + 255) + 184LL))(*((_QWORD *)this + 255), v92);
v29 = v26;
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 255) + 128LL))(*((_QWORD *)this + 255), v29);
v30 = v27;
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 255) + 144LL))(*((_QWORD *)this + 255), v30);
v31 = 1.0 / v23;
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 257) + 128LL))(*((_QWORD *)this + 257), v31);
v32 = 1.0 / v28;
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 257) + 144LL))(*((_QWORD *)this + 257), v32);
v33 = v16 * v19;
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 255) + 264LL))(*((_QWORD *)this + 255), v33);
v34 = v16 * v20;
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 255) + 280LL))(*((_QWORD *)this + 255), v34);
v35 = -v19 * v17;
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 256) + 264LL))(*((_QWORD *)this + 256), v35);
v36 = -v20 * v17;
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 256) + 280LL))(*((_QWORD *)this + 256), v36);
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 255) + 360LL))(*((_QWORD *)this + 255), v86 + v89);
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 258) + 360LL))(*((_QWORD *)this + 258), -v86);
GJBaseGameLayer::prepareTransformParent((cocos2d::CCObject **)this, 1u);
(*(void (__fastcall **)(__int64 *__return_ptr, _QWORD))(**((_QWORD **)this + 255) + 824LL))(
v94,
*((_QWORD *)this + 255));
(*(void (__fastcall **)(__int64 *__return_ptr, _QWORD))(**((_QWORD **)this + 256) + 824LL))(
&v97,
*((_QWORD *)this + 256));
(*(void (__fastcall **)(_QWORD *__return_ptr, _QWORD))(**((_QWORD **)this + 257) + 824LL))(
v102,
*((_QWORD *)this + 257));
(*(void (__fastcall **)(_QWORD *__return_ptr, _QWORD))(**((_QWORD **)this + 258) + 824LL))(
v95,
*((_QWORD *)this + 258));
v96[2] = v95[2];
v96[0] = v95[0];
v96[1] = v95[1];
if ( !OptimizedGroup
|| (v37 = *((unsigned int **)OptimizedGroup + 7), !*v37)
|| (v38 = *((__int64 **)v37 + 2), v85 = &v38[*v37 - 1], v38 > v85) )
{
LABEL_63:
(*(void (__fastcall **)(GJBaseGameLayer *, cocos2d::CCObject *))(*(_QWORD *)this + 1376LL))(
this,
OptimizedGroup);
goto LABEL_15;
}
while ( 1 )
{
v39 = *v38;
if ( !*v38 )
goto LABEL_63;
v40 = *(float *)(v39 + 672);
v41 = *(unsigned __int8 *)(v39 + 1290);
v42 = *(float *)(v39 + 668);
*(_BYTE *)(v39 + 1291) = v87;
v43 = *(double *)(v39 + 944) - v42;
v44 = *(double *)(v39 + 952) - v40;
if ( !v41 )
{
v45 = *((_DWORD *)this + 236);
if ( *(_DWORD *)(v39 + 1244) != v45 )
{
*(_QWORD *)(v39 + 988) = *(_QWORD *)(v39 + 1152);
*(_DWORD *)(v39 + 1244) = *((_DWORD *)this + 236);
GameObject::dirtifyObjectRect(v39);
v45 = *((_DWORD *)this + 236);
}
if ( *(_DWORD *)(v39 + 1236) != v45 )
{
v46 = *(double *)(v39 + 944);
v47 = *(double *)(v39 + 952);
*(float *)(v39 + 1224) = v46;
*(float *)(v39 + 1228) = v47;
*(_DWORD *)(v39 + 1236) = *((_DWORD *)this + 236);
GameObject::dirtifyObjectRect(v39);
}
}
v48 = *(float *)v92;
v49 = *(float *)&v92[1];
*(_BYTE *)(v39 + 840) = 1;
*(_BYTE *)(v39 + 842) = 1;
v50 = *((_QWORD *)this + 259);
v51 = v43 - v48;
v52 = *(void (__fastcall **)(__int64, _QWORD *))(*(_QWORD *)v50 + 184LL);
v53 = v44 - v49;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v102, v51, v53);
v52(v50, v102);
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 259) + 128LL))(
*((_QWORD *)this + 259),
*(float *)(v39 + 1152) - *(float *)(v39 + 700));
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 259) + 144LL))(
*((_QWORD *)this + 259),
*(float *)(v39 + 1156) - *(float *)(v39 + 704));
v54 = (float)(*(float *)(v39 + 972) + *(float *)(v39 + 676)) - *(float *)(v39 + 680);
v55 = (float)(*(float *)(v39 + 976) + *(float *)(v39 + 684)) - *(float *)(v39 + 688);
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 259) + 376LL))(*((_QWORD *)this + 259), v54);
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 259) + 392LL))(*((_QWORD *)this + 259), v55);
(*(void (__fastcall **)(_QWORD))(**((_QWORD **)this + 259) + 800LL))(*((_QWORD *)this + 259));
cocos2d::CCAffineTransformConcat(&v97, v102, v96);
v56 = (float)(v100 + v93[0]) - v43 + *(double *)(v39 + 944);
v57 = (float)(v101 + v93[1]) - v44 + *(double *)(v39 + 952);
*(double *)(v39 + 944) = v56;
*(double *)(v39 + 952) = v57;
if ( v56 > 10000000.0 )
break;
if ( v56 >= -10000000.0 )
goto LABEL_41;
*(_QWORD *)(v39 + 944) = 0xC16312D000000000LL;
if ( v57 > 10000000.0 )
{
LABEL_42:
*(_QWORD *)(v39 + 952) = 0x416312D000000000LL;
LABEL_43:
if ( v88 )
goto LABEL_44;
goto LABEL_58;
}
LABEL_56:
if ( v57 >= -10000000.0 )
goto LABEL_43;
*(_QWORD *)(v39 + 952) = 0xC16312D000000000LL;
if ( v88 )
{
LABEL_44:
if ( v90 != 0.0 )
GameObject::fastRotateObject((GameObject *)v39, v90);
goto LABEL_46;
}
LABEL_58:
v58 = *((float *)&v97 + 1);
v59 = *(float *)&v97;
v60 = sqrtf((float)(v58 * v58) + (float)(v59 * v59));
v61 = sqrtf((float)(v99 * v99) + (float)(v98 * v98));
v62 = atan2f(v99, v98) * 57.2957795 + -90.0;
v63 = atan2f(v58, v59);
v64 = *(_QWORD *)v39;
v65 = v55;
*(float *)&v62 = v62;
v66 = v63 * 57.2957795;
v67 = *(float *)(v39 + 684);
v68 = *(float *)(v39 + 676) + (float)-*(float *)&v62 - v54;
*(float *)(v39 + 676) = v68;
v69 = v67 + (float)-v66 - v65;
*(float *)(v39 + 684) = v69;
(*(void (__fastcall **)(__int64, float))(v64 + 1480))(v39, 0.0);
if ( *(_DWORD *)(v39 + 920) != 7 && !*(_BYTE *)(v39 + 744) )
GameObject::calculateOrientedBox((GameObject *)v39);
GameObject::addToCustomScaleX(v39, (float)(v60 - *(float *)(v39 + 1152)) + *(float *)(v39 + 700));
GameObject::addToCustomScaleY(v39, (float)(v61 - *(float *)(v39 + 1156)) + *(float *)(v39 + 704));
if ( v83 )
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v39 + 1456LL))(v39, 1.0);
LABEL_46:
(*(void (__fastcall **)(GJBaseGameLayer *, __int64))(*(_QWORD *)this + 1368LL))(this, v39);
if ( v85 < ++v38 )
goto LABEL_63;
}
*(_QWORD *)(v39 + 944) = 0x416312D000000000LL;
LABEL_41:
if ( v57 > 10000000.0 )
goto LABEL_42;
goto LABEL_56;
}
}
else
{
LABEL_2:
v79 = v80;
}
LABEL_3:
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 490) + 128LL))(*((_QWORD *)this + 490), v82);
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 490) + 144LL))(*((_QWORD *)this + 490), v78);
(*(void (__fastcall **)(_QWORD, char *))(**((_QWORD **)this + 490) + 184LL))(*((_QWORD *)this + 490), v91);
if ( v79 )
operator delete(v79);
return _stack_chk_guard;
}