//
// GJBaseGameLayer::processAreaFadeGroupAction from 0x9a5048 to 0x9a53cc (900 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::processAreaEffects @ 0x9d71fc
// > ??> @ 0x79c60
//
// 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:09 +0000
//
__int64 __fastcall GJBaseGameLayer::processAreaFadeGroupAction(
__int64 a1,
cocos2d::CCArray *a2,
__int64 a3,
float *a4,
unsigned __int8 a5)
{
float v7; // s9
float v8; // s11
int v10; // w28
unsigned int *v11; // x0
__int64 *v12; // x27
__int64 *v13; // x22
__int64 v14; // x23
int v15; // w19
int v16; // w21
int v17; // w21
int v18; // w0
__int64 v20; // x1
int v21; // w0
float v22; // s2
float v23; // s1
float v24; // s3
float v25; // s2
const cocos2d::CCPoint *v26; // x2
float v27; // s0
float v28; // s2
float v29; // s1
float v30; // s2
int v31; // w0
float v32; // s8
bool v33; // nf
cocos2d::CCArray *TargetGroup; // x23
unsigned int *v35; // x0
__int64 *v36; // x28
__int64 *v37; // x23
__int64 v38; // x0
float v39; // s1
float v40; // s0
float v41; // s8
float v42; // s0
int v44; // [xsp+ACh] [xbp+ACh]
float v45[2]; // [xsp+B8h] [xbp+B8h] BYREF
_BYTE v46[8]; // [xsp+C0h] [xbp+C0h] BYREF
v7 = *(float *)(a3 + 132);
v44 = a5;
v8 = *(float *)(a3 + 128);
v10 = cocos2d::CCArray::count(a2) + *(_DWORD *)(a1 + 13720);
*(_DWORD *)(a1 + 13720) = v10;
if ( !a2
|| (v11 = *((unsigned int **)a2 + 7), !*v11)
|| (v12 = *((__int64 **)v11 + 2), v13 = &v12[*v11 - 1], v12 > v13)
|| (v14 = *v12) == 0 )
{
v17 = 0;
v15 = 0;
goto LABEL_11;
}
v15 = 0;
v16 = 0;
do
{
if ( !*(_BYTE *)(v14 + 773) )
goto LABEL_7;
++v16;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v14 + 1360LL))(v14);
v20 = *(_QWORD *)(a3 + 168);
v21 = *(_DWORD *)(v20 + 1968);
if ( v21 == 1 )
{
v39 = *(float *)(a3 + 36);
v40 = 0.0;
v41 = v45[0] - *a4;
if ( v39 == 0.0 )
goto LABEL_40;
goto LABEL_39;
}
if ( v21 == 2 )
{
v39 = *(float *)(a3 + 36);
v41 = v45[1] - a4[1];
if ( v39 == 0.0 )
{
v42 = v41 + 0.0;
if ( (float)(v41 + 0.0) >= 0.0 )
{
LABEL_41:
v27 = v42 * *(float *)(a3 + 52);
goto LABEL_19;
}
goto LABEL_44;
}
LABEL_39:
v40 = v39 * *(float *)(a1 + 4LL * (*(__int16 *)(v14 + 1004) + 1) + 4108);
LABEL_40:
v42 = v41 + v40;
if ( v42 >= 0.0 )
goto LABEL_41;
LABEL_44:
v27 = v42 * *(float *)(a3 + 48);
goto LABEL_19;
}
v22 = *(float *)(a3 + 36);
v23 = 0.0;
if ( v22 != 0.0 )
v23 = v22 * *(float *)(a1 + 4LL * (*(__int16 *)(v14 + 1004) + 1) + 4108);
v24 = *(float *)(a3 + 44);
v25 = 0.0;
if ( v24 != 0.0 )
v25 = v24 * *(float *)(a1 + 4LL * (*(__int16 *)(v14 + 1004) + 2) + 4108);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v46, *a4 + v23, a4[1] + v25);
cocos2d::ccpDistance((cocos2d *)v45, (const cocos2d::CCPoint *)v46, v26);
v20 = *(_QWORD *)(a3 + 168);
LABEL_19:
v28 = *(float *)(a3 + 28);
v29 = 0.0;
if ( v28 != 0.0 )
v29 = v28 * *(float *)(a1 + 4LL * *(__int16 *)(v14 + 1004) + 4108);
v30 = *(float *)(a3 + 56);
v31 = (int)(float)(*(float *)(a3 + 24) + v29);
if ( v30 == 0.0 )
{
v32 = v27 / (float)v31;
v33 = v32 < 1.0;
if ( v32 >= 1.0 )
goto LABEL_30;
}
else
{
v32 = (float)((float)(v27 / (float)v31) - v30) / (float)(1.0 - v30);
v33 = v32 < 1.0;
if ( v32 >= 1.0 )
{
LABEL_30:
if ( !v33 )
v32 = 1.0;
goto LABEL_25;
}
}
if ( v32 <= 0.0 )
v32 = 0.0;
LABEL_25:
if ( *(_BYTE *)(v20 + 2012) )
v32 = 1.0 - v32;
if ( v44 )
{
TargetGroup = (cocos2d::CCArray *)GJBaseGameLayer::getTargetGroup(
(cocos2d::CCArray **)a1,
*(_DWORD *)(a3 + 200),
*(_DWORD *)(v14 + 916));
v15 = v15 - 1 + cocos2d::CCArray::count(TargetGroup);
if ( TargetGroup )
{
v35 = *((unsigned int **)TargetGroup + 7);
if ( *v35 )
{
v36 = *((__int64 **)v35 + 2);
v37 = &v36[*v35 - 1];
while ( v37 >= v36 )
{
v38 = *v36;
if ( !*v36 )
break;
++v36;
GameObject::setAreaOpacity(v38, v7 + (float)((float)(v8 - v7) * v32), v32, *(_DWORD *)(a1 + 944));
}
}
}
}
else
{
GameObject::setAreaOpacity(v14, v7 + (float)((float)(v8 - v7) * v32), v32, *(_DWORD *)(a1 + 944));
}
LABEL_7:
if ( v13 < ++v12 )
break;
v14 = *v12;
}
while ( *v12 );
v10 = *(_DWORD *)(a1 + 13720);
v17 = v16 + v15;
LABEL_11:
v18 = *(_DWORD *)(a1 + 13736);
*(_DWORD *)(a1 + 13720) = v15 + v10;
*(_DWORD *)(a1 + 13736) = v18 + v17;
return _stack_chk_guard;
}