//
// PlayLayer::playEndAnimationToPos from 0x14050a2a0 to 0x14050a7ad (1293 bytes)
//
// 4 xrefs:
// > PlayLayer::checkForEnd @ 0x14051400d
// > ??> @ 0x1408d65dc
// > ??> @ 0x1408d65ec
// > ??> @ 0x14092a914
//
// This function is hookable on this platform (idp: pc, 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:33:28 +0000
//
struct cocos2d::CCAction *__fastcall PlayLayer::playEndAnimationToPos(__int64 a1, float *a2)
{
struct cocos2d::CCAction *result; // rax
float v5; // xmm0_4
__int64 v6; // rax
__int64 v7; // rax
__int64 v8; // rax
_DWORD *v9; // rax
int v10; // esi
int v11; // r15d
__int64 v12; // rax
cocos2d::CCNode *v13; // rbx
void **v14; // rcx
__int64 v15; // rax
float v16; // xmm6_4
const struct cocos2d::CCPoint *v17; // rax
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rax
__int64 v21; // rax
struct cocos2d::CCActionInterval *v22; // rax
struct cocos2d::CCEaseIn *v23; // rax
struct cocos2d::CCFiniteTimeAction *v24; // r14
__int64 v25; // rax
struct cocos2d::CCAction *v26; // rdx
struct cocos2d::CCActionInterval *v27; // rax
struct cocos2d::CCAction *v28; // rax
int v29; // [rsp+28h] [rbp-E0h]
_BYTE v30[8]; // [rsp+48h] [rbp-C0h] BYREF
_BYTE v31[8]; // [rsp+50h] [rbp-B8h] BYREF
_BYTE v32[8]; // [rsp+58h] [rbp-B0h] BYREF
_BYTE v33[8]; // [rsp+60h] [rbp-A8h] BYREF
_BYTE v34[8]; // [rsp+68h] [rbp-A0h] BYREF
_BYTE v35[8]; // [rsp+70h] [rbp-98h] BYREF
__int128 v36; // [rsp+78h] [rbp-90h] BYREF
__int64 v37; // [rsp+88h] [rbp-80h]
__int64 v38; // [rsp+90h] [rbp-78h]
__int64 v39; // [rsp+98h] [rbp-70h]
_UNKNOWN *retaddr; // [rsp+180h] [rbp+78h] BYREF
int v41; // [rsp+188h] [rbp+80h] BYREF
float v42; // [rsp+18Ch] [rbp+84h]
float v43; // [rsp+198h] [rbp+90h] BYREF
float v44; // [rsp+19Ch] [rbp+94h]
char v45; // [rsp+1A0h] [rbp+98h] BYREF
result = (struct cocos2d::CCAction *)&retaddr;
if ( !*(_BYTE *)(a1 + 13936) )
{
v5 = *(float *)(a1 + 484);
*(_BYTE *)(a1 + 13936) = 1;
if ( v5 != 0.0 )
{
v6 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v6, &v43);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v45,
(float)(v43 * 0.5) / *(float *)(a1 + 424),
(float)(v44 * 0.5) / *(float *)(a1 + 424));
cocos2d::CCPoint::operator+(a1 + 1292, &v41, v7);
cocos2d::CCPoint::operator-(&v41, &v45, a1 + 432);
cocos2d::CCPoint::operator=(&v41, &v45);
a2[1] = v42;
}
v8 = *(_QWORD *)a1;
*(_BYTE *)(a1 + 2214) = 1;
(*(void (__fastcall **)(__int64))(v8 + 1312))(a1);
*(_DWORD *)(a1 + 440) = *(_DWORD *)(a1 + 432);
v41 = 15;
sub_140355080((_QWORD *)(a1 + 1064), (unsigned __int8 *)&v41);
*(_DWORD *)(a1 + 432) = *(_DWORD *)(a1 + 440);
*(_DWORD *)(a1 + 444) = *(_DWORD *)(a1 + 436);
v41 = 16;
sub_140355080((_QWORD *)(a1 + 1064), (unsigned __int8 *)&v41);
*(_DWORD *)(a1 + 436) = *(_DWORD *)(a1 + 444);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v41, (const struct cocos2d::CCPoint *)a2);
LOBYTE(v29) = 0;
GJBaseGameLayer::updateStaticCameraPos(a1, v9, 0, 1, v29, 1.2, 1, 1072064102);
v10 = 0;
v11 = (*(_BYTE *)(a1 + 1058) != 0) + 1;
do
{
v12 = 3512;
if ( v10 )
v12 = 3520;
v13 = *(cocos2d::CCNode **)(v12 + a1);
PlayerObject::lockPlayer((__int64)v13);
if ( *((_BYTE *)v13 + 2502) )
{
v14 = *((void ***)v13 + 278);
v37 = 112;
v38 = 9;
*((_QWORD *)&v36 + 1) = 0x6F6F6C5F6C6C6166LL;
v39 = 15;
CCAnimatedSprite::tweenToAnimation(v14, (void **)&v36 + 1, 0.40000001);
}
PlayerObject::toggleGhostEffect((__int64)v13, 1);
v15 = *(_QWORD *)(a1 + 13088);
if ( v15 && *(_BYTE *)(v15 + 1368) )
v16 = -1.0;
else
v16 = 1.0;
v17 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(cocos2d::CCNode *))(*(_QWORD *)v13 + 200LL))(v13);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v41, v17);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, v16 * 50.0, 0.0);
cocos2d::CCPoint::operator+(a2, &v43, v18);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v34);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v35);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v36);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v31, *(float *)&v41, v42);
cocos2d::CCPoint::operator=(v35, v19);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32, (float)(v16 * 40.0) + *(float *)&v41, v44 + 150.0);
cocos2d::CCPoint::operator=(&v36, v20);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, v43, v44 - 20.0);
cocos2d::CCPoint::operator=(v34, v21);
v22 = cocos2d::CCBezierTo::create(1.0, (const struct cocos2d::_ccBezierConfig *)v34);
v23 = cocos2d::CCEaseIn::create(v22, 1.2);
v24 = v23;
if ( v10 )
{
v26 = v23;
}
else
{
v25 = cocos2d::CCCallFunc::create(a1, PlayLayer::levelComplete);
v26 = cocos2d::CCSequence::create(v24, v25, 0);
}
cocos2d::CCNode::runAction(v13, v26);
v27 = cocos2d::CCRotateBy::create(1.0, 360.0);
v28 = cocos2d::CCEaseIn::create(v27, 1.5);
result = cocos2d::CCNode::runAction(v13, v28);
++v10;
}
while ( v10 < v11 );
}
return result;
}