//
// PlayerObject::update from 0x768dc0 to 0x769a54 (3220 bytes)
//
// 2 xrefs:
// > ??> @ 0xebf90
// > ??> @ 0x14332c8
//
// 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:53:09 +0000
//
__int64 __fastcall PlayerObject::update(PlayerObject *this, float a2)
{
double v4; // d1
double v5; // d0
double v6; // d1
double v7; // d8
void (__fastcall *v8)(PlayerObject *, __int64 *); // x22
float v9; // s0
int v10; // w0
float v11; // s0
unsigned __int64 v12; // x0
double v13; // d8
double v14; // d0
cocos2d *LastPosition; // x21
const cocos2d::CCPoint *v17; // x0
const cocos2d::CCPoint *v18; // x2
__int64 v19; // x0
int v20; // w0
cocos2d::CCDirector *v21; // x0
HardStreak *v22; // x21
__int64 v23; // x0
__int64 v24; // x0
__n128 v25; // q0
__int64 v26; // x0
float v27; // s2
float v28; // s1
cocos2d::CCTextureCache **v29; // x22
void (__fastcall *v30)(cocos2d::CCTextureCache **, __int64); // x23
cocos2d::CCTextureCache *v31; // x24
float v32; // s0
char *v33; // x1
__int64 v34; // x0
__int64 v35; // x0
float v36; // s1
double v37; // x2
double v38; // d1
__int64 v39; // x21
void (__fastcall *v40)(__int64, float); // x22
float v41; // s0
float v42; // s1
float v43; // s0
__int64 v44; // x21
void (__fastcall *v45)(__int64, float); // x22
float v46; // s0
float v47; // s1
float v48; // s0
float v49; // s10
float v50; // s12
double v51; // d10
float v52; // s2
double v53; // d13
double v54; // d10
double v55; // d9
double v56; // d1
double v57; // d0
double v58; // d12
float v59; // s1
int v60; // w0
double v61; // d12
double v62; // d0
double v63; // d10
void (__fastcall *v64)(PlayerObject *, __int64 *); // x23
__int64 v65; // x24
float v66; // s0
double v67; // d0
double v68; // d1
double v69; // d9
cocos2d::CCDirector *v70; // x0
GameManager *WinSize; // x0
HardStreak *v72; // x21
float v73; // s9
float *v74; // x0
float v75; // s10
__int64 v76; // x0
cocos2d::CCScaleTo *v77; // x0
cocos2d::CCHide *v78; // x21
cocos2d::CCFiniteTimeAction *v79; // x0
cocos2d::CCAction *v80; // x21
double v81; // d0
double v82; // d0
cocos2d::CCScaleTo *v83; // x0
cocos2d::CCScaleTo *v84; // x21
__int64 v85; // x0
cocos2d::CCAction *v86; // x0
cocos2d::CCSequence *v87; // x21
cocos2d::CCFiniteTimeAction *v88; // x0
cocos2d::CCAction *v89; // x21
double v90; // d10
double v91; // d0
float v92; // [xsp+70h] [xbp+70h]
cocos2d::CCScaleTo *v93; // [xsp+70h] [xbp+70h]
cocos2d::CCFiniteTimeAction *v94; // [xsp+80h] [xbp+80h]
cocos2d::CCScaleTo *v95; // [xsp+88h] [xbp+88h]
_BYTE v96[8]; // [xsp+90h] [xbp+90h] BYREF
__int64 v97; // [xsp+98h] [xbp+98h] BYREF
__int64 v98[2]; // [xsp+A0h] [xbp+A0h] BYREF
char *v99; // [xsp+B0h] [xbp+B0h]
v4 = *((double *)this + 251);
if ( v4 >= 0.0 )
{
v5 = *((double *)this + 328) - v4;
v6 = *((float *)this + 504);
v7 = v5 - *((float *)this + 505);
if ( v7 >= v6 )
{
v37 = *(double *)this;
*((double *)this + 251) = -1.0;
(*(void (__fastcall **)(PlayerObject *, char *))(*(_QWORD *)&v37 + 960LL))(this, (char *)this + 2354);
PlayerObject::setSecondColor((__int64)this, (PlayerObject *)((char *)this + 2357));
}
else if ( v7 > 0.0 )
{
v8 = *(void (__fastcall **)(PlayerObject *, __int64 *))(*(_QWORD *)this + 960LL);
v9 = v7 / v6;
v10 = GameToolbox::multipliedColorValue(*((_QWORD *)this + 253), *(_QWORD *)((char *)this + 2354), v9);
LOWORD(v97) = v10;
BYTE2(v97) = BYTE2(v10);
v8(this, &v97);
v11 = v7 / *((float *)this + 504);
v12 = GameToolbox::multipliedColorValue(*(_QWORD *)((char *)this + 2027), *(_QWORD *)((char *)this + 2357), v11);
LOWORD(v97) = v12;
BYTE2(v97) = BYTE2(v12);
PlayerObject::setSecondColor((__int64)this, &v97);
}
}
v13 = *((double *)this + 299);
if ( v13 <= 1000.0 )
{
if ( v13 < -1000.0 )
*((_QWORD *)this + 299) = 0xC08F400000000000LL;
}
else
{
*((_QWORD *)this + 299) = 0x408F400000000000LL;
}
if ( *((_BYTE *)this + 2832) )
{
v14 = *((double *)this + 339);
if ( v14 <= 1000.0 )
{
if ( v14 < -1000.0 )
*((_QWORD *)this + 339) = 0xC08F400000000000LL;
}
else
{
*((_QWORD *)this + 339) = 0x408F400000000000LL;
}
}
if ( !*((_BYTE *)this + 2424) )
{
LastPosition = (cocos2d *)GameObject::getLastPosition(this);
v17 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(PlayerObject *))(*(_QWORD *)this + 192LL))(this);
cocos2d::ccpDistance(LastPosition, v17, v18);
v19 = (*(__int64 (__fastcall **)(PlayerObject *))(*(_QWORD *)this + 192LL))(this);
cocos2d::CCPoint::operator=((char *)this + 1224, v19);
v20 = *((unsigned __int8 *)this + 2530);
*((_DWORD *)this + 661) = 0;
if ( v20 )
goto LABEL_17;
v49 = 0.9;
v50 = a2 * 0.9;
PlayerObject::updateJump(this, a2 * 0.9);
if ( *((int *)this + 714) <= 0 )
goto LABEL_104;
if ( *((_BYTE *)this + 2417) )
{
if ( *((float *)this + 618) == 1.0 )
v49 = 0.47;
else
v49 = 0.5875;
}
else if ( *((_BYTE *)this + 2418) )
{
if ( *((float *)this + 618) == 1.0 )
v49 = 0.58;
else
v49 = 0.725;
}
else
{
if ( *((_BYTE *)this + 2428) )
{
v49 = 0.4;
}
else if ( *((_BYTE *)this + 2419) || *((_BYTE *)this + 2422) )
{
v49 = 0.6;
}
else if ( !*((_BYTE *)this + 2421) )
{
v49 = 1.0;
}
if ( *((float *)this + 618) != 1.0 && *((_BYTE *)this + 2428) )
v49 = 0.61538;
}
v51 = (float)((float)(v50 * *((float *)this + 716)) * v49);
PlayerObject::addToYVelocity(this, v51);
if ( v51 != 0.0 )
*((_BYTE *)this + 2314) = 1;
if ( *((_BYTE *)this + 2423) )
{
if ( v51 >= 0.0 )
{
LABEL_97:
if ( !*((_BYTE *)this + 2832) )
{
if ( !*((_BYTE *)this + 2460) )
{
v53 = v50;
v54 = v50 * *((double *)this + 299);
goto LABEL_107;
}
LABEL_146:
PlayerObject::setYVelocity((__int64)this, 0.0);
LABEL_105:
v53 = v50;
v54 = v50 * *((double *)this + 299);
if ( *((_BYTE *)this + 2832) )
PlayerObject::updateMove(this, a2 * 0.9);
LABEL_107:
v55 = a2 * PlayerObject::getCurrentXVelocity(this);
if ( *((_BYTE *)this + 2420) )
{
if ( !*((_BYTE *)this + 2460) )
{
v90 = fabs(v55) * (double)(int)PlayerObject::flipMod(this);
if ( *((_BYTE *)this + 2365) )
v91 = 1.0;
else
v91 = -1.0;
v54 = v90 * v91;
v58 = v55;
if ( *((float *)this + 618) != 1.0 )
v54 = v54 + v54;
goto LABEL_111;
}
}
else
{
v58 = v55;
if ( !*((_BYTE *)this + 2460) )
{
LABEL_111:
v59 = v54;
v60 = *((unsigned __int8 *)this + 2426);
*((float *)this + 661) = v59;
if ( v60 && !*((_BYTE *)this + 2832) )
v58 = -v58;
v61 = v58 + *((double *)this + 306);
if ( *((_BYTE *)this + 2427) )
{
v62 = v54;
v63 = v61;
v61 = v62;
v59 = v63;
}
v92 = v59;
v64 = *(void (__fastcall **)(PlayerObject *, __int64 *))(*(_QWORD *)this + 184LL);
v65 = (*(__int64 (__fastcall **)(PlayerObject *))(*(_QWORD *)this + 192LL))(this);
v66 = v61;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v96, v66, v92);
cocos2d::CCPoint::operator+(&v97, v65);
v64(this, &v97);
v67 = *((double *)this + 305);
*((_QWORD *)this + 306) = 0;
if ( v67 != 0.0 )
{
v68 = fabs(v67);
v69 = v55 * 0.0199999996;
if ( v69 > v68 )
v69 = v68;
if ( v67 <= 0.0 )
v69 = -v69;
*((double *)this + 306) = v69;
*((double *)this + 305) = v67 - v69;
}
LABEL_17:
if ( !(unsigned __int8)PlayerObject::isFlying(this) )
{
if ( !*((_BYTE *)this + 2500)
|| (unsigned __int8)PlayerObject::levelFlipping(this)
|| *((_BYTE *)this + 2530)
|| *((_BYTE *)this + 1787)
|| *((_BYTE *)this + 2832) && fabs(*((double *)this + 339)) <= 2.5 )
{
if ( *((_BYTE *)this + 1974) && !cocos2d::CCNode::getActionByTag(this, 3) )
{
v87 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create(nullptr, 0.06);
v88 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(
this,
PlayerObject::deactivateParticle,
0);
v89 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v87, v88, 0);
(*(void (__fastcall **)(cocos2d::CCAction *, __int64))(*(_QWORD *)v89 + 72LL))(v89, 3);
cocos2d::CCNode::runAction(this, v89);
}
}
else
{
if ( !*((_BYTE *)this + 1974) )
cocos2d::CCParticleSystem::resumeSystem(*((cocos2d::CCParticleSystem **)this + 270));
*((_BYTE *)this + 1974) = 1;
cocos2d::CCNode::stopActionByTag(this, 3);
}
LABEL_20:
*(float *)(*((_QWORD *)this + 240) + 436LL) = (float)((float)(*((float *)this + 659) - 0.1) * 2.1) + 0.4;
if ( *((_BYTE *)this + 1972) )
{
v21 = (cocos2d::CCDirector *)*((unsigned __int8 *)this + 2426);
if ( *((_BYTE *)this + 2426) )
{
v70 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v21);
WinSize = (GameManager *)cocos2d::CCDirector::getWinSize(&v97, v70);
v72 = *((HardStreak **)this + 240);
v73 = *(float *)&v97;
v74 = *(float **)(GameManager::sharedState(WinSize) + 544);
v75 = v74[301];
v76 = GameManager::sharedState((GameManager *)v74);
HardStreak::clearAboveXPos(v72, v75 + (float)(v73 / *(float *)(*(_QWORD *)(v76 + 544) + 424LL)));
}
else
{
v22 = *((HardStreak **)this + 240);
v23 = GameManager::sharedState(v21);
HardStreak::clearBehindXPos(v22, *(float *)(*(_QWORD *)(v23 + 544) + 1204LL));
}
}
v24 = *((_QWORD *)this + 375);
if ( v24 )
{
if ( *((_BYTE *)this + 2421)
&& *((_BYTE *)this + 2365)
&& !*((_BYTE *)this + 2388)
&& *((_BYTE *)this + 2516)
&& (v82 = *((double *)this + 256), v82 > 0.270000011)
&& v82 < 1.5 )
{
if ( !(*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v24 + 352LL))(v24) )
{
cocos2d::CCNode::stopAllActions(*((cocos2d::CCNode **)this + 375));
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 375) + 160LL))(
*((_QWORD *)this + 375),
0.1);
v83 = (cocos2d::CCScaleTo *)(*(__int64 (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 375)
+ 344LL))(
*((_QWORD *)this + 375),
1);
v84 = (cocos2d::CCScaleTo *)cocos2d::CCScaleTo::create(v83, 0.05, 1.44, 0.9);
v94 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCScaleTo::create(v84, 0.05, 0.72, 1.35);
v93 = (cocos2d::CCScaleTo *)cocos2d::CCScaleTo::create(v94, 0.05, 1.8, 0.9);
v95 = (cocos2d::CCScaleTo *)cocos2d::CCScaleTo::create(v93, 0.05, 0.9, 1.35);
v85 = cocos2d::CCScaleTo::create(v95, 0.05, 1.8, 0.9);
v86 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v84, v94, v93, v95, v85, 0);
cocos2d::CCNode::runAction(*((cocos2d::CCNode **)this + 375), v86);
cocos2d::CCParticleSystem::resumeSystem(*((cocos2d::CCParticleSystem **)this + 275));
}
}
else if ( (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v24 + 352LL))(v24)
&& !cocos2d::CCNode::getActionByTag(*((cocos2d::CCNode **)this + 375), 9) )
{
v77 = (cocos2d::CCScaleTo *)cocos2d::CCNode::stopAllActions(*((cocos2d::CCNode **)this + 375));
v78 = (cocos2d::CCHide *)cocos2d::CCScaleTo::create(v77, 0.15, 0.05, 0.1);
v79 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCHide::create(v78);
v80 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v78, v79, 0);
(*(void (__fastcall **)(cocos2d::CCAction *, __int64))(*(_QWORD *)v80 + 72LL))(v80, 9);
cocos2d::CCNode::runAction(*((cocos2d::CCNode **)this + 375), v80);
cocos2d::CCParticleSystem::stopSystem(*((cocos2d::CCParticleSystem **)this + 275));
}
}
if ( *((_BYTE *)this + 2421)
&& *((_BYTE *)this + 2365)
&& !*((_BYTE *)this + 2388)
&& *((_BYTE *)this + 2516)
&& (v81 = *((double *)this + 256), v81 > 0.100000001)
&& v81 < 1.5
&& !*((_BYTE *)this + 1787) )
{
if ( !(*(unsigned __int8 (__fastcall **)(_QWORD))(**((_QWORD **)this + 275) + 1264LL))(*((_QWORD *)this + 275)) )
cocos2d::CCParticleSystem::resumeSystem(*((cocos2d::CCParticleSystem **)this + 275));
}
else if ( (*(unsigned __int8 (__fastcall **)(_QWORD))(**((_QWORD **)this + 275) + 1264LL))(*((_QWORD *)this + 275)) )
{
cocos2d::CCParticleSystem::stopSystem(*((cocos2d::CCParticleSystem **)this + 275));
}
v26 = *((_QWORD *)this + 224);
*((_BYTE *)this + 2152) = 0;
if ( v26 )
{
if ( *((_BYTE *)this + 2421) )
{
v27 = *(float *)((*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(*((_QWORD *)this + 267) + 768LL)
+ 192LL))(*(_QWORD *)(*((_QWORD *)this + 267)
+ 768LL))
+ 4);
v28 = 7.0;
}
else
{
if ( !*((_BYTE *)this + 2422) )
{
v25 = cocos2d::CCPoint::operator=(v26 + 388, &unk_155C638);
if ( !*((_BYTE *)this + 2460) )
{
LABEL_41:
if ( !*((_BYTE *)this + 2428) )
{
LABEL_42:
PlayerObject::updateJumpVariables((__int64)this);
PlayerObject::updateStateVariables(this);
v29 = *((cocos2d::CCTextureCache ***)this + 239);
if ( v29 )
{
v30 = *((void (__fastcall **)(cocos2d::CCTextureCache **, __int64))*v29 + 127);
v31 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(*v29);
v32 = *((double *)this + 328);
getFrameForStreak(*((_DWORD *)this + 569), v98, v32);
v33 = (char *)v98 + 1;
if ( (v98[0] & 1) != 0 )
v33 = v99;
v34 = cocos2d::CCTextureCache::addImage(v31, v33, 0);
v30(v29, v34);
if ( (v98[0] & 1) != 0 )
operator delete(v99);
}
if ( *((_BYTE *)this + 2832) )
{
if ( *((_BYTE *)this + 2460) )
{
v35 = *((_QWORD *)this + 177);
if ( v35 )
{
v36 = *(float *)(v35 + 1852);
if ( v36 > 0.0 && *((double *)this + 328) - *((double *)this + 176) > v36 )
{
PlayerObject::stopDashing(this);
*((_BYTE *)this + 2365) = 0;
}
}
}
}
return _stack_chk_guard;
}
LABEL_75:
v39 = *((_QWORD *)this + 277);
v40 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)v39 + 1008LL);
v41 = (*(float (__fastcall **)(PlayerObject *, long double))(*(_QWORD *)this + 368LL))(
this,
*(long double *)&v25);
v42 = 0.0;
v43 = (float)(45.0 - v41) - 180.0;
if ( *((_BYTE *)this + 2426) )
v42 = 90.0;
v40(v39, v43 + v42);
v44 = *((_QWORD *)this + 278);
v45 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)v44 + 1008LL);
v46 = (*(float (__fastcall **)(PlayerObject *))(*(_QWORD *)this + 368LL))(this);
v47 = 0.0;
v48 = (float)((float)-v46 - 45.0) - 180.0;
if ( *((_BYTE *)this + 2426) )
v47 = -90.0;
v45(v44, v48 + v47);
goto LABEL_42;
}
LABEL_74:
PlayerObject::updateDashAnimation(this);
if ( !*((_BYTE *)this + 2428) )
goto LABEL_42;
goto LABEL_75;
}
v27 = *(float *)((*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(*((_QWORD *)this + 268) + 768LL)
+ 192LL))(*(_QWORD *)(*((_QWORD *)this + 268)
+ 768LL))
+ 4);
v28 = 2.0;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v97, 0.0, v28 + (float)(v27 * 0.4));
v25 = cocos2d::CCPoint::operator=(*((_QWORD *)this + 224) + 388LL, &v97);
}
if ( !*((_BYTE *)this + 2460) )
goto LABEL_41;
goto LABEL_74;
}
if ( *((_BYTE *)this + 2417) )
{
if ( !*((_BYTE *)this + 2365)
|| (unsigned __int8)PlayerObject::levelFlipping(this)
|| *((_BYTE *)this + 1787) )
{
if ( *((_BYTE *)this + 1975) )
cocos2d::CCParticleSystem::stopSystem(*((cocos2d::CCParticleSystem **)this + 272));
*((_BYTE *)this + 1975) = 0;
}
else
{
if ( !*((_BYTE *)this + 1975) )
cocos2d::CCParticleSystem::resumeSystem(*((cocos2d::CCParticleSystem **)this + 272));
*((_BYTE *)this + 1975) = 1;
}
}
if ( !*((_BYTE *)this + 2420) && *((_BYTE *)this + 2500) )
{
v38 = *((double *)this + 299);
if ( *((_BYTE *)this + 2423) )
{
if ( v38 < 1.0 )
goto LABEL_63;
}
else if ( v38 > -1.0 )
{
LABEL_63:
if ( !*((_BYTE *)this + 2530)
&& !*((_BYTE *)this + 1787)
&& (!*((_BYTE *)this + 2832)
|| *((_BYTE *)this + 2721)
|| *((_BYTE *)this + 2720)
|| *((_BYTE *)this + 2809)
|| *((_BYTE *)this + 2810)) )
{
cocos2d::CCParticleSystem::resumeSystem(*((cocos2d::CCParticleSystem **)this + 273));
goto LABEL_20;
}
}
}
cocos2d::CCParticleSystem::stopSystem(*((cocos2d::CCParticleSystem **)this + 273));
goto LABEL_20;
}
}
if ( *((_BYTE *)this + 2832) )
{
v56 = *((double *)this + 173);
v57 = *((double *)this + 174);
v58 = v53 * v56;
v54 = v53 * v57;
*((double *)this + 339) = v56;
*((double *)this + 299) = v57;
}
else
{
v58 = v55;
v54 = v55 * *((double *)this + 174);
}
goto LABEL_111;
}
v52 = *((float *)this + 715);
*((double *)this + 339) = *((double *)this + 339) + (float)(v52 * v50);
if ( v52 != 0.0 )
*((_BYTE *)this + 2868) = 1;
if ( (unsigned __int8)PlayerObject::isInNormalMode(this)
&& !*((_BYTE *)this + 1784)
&& fabsf(*((float *)this + 715)) > 0.1 )
{
PlayerObject::runNormalRotation(this, 1, 1.0);
}
LABEL_104:
if ( !*((_BYTE *)this + 2460) )
goto LABEL_105;
goto LABEL_146;
}
}
else if ( v51 <= 0.0 )
{
goto LABEL_97;
}
*((double *)this + 256) = *((double *)this + 256) + v51 / 12.9399996 * 1.5;
goto LABEL_97;
}
return _stack_chk_guard;
}