//
// GJBaseGameLayer::playExitDualEffect from 0x1002857e0 to 0x100285c50 (1136 bytes)
//
// 2 xrefs:
// > PlayLayer::destroyPlayer @ 0x100147c54
// > GJBaseGameLayer::toggleDualMode @ 0x100281ba8
//
// 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 11:01:57 +0000
//
__int64 __fastcall GJBaseGameLayer::playExitDualEffect(float32x2_t *a1, __int64 a2)
{
__int64 v4; // x0
__n128 v5; // q0
__int64 v6; // x0
__int64 v7; // x20
__int64 v8; // x0
__int64 v9; // x1
__int64 v10; // x0
__int64 v11; // x2
__int64 v12; // x0
__int64 v13; // x0
__int64 v14; // x0
__int64 v15; // x0
__int64 v16; // x0
float v17; // s0
float v18; // s0
double *v19; // x0
double v20; // d0
__n128 v21; // q0
float v22; // s8
float v23; // s0
float v24; // s9
__int64 v25; // x0
__int64 SecondColor; // x0
double v27; // d0
float *v28; // x22
float32x2_t *v29; // x23
_OWORD *v30; // x23
float v31; // s9
float v32; // s2
float *v33; // x24
float *v34; // x25
char v35; // w0
__int64 v36; // x1
__int64 v37; // x2
__int64 v38; // x3
__int64 v39; // x4
__int64 v40; // x5
__int64 v41; // x6
__int64 v42; // x7
__int64 v43; // x24
__int16 v44; // w22
char v45; // w23
_QWORD *v46; // x21
float32x2_t v48; // [xsp+10h] [xbp-80h] BYREF
float32x2_t v49; // [xsp+18h] [xbp-78h] BYREF
float32x2_t v50; // [xsp+20h] [xbp-70h] BYREF
float32x2_t v51; // [xsp+28h] [xbp-68h] BYREF
v4 = GameManager::sharedState(a1);
v6 = SimplePlayer::create((unsigned int)(*(_DWORD *)(v4 + 716) - *(_DWORD *)(v4 + 720)), v5);
v7 = v6;
if ( *(_BYTE *)(a2 + 2419) == 1 )
{
v8 = GameManager::sharedState(v6);
v9 = (unsigned int)(*(_DWORD *)(v8 + 740) - *(_DWORD *)(v8 + 744));
v10 = v7;
v11 = 2;
}
else if ( *(_BYTE *)(a2 + 2417) == 1 )
{
v12 = GameManager::sharedState(v6);
v9 = (unsigned int)(*(_DWORD *)(v12 + 728) - *(_DWORD *)(v12 + 732));
v10 = v7;
v11 = 1;
}
else if ( *(_BYTE *)(a2 + 2418) == 1 )
{
v13 = GameManager::sharedState(v6);
v9 = (unsigned int)(*(_DWORD *)(v13 + 752) - *(_DWORD *)(v13 + 756));
v10 = v7;
v11 = 3;
}
else if ( *(_BYTE *)(a2 + 2420) == 1 )
{
v14 = GameManager::sharedState(v6);
v9 = (unsigned int)(*(_DWORD *)(v14 + 764) - *(_DWORD *)(v14 + 768));
v10 = v7;
v11 = 4;
}
else if ( *(_BYTE *)(a2 + 2421) == 1 )
{
v15 = GameManager::sharedState(v6);
v9 = (unsigned int)(*(_DWORD *)(v15 + 776) - *(_DWORD *)(v15 + 780));
v10 = v7;
v11 = 5;
}
else
{
if ( *(_BYTE *)(a2 + 2422) != 1 )
goto LABEL_14;
v16 = GameManager::sharedState(v6);
v9 = (unsigned int)(*(_DWORD *)(v16 + 788) - *(_DWORD *)(v16 + 792));
v10 = v7;
v11 = 6;
}
SimplePlayer::updatePlayerFrame(v10, v9, v11);
LABEL_14:
v17 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 136LL))(a2);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v7 + 128LL))(v7, v17 * a1[53].f32[0]);
v18 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 152LL))(a2);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v7 + 144LL))(v7, v18 * a1[53].f32[0]);
v19 = (double *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2);
v20 = sub_1000262F4(&v51, v19);
v21.n128_f32[0] = (*(float (__fastcall **)(__int64, double))(*(_QWORD *)a2 + 368LL))(a2, v20);
v22 = v21.n128_f32[0];
if ( a1[125].i8[0] == 1 )
{
v22 = -v21.n128_f32[0];
v23 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v7 + 136LL))(v7);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v7 + 128LL))(v7, -v23);
sub_1000262BC((float *)&v49, 150.0, 0.0);
sub_100026318(&v51, &v49, &v50);
v21.n128_f64[0] = sub_10002630C(&v51, (double *)&v50);
v24 = 124.63;
}
else
{
v24 = -124.63;
}
(*(void (__fastcall **)(float32x2_t *, __int64, __int64, __n128))(*(_QWORD *)a1 + 464LL))(a1, v7, 100, v21);
v25 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 944LL))(a2);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v7 + 960LL))(v7, v25);
SecondColor = PlayerObject::getSecondColor(a2);
v50.i16[0] = SecondColor;
v50.i8[2] = BYTE2(SecondColor);
SimplePlayer::setSecondColor(v7, &v50);
SimplePlayer::updateColors(v7);
sub_10002632C(&v51, a1 + 124, &v50);
*(float32x2_t *)&v27 = sub_100026350(&v50, &v49, a1[53].f32[0]);
(*(void (__fastcall **)(__int64, float32x2_t *, double))(*(_QWORD *)v7 + 184LL))(v7, &v49, v27);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v7 + 360LL))(v7, v22);
v28 = cocos2d::CCFadeOut::create(0.4);
v29 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 192LL))(v7);
sub_1000262BC((float *)&v48, v24, 0.0);
sub_100026318(v29, &v48, &v49);
v30 = cocos2d::CCMoveTo::create((double *)&v49, 0.4);
if ( (*(float (__fastcall **)(__int64))(*(_QWORD *)v7 + 136LL))(v7) <= 0.0 )
v31 = -0.1;
else
v31 = 0.1;
if ( (*(float (__fastcall **)(__int64))(*(_QWORD *)v7 + 152LL))(v7) <= 0.0 )
v32 = -0.1;
else
v32 = 0.1;
v33 = cocos2d::CCScaleTo::create(0.4, v31, v32);
v34 = cocos2d::CCRotateBy::create_1(0.4, 180.0);
v35 = (unsigned __int8)cocos2d::CCCallFunc::create(v7, 536, 1);
v43 = sub_10021D420((__int64)v33, v36, v37, v38, v39, v40, v41, v42, v35);
cocos2d::CCNode::runAction(v7, v28);
cocos2d::CCNode::runAction(v7, v30);
cocos2d::CCNode::runAction(v7, v43);
cocos2d::CCNode::runAction(v7, v34);
v44 = *(_WORD *)(a2 + 2602);
v45 = *(_BYTE *)(a2 + 2604);
v46 = (_QWORD *)CCCircleWave::create_1(0);
*((_BYTE *)v46 + 342) = v45;
*((_WORD *)v46 + 170) = v44;
(*(void (__fastcall **)(_QWORD *, float32x2_t *))(*v46 + 184LL))(v46, &v50);
(*(void (__fastcall **)(float32x2_t *, _QWORD *, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, v46, 0);
*((_DWORD *)v46 + 88) = 1;
return CCCircleWave::followObject(v46, v7, 0);
}