//
// GJBaseGameLayer::playExitDualEffect from 0x58f324 to 0x58f668 (836 bytes)
//
// 2 xrefs:
// > PlayLayer::destroyPlayer @ 0x405a08
// > GJBaseGameLayer::toggleDualMode @ 0x5b9122
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:53:04 +0000
//
int __fastcall GJBaseGameLayer::playExitDualEffect(GJBaseGameLayer *this, PlayerObject *a2)
{
int v4; // r0
int v5; // r1
cocos2d::CCSprite *v6; // r0
SimplePlayer *v7; // r4
int v8; // r0
int v9; // r2
int v10; // r1
int v11; // r3
int v12; // r0
int v13; // r1
int v14; // r0
int v15; // r1
int v16; // r3
int v17; // r0
int v18; // r1
int v19; // r3
int v20; // r0
int v21; // r1
int v22; // r3
int v23; // r0
int v24; // r1
int v25; // r3
int v26; // r0
int v27; // r1
int v28; // r3
void (__fastcall *v29)(SimplePlayer *, _DWORD); // r6
float v30; // r0
void (__fastcall *v31)(SimplePlayer *, _DWORD); // r6
float v32; // r0
const cocos2d::CCPoint *v33; // r0
float v34; // s17
int v35; // s16
void (__fastcall *v36)(SimplePlayer *, unsigned int); // r6
int v37; // r0
void (__fastcall *v38)(SimplePlayer *, int); // r6
int v39; // r0
int SecondColor; // r0
void (__fastcall *v41)(SimplePlayer *, _DWORD *); // r10
float v42; // r1
int v43; // r10
const cocos2d::CCPoint *v44; // r2
cocos2d::CCAction *v45; // r10
int v46; // r1
float v47; // r3
float v48; // r2
float v49; // r2
cocos2d::CCAction *v50; // r9
cocos2d::CCFiniteTimeAction *v51; // r0
cocos2d::CCAction *v52; // r6
char v53; // r10
char v54; // r5
CCCircleWave *v55; // r0
int v56; // r3
CCCircleWave *v57; // r6
cocos2d::CCSequence *v59; // [sp+0h] [bp-34h]
cocos2d::CCSequence *v60; // [sp+0h] [bp-34h]
cocos2d::CCAction *v61; // [sp+4h] [bp-30h]
_BYTE v62[8]; // [sp+Ch] [bp-28h] BYREF
_BYTE v63[8]; // [sp+14h] [bp-20h] BYREF
_BYTE v64[8]; // [sp+1Ch] [bp-18h] BYREF
_DWORD v65[2]; // [sp+24h] [bp-10h] BYREF
v4 = GameManager::sharedState(this);
v6 = SimplePlayer::create((SimplePlayer *)(*(_DWORD *)(v4 + 516) - *(_DWORD *)(v4 + 520)), v5);
v7 = v6;
if ( *((_BYTE *)a2 + 1955) )
{
v8 = GameManager::sharedState(v6);
v9 = 2;
v10 = *(_DWORD *)(v8 + 540);
v11 = *(_DWORD *)(v8 + 544);
v12 = (int)v7;
v13 = v10 - v11;
}
else if ( *((_BYTE *)a2 + 1953) )
{
v14 = GameManager::sharedState(v6);
v9 = 1;
v15 = *(_DWORD *)(v14 + 528);
v16 = *(_DWORD *)(v14 + 532);
v12 = (int)v7;
v13 = v15 - v16;
}
else if ( *((_BYTE *)a2 + 1954) )
{
v17 = GameManager::sharedState(v6);
v9 = 3;
v18 = *(_DWORD *)(v17 + 552);
v19 = *(_DWORD *)(v17 + 556);
v12 = (int)v7;
v13 = v18 - v19;
}
else if ( *((_BYTE *)a2 + 1956) )
{
v20 = GameManager::sharedState(v6);
v9 = 4;
v21 = *(_DWORD *)(v20 + 564);
v22 = *(_DWORD *)(v20 + 568);
v12 = (int)v7;
v13 = v21 - v22;
}
else if ( *((_BYTE *)a2 + 1957) )
{
v23 = GameManager::sharedState(v6);
v9 = 5;
v24 = *(_DWORD *)(v23 + 576);
v25 = *(_DWORD *)(v23 + 580);
v12 = (int)v7;
v13 = v24 - v25;
}
else
{
if ( !*((_BYTE *)a2 + 1958) )
goto LABEL_14;
v26 = GameManager::sharedState(v6);
v9 = 6;
v27 = *(_DWORD *)(v26 + 588);
v28 = *(_DWORD *)(v26 + 592);
v12 = (int)v7;
v13 = v27 - v28;
}
SimplePlayer::updatePlayerFrame(v12, v13, v9);
LABEL_14:
v29 = *(void (__fastcall **)(SimplePlayer *, _DWORD))(*(_DWORD *)v7 + 64);
v30 = COERCE_FLOAT((*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)a2 + 68))(a2));
v29(v7, v30 * *((float *)this + 82));
v31 = *(void (__fastcall **)(SimplePlayer *, _DWORD))(*(_DWORD *)v7 + 72);
v32 = COERCE_FLOAT((*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)a2 + 76))(a2));
v31(v7, v32 * *((float *)this + 82));
v33 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)a2 + 96))(a2);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, v33);
v34 = COERCE_FLOAT((*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)a2 + 184))(a2));
if ( *((_BYTE *)this + 856) )
{
v34 = -v34;
v35 = -1;
v36 = *(void (__fastcall **)(SimplePlayer *, unsigned int))(*(_DWORD *)v7 + 64);
v37 = (*(int (__fastcall **)(SimplePlayer *))(*(_DWORD *)v7 + 68))(v7);
v36(v7, v37 ^ 0x80000000);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v64, 150.0, 0.0);
cocos2d::CCPoint::operator+(v65, v62, v64);
cocos2d::CCPoint::operator=(v62, v65);
}
else
{
v35 = 1;
}
(*(void (__fastcall **)(GJBaseGameLayer *, SimplePlayer *, int))(*(_DWORD *)this + 232))(this, v7, 100);
v38 = *(void (__fastcall **)(SimplePlayer *, int))(*(_DWORD *)v7 + 480);
v39 = (*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)a2 + 472))(a2);
v38(v7, v39);
SecondColor = PlayerObject::getSecondColor(a2);
LOWORD(v65[0]) = SecondColor;
BYTE2(v65[0]) = BYTE2(SecondColor);
SimplePlayer::setSecondColor(v7);
SimplePlayer::updateColors(v7);
cocos2d::CCPoint::operator-(v63, v62, (char *)this + 848);
v41 = *(void (__fastcall **)(SimplePlayer *, _DWORD *))(*(_DWORD *)v7 + 92);
cocos2d::CCPoint::operator*(v65, v63, *((_DWORD *)this + 82));
v41(v7, v65);
(*(void (__fastcall **)(SimplePlayer *, float))(*(_DWORD *)v7 + 180))(v7, COERCE_FLOAT(LODWORD(v34)));
v61 = (cocos2d::CCAction *)cocos2d::CCFadeOut::create((cocos2d::CCFadeOut *)0x3ECCCCCD, v42);
v43 = (*(int (__fastcall **)(SimplePlayer *))(*(_DWORD *)v7 + 96))(v7);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v64, (float)v35 * -124.63, 0.0);
cocos2d::CCPoint::operator+(v65, v43, v64);
v45 = (cocos2d::CCAction *)cocos2d::CCMoveTo::create((cocos2d::CCMoveTo *)0x3ECCCCCD, COERCE_FLOAT(v65), v44);
if ( COERCE_FLOAT((*(int (__fastcall **)(SimplePlayer *))(*(_DWORD *)v7 + 68))(v7)) > 0.0 )
v46 = 1036831949;
else
v46 = -1110651699;
v59 = (cocos2d::CCSequence *)v46;
if ( COERCE_FLOAT((*(int (__fastcall **)(SimplePlayer *))(*(_DWORD *)v7 + 76))(v7)) > 0.0 )
v48 = 0.1;
else
v48 = -0.1;
v60 = (cocos2d::CCSequence *)cocos2d::CCScaleTo::create((cocos2d::CCScaleTo *)0x3ECCCCCD, *(float *)&v59, v48, v47);
v50 = (cocos2d::CCAction *)cocos2d::CCRotateBy::create((cocos2d::CCRotateBy *)0x3ECCCCCD, 180.0, v49);
v65[0] = 268;
v65[1] = 1;
v51 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(v7, 268, 1);
v52 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v60, v51, 0);
cocos2d::CCNode::runAction(v7, v61);
cocos2d::CCNode::runAction(v7, v45);
cocos2d::CCNode::runAction(v7, v52);
cocos2d::CCNode::runAction(v7, v50);
v53 = *((_BYTE *)a2 + 2106);
LOBYTE(v50) = *((_BYTE *)a2 + 2107);
v54 = *((_BYTE *)a2 + 2108);
v55 = CCCircleWave::create(
(CCCircleWave *)0x41200000,
1106247680,
(cocos2d::CCActionTween *)0x3ECCCCCD,
0.0,
(bool)v60);
v56 = *(_DWORD *)v55;
v57 = v55;
*((_BYTE *)v55 + 280) = v53;
*((_BYTE *)v55 + 281) = (_BYTE)v50;
*((_BYTE *)v55 + 282) = v54;
(*(void (__fastcall **)(CCCircleWave *, _BYTE *))(v56 + 92))(v55, v63);
(*(void (__fastcall **)(GJBaseGameLayer *, CCCircleWave *, _DWORD))(*(_DWORD *)this + 232))(this, v57, 0);
*((_DWORD *)v57 + 73) = 1;
return CCCircleWave::followObject(v57, v7, 0);
}