//
// PlayerObject::playDynamicSpiderRun from 0x62adf8 to 0x62b284 (1164 bytes)
//
// 6 xrefs:
// > PlayerObject::updateMove @ 0x62b414
// > PlayerObject::stopDashing @ 0x62cde4
// > PlayerObject::hitGround @ 0x62d200
// > PlayerObject::updateRobotAnimationSpeed @ 0x62dac8
// > PlayerObject::toggleSpiderMode @ 0x630cf8
// > ??> @ 0x45af8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void PlayerObject::playDynamicSpiderRun(PlayerObject *a1)
{
_BOOL4 m_spiderAnimationEnabled; // w24
float m_playerSpeed; // s0
GJSpiderSprite *v4; // x20
void *v5; // x0
char *v6; // x0
unsigned int *v7; // x20
int v8; // w1
_DWORD *v9; // x24
unsigned __int64 v10; // x26
unsigned __int64 v11; // x21
size_t v12; // x2
int v13; // w22
__int64 v14; // x21
char *v15; // x0
GJSpiderSprite *v16; // x24
__int64 v17; // x1
void *v18; // x0
_DWORD *v19; // x25
unsigned __int64 v20; // x26
unsigned __int64 v21; // x21
size_t v22; // x2
__int64 v23; // x21
char *v24; // x0
GJSpiderSprite *m_spiderSprite; // x25
char *v26; // x1
unsigned int *v27; // x1
int v28; // w2
unsigned int *v29; // x1
unsigned int *v30; // x24
int v31; // w1
unsigned int *v32; // x1
int v33; // w2
unsigned int *v34; // x25
int v35; // w1
void *v36; // [xsp+58h] [xbp+58h] BYREF
void *v37; // [xsp+60h] [xbp+60h] BYREF
__int64 v38; // [xsp+68h] [xbp+68h] BYREF
void *v39; // [xsp+70h] [xbp+70h] BYREF
__int64 v40; // [xsp+78h] [xbp+78h] BYREF
__int64 v41; // [xsp+80h] [xbp+80h] BYREF
if ( a1->m_isDashing )
return;
sub_D18D28(&v36, &a1->m_spiderSprite->m_animationManager->m_currentAnimation);
m_spiderAnimationEnabled = a1->m_spiderAnimationEnabled;
m_playerSpeed = a1->m_playerSpeed;
if ( m_playerSpeed > 1.1 )
{
sub_D153B8((int)&v37, "walk");
v19 = v37;
v20 = *((_QWORD *)v36 - 3);
v21 = *((_QWORD *)v37 - 3);
if ( v20 > v21 )
v22 = *((_QWORD *)v37 - 3);
else
v22 = *((_QWORD *)v36 - 3);
v13 = memcmp(v37, v36, v22);
if ( !v13 )
{
v13 = 0x7FFFFFFF;
v23 = v21 - v20;
if ( v23 <= 0x7FFFFFFF )
{
if ( v23 >= (__int64)0xFFFFFFFF80000000LL )
v13 = v23;
else
v13 = 0x80000000;
}
}
v24 = (char *)(v19 - 6);
if ( v19 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v34 = v19 - 2;
do
v35 = __ldaxr(v34);
while ( __stlxr(v35 - 1, v34) );
}
else
{
v35 = *(v19 - 2);
*(v19 - 2) = v35 - 1;
}
if ( v35 <= 0 )
operator delete(v24);
}
m_spiderSprite = a1->m_spiderSprite;
if ( m_spiderAnimationEnabled )
v26 = "run2";
else
v26 = "run";
sub_D153B8((int)&v38, v26);
CCAnimatedSprite::runAnimation((__int64)m_spiderSprite, (__int64)&v38);
v17 = v38;
v18 = (void *)(v38 - 24);
if ( (__int64 *)(v38 - 24) == &qword_124B6B0 )
goto LABEL_19;
if ( &pthread_create )
{
v27 = (unsigned int *)(v38 - 8);
do
v28 = __ldaxr(v27);
while ( __stlxr(v28 - 1, v27) );
LABEL_33:
if ( v28 <= 0 )
operator delete(v18);
LABEL_19:
if ( !v13 )
SpriteAnimationManager::offsetCurrentAnimation(a1->m_spiderSprite->m_animationManager, 0.1);
goto LABEL_6;
}
LABEL_62:
v28 = *(_DWORD *)(v17 - 8);
*(_DWORD *)(v17 - 8) = v28 - 1;
goto LABEL_33;
}
if ( m_playerSpeed > 0.9 )
{
sub_D153B8((int)&v39, "walk");
v9 = v39;
v10 = *((_QWORD *)v36 - 3);
v11 = *((_QWORD *)v39 - 3);
if ( v10 > v11 )
v12 = *((_QWORD *)v39 - 3);
else
v12 = *((_QWORD *)v36 - 3);
v13 = memcmp(v39, v36, v12);
if ( !v13 )
{
v13 = 0x7FFFFFFF;
v14 = v11 - v10;
if ( v14 <= 0x7FFFFFFF )
{
if ( v14 >= (__int64)0xFFFFFFFF80000000LL )
v13 = v14;
else
v13 = 0x80000000;
}
}
v15 = (char *)(v9 - 6);
if ( v9 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v30 = v9 - 2;
do
v31 = __ldaxr(v30);
while ( __stlxr(v31 - 1, v30) );
}
else
{
v31 = *(v9 - 2);
*(v9 - 2) = v31 - 1;
}
if ( v31 <= 0 )
operator delete(v15);
}
v16 = a1->m_spiderSprite;
sub_D153B8((int)&v40, "run");
CCAnimatedSprite::runAnimation((__int64)v16, (__int64)&v40);
v17 = v40;
v18 = (void *)(v40 - 24);
if ( (__int64 *)(v40 - 24) == &qword_124B6B0 )
goto LABEL_19;
if ( &pthread_create )
{
v29 = (unsigned int *)(v40 - 8);
do
v28 = __ldaxr(v29);
while ( __stlxr(v28 - 1, v29) );
goto LABEL_33;
}
goto LABEL_62;
}
v4 = a1->m_spiderSprite;
sub_D153B8((int)&v41, "walk");
CCAnimatedSprite::runAnimation((__int64)v4, (__int64)&v41);
v5 = (void *)(v41 - 24);
if ( (__int64 *)(v41 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v32 = (unsigned int *)(v41 - 8);
do
v33 = __ldaxr(v32);
while ( __stlxr(v33 - 1, v32) );
}
else
{
v33 = *(_DWORD *)(v41 - 8);
*(_DWORD *)(v41 - 8) = v33 - 1;
}
if ( v33 <= 0 )
operator delete(v5);
}
LABEL_6:
v6 = (char *)v36 - 24;
if ( (char *)v36 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)((char *)v36 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *((_DWORD *)v36 - 2);
*((_DWORD *)v36 - 2) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v6);
}
}