//
// PlayerObject::postCollision from 0x1004047f0 to 0x1004064ce (7390 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::checkCollisions @ 0x1001268ee
//
// 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 __fastcall PlayerObject::postCollision(PlayerObject *a1, float a2, bool a3)
{
int v3; // edx
double m_yVelocity; // xmm2_8
bool m_holdingRight; // r12
bool m_holdingLeft; // r13
GameObject *m_lastGroundObject; // rdi
GameObject *m_currentSlope2; // rdi
GameObject *v10; // rax
bool m_isOnSlope; // al
GameObject *m_currentSlope; // rcx
GameManager *v13; // rax
HardStreak *m_waveTrail; // r14
double *v15; // rax
cocos2d::CCPoint v16; // xmm0_8
__m128d v17; // xmm1
bool m_isUpsideDown; // r14
float m_slopeVelocity; // xmm0_4
bool v20; // al
bool m_maybeIsBoosted; // cl
double v22; // xmm2_8
__m128d v23; // rt1
double v24; // xmm1_8
float v25; // xmm0_4
float v26; // xmm0_4
float v27; // xmm3_4
bool m_isPlatformer; // r15
double v29; // xmm0_8
float v30; // xmm0_4
bool m_isCurrentSlopeTop; // al
__m128d v32; // xmm0
double v33; // xmm1_8
__m128d v34; // xmm3
__m128 v35; // xmm1
__int32 v36; // xmm0_4
unsigned __int64 *v37; // rsi
__m128 v38; // xmm1
__int64 v39; // rax
double m_collidedTopMinY; // xmm0_8
double v41; // xmm1_8
GameObject *v42; // rdi
int v43; // r15d
unsigned __int64 *v44; // rax
bool v45; // zf
GameObject *v46; // rdi
bool m_slopeUphill; // al
float v48; // xmm0_4
__int64 v49; // rax
unsigned __int64 *v50; // rsi
int v51; // r13d
__m128 v52; // xmm0
__m128 v53; // xmm0
cocos2d::CCArray *v54; // rax
cocos2d::ccArray *data; // rax
__int64 num; // rcx
cocos2d::CCObject **arr; // r14
char v58; // r13
char v59; // r12
cocos2d::CCObject *v60; // r15
__int64 v61; // rax
__int64 v62; // rax
float *v63; // rax
__m128 v64; // xmm0
GameManager *v65; // rax
cocos2d::CCArray *v66; // r14
unsigned int v67; // r15d
__int64 v68; // rax
unsigned __int64 *v69; // rsi
__m128 v70; // xmm0
float *v71; // rax
cocos2d::CCArray *v72; // r14
unsigned int v73; // r15d
__int64 v74; // rax
GameObject *v75; // rax
GameObject *v76; // r14
GameObject *m_preLastGroundObject; // rcx
char v78; // r13
double *v79; // rax
double v80; // xmm0_8
float v81; // xmm1_4
float *v82; // rax
double v83; // xmm0_8
unsigned __int64 *v84; // r14
float m_scaleXRelated; // xmm0_4
float v86; // xmm3_4
double v87; // xmm0_8
GameManager *v88; // rax
unsigned __int64 *v89; // rsi
int v90; // r13d
__m128 v91; // xmm0
__m128 v92; // xmm0
cocos2d::CCArray *v93; // rax
cocos2d::ccArray *v94; // rax
__int64 v95; // rcx
cocos2d::CCObject **v96; // r14
char v97; // r13
char v98; // r12
cocos2d::CCObject *v99; // r15
float *v100; // rax
__int64 v101; // rax
double v102; // xmm0_8
float v103; // xmm0_4
char m_platformerMovingLeft; // al
bool v105; // cl
char v106; // dl
char v107; // cl
GameObject *v108; // rdi
double *LastPosition; // rax
double v110; // xmm0_8
char v111; // r15
unsigned int v112; // eax
GameObject *v113; // r14
float v114; // xmm0_4
unsigned __int64 *v115; // rsi
double v116; // xmm0_8
unsigned __int64 *v117; // rax
double v118; // xmm0_8
double v119; // xmm0_8
double v120; // xmm0_8
bool v121; // al
double v122; // xmm0_8
double v123; // xmm0_8
double v124; // xmm0_8
bool v125; // al
GameObject *m_collidedObject; // rcx
GameObject *v127; // rdi
double *v128; // rax
double v129; // xmm0_8
char v130; // r15
GameObject *v131; // r14
double m_yVelocityRelated; // xmm0_8
double m_groundYVelocity; // xmm1_8
float v134; // xmm2_4
bool v135; // al
double v136; // xmm0_8
float v137; // xmm0_4
double m_scaleXRelated3; // xmm1_8
float v139; // xmm2_4
float v140; // xmm2_4
double v141; // xmm1_8
float v142; // xmm1_4
double m_scaleXRelated5; // xmm1_8
double m_scaleXRelated4; // xmm0_8
float v145; // xmm2_4
GameObject *m_collidingWithLeft; // rax
double v147; // xmm0_8
double m_scaleXRelated2; // xmm0_8
double v149; // xmm1_8
double v150; // xmm0_8
GJBaseGameLayer *v151; // rdi
GJBaseGameLayer *v152; // rdi
GJBaseGameLayer *v153; // rdi
GJBaseGameLayer *v154; // rdi
GJBaseGameLayer *v155; // rdi
char m_platformerMovingRight; // si
__int64 v157; // rax
GameManager *v158; // rax
__m128 v159; // [rsp+Ch] [rbp-E4h] BYREF
int v160; // [rsp+1Ch] [rbp-D4h]
GJBaseGameLayer *m_gameLayer; // [rsp+20h] [rbp-D0h]
__m128 v162; // [rsp+2Ch] [rbp-C4h] BYREF
__m128 v163; // [rsp+3Ch] [rbp-B4h] BYREF
int v164; // [rsp+4Ch] [rbp-A4h]
__m128 v165; // [rsp+50h] [rbp-A0h]
__m128 v166; // [rsp+60h] [rbp-90h] BYREF
__m128 v167; // [rsp+70h] [rbp-80h] BYREF
__m128 v168; // [rsp+80h] [rbp-70h] BYREF
__m128 v169; // [rsp+90h] [rbp-60h]
float v170; // [rsp+A8h] [rbp-48h]
float v171; // [rsp+ACh] [rbp-44h]
__m128 v172; // [rsp+B0h] [rbp-40h]
cocos2d::CCRect v173; // 0:kr00_16.16
cocos2d::CCRect v174; // 0:kr10_16.16
cocos2d::CCRect v175; // 0:kr20_16.16
cocos2d::CCRect v176; // 0:kr30_16.16
cocos2d::CCRect v177; // 0:kr40_16.16
v170 = a2;
if ( !a3 )
{
v171 = 1.0;
if ( !a1->m_enableImpulseFix )
goto LABEL_6;
goto LABEL_5;
}
v171 = 0.5;
if ( a1->m_enableImpulseFix )
LABEL_5:
v171 = 4.0 * v170;
LABEL_6:
m_holdingRight = a1->m_holdingRight;
m_holdingLeft = a1->m_holdingLeft;
if ( m_holdingLeft && m_holdingRight )
{
if ( a1->m_leftPressedFirst )
m_holdingRight = 0;
m_holdingLeft = a1->m_leftPressedFirst;
}
m_lastGroundObject = a1->m_lastGroundObject;
if ( m_lastGroundObject && GameObject::getGroupDisabled(m_lastGroundObject) )
a1->m_lastGroundObject = nullptr;
m_currentSlope2 = a1->m_currentSlope2;
if ( m_currentSlope2 && GameObject::getGroupDisabled(m_currentSlope2) )
a1->m_currentSlope2 = nullptr;
v10 = a1->m_lastGroundObject;
if ( v10 )
a1->m_isOnIce = v10->m_isIceBlock;
m_isOnSlope = a1->m_isOnSlope;
if ( m_isOnSlope )
{
m_currentSlope = a1->m_currentSlope;
if ( m_currentSlope )
{
if ( !a1->m_maybeUpsideDownSlope )
a1->m_isOnIce = m_currentSlope->m_isIceBlock;
}
}
if ( m_isOnSlope != a1->m_wasOnSlope )
{
if ( a1->m_isDart )
{
if ( !a1->m_maybeReducedEffects && !a1->m_isLocked && a1->m_fadeOutStreak )
{
if ( !a1->m_playEffects || (v13 = GameManager::sharedState(), !GJBaseGameLayer::isFlipping(v13->m_playLayer)) )
{
m_waveTrail = a1->m_waveTrail;
v15 = (double *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
*(double *)&v16 = sub_10028CC60(&v166, v15);
HardStreak::addPoint(m_waveTrail, v16);
}
}
a1->m_justPlacedStreak = 0;
m_isOnSlope = a1->m_isOnSlope;
}
if ( !m_isOnSlope )
{
v17 = (__m128d)*(unsigned __int64 *)&a1->m_totalTime;
a1->m_slopeEndTime = v17.f64[0];
m_isUpsideDown = a1->m_isUpsideDown;
m_slopeVelocity = a1->m_slopeVelocity;
m_yVelocity = 0.0;
if ( m_isUpsideDown )
{
if ( m_slopeVelocity >= 0.0 || a1->m_yVelocity <= m_slopeVelocity || (v20 = 1, !a1->m_isCurrentSlopeTop) )
{
if ( m_slopeVelocity > 0.0 )
{
m_yVelocity = m_slopeVelocity;
if ( m_slopeVelocity > a1->m_yVelocity )
{
v20 = !a1->m_isCurrentSlopeTop;
m_maybeIsBoosted = a1->m_maybeIsBoosted;
if ( !m_maybeIsBoosted )
goto LABEL_55;
LABEL_51:
if ( !a1->m_isShip && !a1->m_isBird && !a1->m_isDart && !a1->m_isSwing )
{
if ( v20 && a1->m_isBall )
{
LABEL_56:
v17.f64[0] = v17.f64[0] - a1->m_slopeStartTime;
v22 = fmax(10.0 * v17.f64[0], 0.4000000059604645);
v23.f64[0] = 0.1000000014901161;
v24 = _mm_cmplt_sd(v17, v23).f64[0];
*(_QWORD *)&m_yVelocity = *(_QWORD *)&v22 & *(_QWORD *)&v24;
v25 = m_slopeVelocity
* COERCE_DOUBLE(~*(_QWORD *)&v24 & 0x3FF0000000000000LL | *(_QWORD *)&m_yVelocity);
v172.f32[0] = v25;
v169.i32[0] = LODWORD(a1->m_slopeAngle);
v26 = cosf(v169.f32[0]);
v27 = v26;
m_isPlatformer = a1->m_isPlatformer;
if ( m_isPlatformer )
{
v165.f32[0] = v26;
v29 = fabs(tanf(v169.f32[0]) * a1->m_platformerXVelocity) * 1.100000023841858;
if ( v172.f32[0] < 0.0 )
v29 = -v29;
v30 = v29;
v27 = v165.f32[0];
m_isCurrentSlopeTop = a1->m_isCurrentSlopeTop;
if ( !m_isUpsideDown )
{
LABEL_60:
if ( m_isCurrentSlopeTop && a1->m_slopeFlipGravityRelated )
goto LABEL_68;
goto LABEL_66;
}
}
else
{
v30 = v172.f32[0];
m_isCurrentSlopeTop = a1->m_isCurrentSlopeTop;
if ( !m_isUpsideDown )
goto LABEL_60;
}
if ( m_isCurrentSlopeTop || !a1->m_slopeFlipGravityRelated )
{
LABEL_68:
m_yVelocity = a1->m_yVelocity;
if ( m_yVelocity > v30 )
{
LABEL_69:
if ( !m_isPlatformer
|| (m_holdingLeft || m_holdingRight)
&& (m_yVelocity = fabs(a1->m_platformerXVelocity),
m_yVelocity >= (float)((float)(v27 * 5.0) + -1.0)) )
{
PlayerObject::boostPlayer(a1, v30);
}
}
LABEL_87:
if ( a1->m_maybeSlopeForce > 0.0
&& (m_holdingLeft && a1->m_isSlidingRight || m_holdingRight && !a1->m_isSlidingRight) )
{
a1->m_isSliding = 0;
a1->m_maybeSlopeForce = 0.0;
a1->m_isMoving = 1;
}
a1->m_slopeVelocity = 0.0;
a1->m_currentSlope = nullptr;
*(_OWORD *)&a1->m_slopeRotation = 0;
goto LABEL_94;
}
LABEL_66:
if ( v30 > a1->m_yVelocity )
goto LABEL_69;
goto LABEL_87;
}
LABEL_75:
if ( m_isUpsideDown )
{
if ( m_maybeIsBoosted || m_slopeVelocity <= 0.0 )
goto LABEL_87;
}
else if ( m_maybeIsBoosted || m_slopeVelocity >= 0.0 )
{
goto LABEL_87;
}
if ( !a1->m_jumpBuffered && !a1->m_stateRingJump && a1->m_isCurrentSlopeTop == m_isUpsideDown )
{
a1->m_isOnGround2 = 0;
v32 = (__m128d)*(unsigned __int64 *)&a1->m_currentSlopeYVelocity;
if ( !m_isUpsideDown )
{
v32.f64[0] = -v32.f64[0];
v32.f64[1] = -0.0;
}
v33 = _mm_cvtepi32_pd(_mm_cvttpd_epi32(v32)).f64[0];
if ( v32.f64[0] != v33 )
{
m_yVelocity = 1000.0;
v32.f64[0] = (v32.f64[0] - v33) * 1000.0;
v34 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v32), (__m128d)xmmword_100816960);
v34.f64[0] = v34.f64[0] + v32.f64[0];
v32.f64[0] = _mm_round_sd((__m128d)0LL, v34, 11).f64[0] / 1000.0 + v33;
}
a1->m_yVelocity = v32.f64[0];
a1->m_isOnGround = 0;
PlayerObject::runRotateAction(a1, 0, v3);
}
goto LABEL_87;
}
LABEL_55:
if ( v20 )
goto LABEL_56;
goto LABEL_75;
}
LABEL_47:
v20 = 0;
m_maybeIsBoosted = a1->m_maybeIsBoosted;
if ( !m_maybeIsBoosted )
goto LABEL_55;
goto LABEL_51;
}
v20 = 0;
}
}
else if ( m_slopeVelocity >= 0.0 || a1->m_yVelocity <= m_slopeVelocity || (v20 = 1, !a1->m_isCurrentSlopeTop) )
{
if ( m_slopeVelocity <= 0.0 )
goto LABEL_47;
m_yVelocity = m_slopeVelocity;
if ( m_slopeVelocity <= a1->m_yVelocity )
goto LABEL_47;
v20 = 1;
if ( a1->m_isCurrentSlopeTop )
goto LABEL_47;
}
m_maybeIsBoosted = a1->m_maybeIsBoosted;
if ( !m_maybeIsBoosted )
goto LABEL_55;
goto LABEL_51;
}
}
LABEL_94:
v35.i64[0] = *(_QWORD *)&a1->m_collidedTopMinY;
if ( *(double *)v35.i64 == 0.0 )
goto LABEL_152;
v35.i64[0] = *(_QWORD *)&a1->m_collidedBottomMaxY;
if ( *(double *)v35.i64 == 0.0 || a1->m_disablePlayerSqueeze )
goto LABEL_152;
if ( a1->m_isPlatformer )
v36 = 1061997773;
else
v36 = 1060320051;
v165.i32[0] = v36;
v37 = (unsigned __int64 *)((__int64 (__fastcall *)(PlayerObject *))a1->getObjectRect)(a1);
sub_10028D180(&v166, v37);
v38 = 0;
v38.f32[0] = a1->m_collidedTopMinY - a1->m_collidedBottomMaxY;
v169 = v38;
v172 = _mm_and_ps((__m128)xmmword_100815500, v38);
v39 = ((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
if ( v169.f32[0] != 0.0 )
{
m_collidedTopMinY = a1->m_collidedTopMinY;
v41 = *(float *)(v39 + 4);
if ( a1->m_isUpsideDown )
{
if ( m_collidedTopMinY > v41 && m_collidedTopMinY > a1->m_lastPosition.y )
goto LABEL_101;
}
else if ( v41 > m_collidedTopMinY && a1->m_lastPosition.y > m_collidedTopMinY )
{
goto LABEL_101;
}
LODWORD(v39) = 0;
v35.i64[0] = v172.i64[0];
if ( !a1->m_isPlatformer )
goto LABEL_123;
goto LABEL_110;
}
LABEL_101:
LOBYTE(v39) = 1;
v35.i64[0] = v172.i64[0];
if ( !a1->m_isPlatformer )
goto LABEL_123;
LABEL_110:
v42 = a1->m_currentSlope;
if ( v42 && v166.f32[3] >= v35.f32[0] && v35.f32[0] >= (float)(v166.f32[3] * v165.f32[0]) )
{
v43 = v39;
v44 = (unsigned __int64 *)((__int64 (__fastcall *)(GameObject *))v42->getObjectRect)(v42);
sub_10028D180(&v168, v44);
v45 = !sub_10028D320(v166.f32, v168.f32);
LODWORD(v39) = v43;
if ( v45 )
{
LABEL_122:
v35.i64[0] = v172.i64[0];
goto LABEL_123;
}
v46 = a1->m_currentSlope;
m_slopeUphill = v46->m_slopeUphill;
if ( m_slopeUphill )
{
if ( !GameObject::slopeFloorTop(v46) )
goto LABEL_120;
v46 = a1->m_currentSlope;
m_slopeUphill = v46->m_slopeUphill;
}
if ( m_slopeUphill || !GameObject::slopeFloorTop(v46) )
{
v48 = 1.0;
LABEL_121:
a1->m_platformerXVelocity = 0.0;
v169.f32[0] = (float)(v48 * v170) + a1->m_lastPosition.x;
v49 = ((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
sub_10028CBE0(v167.f32, v169.f32[0], *(float *)(v49 + 4));
v39 = ((__int64 (__fastcall *)(PlayerObject *, __m128 *))a1->setPosition)(a1, &v167);
LOBYTE(v39) = 1;
goto LABEL_122;
}
LABEL_120:
v48 = -1.0;
goto LABEL_121;
}
LABEL_123:
if ( !(_BYTE)v39 && (float)(v165.f32[0] * v166.f32[3]) > v35.f32[0] )
{
if ( a1->m_isPlatformer )
{
v160 = v39;
m_gameLayer = a1->m_gameLayer;
v50 = (unsigned __int64 *)((__int64 (__fastcall *)(PlayerObject *))a1->getObjectRect)(a1);
sub_10028D180(&v168, v50);
v168 = _mm_add_ps(v168, (__m128)xmmword_10081B7D0);
v51 = 1;
v172.i32[0] = *(_DWORD *)(((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) + 4);
while ( 1 )
{
v52 = 0;
v52.f32[0] = (float)v51 * 0.5;
v53 = _mm_round_ss(v52, v52, 10);
v53.f32[0] = v53.f32[0] * 3.0;
v165 = v53;
sub_10028D180(&v167, (unsigned __int64 *)&v168);
if ( (v51 & 1) != 0 )
v35 = v165;
else
v35 = _mm_xor_ps(v165, (__m128)xmmword_1008150B0);
v165 = v35;
v167.f32[0] = v167.f32[0] + v35.f32[0];
v176.origin = COERCE_COCOS2D_CCPOINT(sub_10028D180(&v163, (unsigned __int64 *)&v167));
v176.size = (cocos2d::CCSize)v35.i64[0];
v54 = GJBaseGameLayer::staticObjectsInRect(m_gameLayer, v176, (bool)&v163);
if ( !v54 )
break;
data = v54->data;
num = data->num;
if ( !data->num )
break;
v164 = v51;
arr = data->arr;
v169.i64[0] = (__int64)&arr[num - 1];
v58 = 0;
v59 = 0;
do
{
v60 = *arr;
if ( !*arr )
break;
v61 = ((__int64 (__fastcall *)(cocos2d::CCObject *))v60->__vftable[2].acceptVisitor)(*arr);
if ( v172.f32[0] > *(float *)(v61 + 4) )
{
v59 = 1;
if ( (v58 & 1) != 0 )
break;
}
else
{
v62 = ((__int64 (__fastcall *)(cocos2d::CCObject *))v60->__vftable[2].acceptVisitor)(v60);
if ( *(float *)(v62 + 4) <= v172.f32[0] )
v59 = 1;
v58 = 1;
if ( (v59 & 1) != 0 )
break;
}
++arr;
}
while ( (unsigned __int64)arr <= v169.i64[0] );
if ( (v58 & 1) == 0 || (v59 & 1) == 0 )
break;
v51 = v164 + 1;
if ( v164 == 8 )
{
LOBYTE(v39) = v160;
goto LABEL_145;
}
}
v63 = (float *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
v64 = v165;
v64.f32[0] = v165.f32[0] + *v63;
v165 = v64;
v35.i64[0] = *(unsigned int *)(((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1) + 4);
sub_10028CBE0(v163.f32, v165.f32[0], v35.f32[0]);
((void (__fastcall *)(PlayerObject *, __m128 *))a1->setPosition)(a1, &v163);
LOBYTE(v39) = 1;
}
LABEL_145:
if ( !(_BYTE)v39 && !a1->m_ignoreDamage )
{
if ( !a1->m_playEffects )
((void (__fastcall *)(PlayerObject *, cocos2d::CCPoint *))a1->setPosition)(a1, &a1->m_lastPosition);
if ( a1->m_maybeCanRunIntoBlocks )
{
a1->m_maybeIsColliding = 1;
}
else
{
v65 = GameManager::sharedState();
((void (__fastcall *)(PlayLayer *, PlayerObject *, _QWORD))v65->m_playLayer->destroyPlayer)(
v65->m_playLayer,
a1,
0);
}
}
}
LABEL_152:
if ( !a1->m_ignoreDamage )
{
if ( cocos2d::CCDictionary::count(a1->m_collisionLogTop) )
{
if ( cocos2d::CCDictionary::count(a1->m_collisionLogBottom) )
{
v66 = cocos2d::CCDictionary::allKeys(a1->m_collisionLogTop);
if ( (unsigned int)sub_100720070(v66) )
{
v67 = 0;
do
{
v68 = sub_1007200C0(v66, v67);
if ( cocos2d::CCDictionary::objectForKey(a1->m_collisionLogBottom, *(int *)(v68 + 56)) )
goto LABEL_187;
}
while ( ++v67 < (unsigned int)sub_100720070(v66) );
}
}
}
}
if ( !a1->m_isPlatformer )
{
LABEL_170:
if ( !a1->m_isPlatformer )
{
v78 = 0;
goto LABEL_232;
}
v75 = a1->m_currentSlope2;
if ( v75 )
a1->m_preLastGroundObject = v75;
v76 = a1->m_lastGroundObject;
if ( !v76 && !a1->m_preLastGroundObject )
goto LABEL_179;
m_preLastGroundObject = a1->m_preLastGroundObject;
if ( !a1->m_isOnGround2 && m_preLastGroundObject == nullptr )
goto LABEL_179;
if ( m_preLastGroundObject )
v76 = a1->m_preLastGroundObject;
if ( v76->m_isNonStickX )
{
LABEL_179:
v78 = 0;
if ( !v75 )
goto LABEL_230;
LABEL_222:
if ( !a1->m_isOnSlope && !a1->m_wasOnSlope
|| a1->m_maybeUpsideDownSlope
|| v75->m_isGripSlope
|| (v103 = fabs(a1->m_slopeAngle * 57.29578), v103 <= 40.0) )
{
LABEL_230:
*(_WORD *)&a1->m_platformerMovingLeft = 0;
if ( !a1->m_isOnGround2 )
LABEL_231:
a1->m_preLastGroundObject = nullptr;
LABEL_232:
v108 = a1->m_lastGroundObject;
if ( !v108
|| a1->m_currentSlope2
|| v108->m_isNonStickY
|| (LastPosition = (double *)GameObject::getLastPosition(v108),
v110 = sub_10028CC60(&v166, LastPosition),
((void (__fastcall *)(__m128 *, double))a1->m_lastGroundObject->getRealPosition)(&v168, v110),
GameObject::getScalePosDelta((GameObject *)&v167),
v35.i64[0] = v168.u32[0],
*(_QWORD *)&m_yVelocity = v166.u32[0],
v168.f32[0] == v166.f32[0])
&& v168.f32[1] == v166.f32[1]
&& v167.f32[1] == 0.0 )
{
v111 = 0;
}
else
{
if ( !a1->m_isSideways )
{
v35.i64[0] = v168.u32[1];
*(_QWORD *)&m_yVelocity = v166.u32[1];
}
v121 = a1->m_isUpsideDown;
if ( !v121 && *(float *)&m_yVelocity > (float)(v167.f32[1] + v35.f32[0])
|| (v111 = 0, v121) && (v35.f32[0] = v35.f32[0] - v167.f32[1], v35.f32[0] > *(float *)&m_yVelocity) )
{
v111 = 1;
}
}
v112 = cocos2d::CCDictionary::count(a1->m_collisionLogBottom);
if ( !v111 && v112 )
goto LABEL_272;
a1->m_isCollidingWithSlope = 0;
v113 = a1->m_lastGroundObject;
a1->m_lastGroundObject = nullptr;
if ( (v113 == nullptr) | (unsigned __int8)v111 ^ 1 )
goto LABEL_272;
if ( a1->m_isPlatformer )
{
v114 = 10.0;
if ( !v113->m_isExtraSticky )
goto LABEL_247;
}
else
{
v114 = 5.0;
if ( !v113->m_isExtraSticky )
{
LABEL_247:
v169.f32[0] = v114 * v170;
v115 = (unsigned __int64 *)((__int64 (__fastcall *)(GameObject *))v113->getObjectRect)(v113);
v116 = sub_10028D180(&v167, v115);
v117 = (unsigned __int64 *)((__int64 (__fastcall *)(PlayerObject *, double))a1->getObjectRect)(a1, v116);
sub_10028D180(&v163, v117);
sub_10028D180(&v162, (unsigned __int64 *)&v167);
if ( a1->m_isSideways )
{
v162.f32[2] = v162.f32[2] + v169.f32[0];
if ( a1->m_isUpsideDown )
{
v118 = sub_10028D270((unsigned int *)&v167);
v172.i32[0] = LODWORD(v118);
v119 = sub_10028D230(v163.f32);
goto LABEL_252;
}
v122 = sub_10028D270((unsigned int *)&v163);
v172.i32[0] = LODWORD(v122);
v123 = sub_10028D230(v167.f32);
}
else
{
v162.f32[3] = v162.f32[3] + v169.f32[0];
if ( a1->m_isUpsideDown )
{
v120 = sub_10028D2C0((__int64)&v167);
v172.i32[0] = LODWORD(v120);
v119 = sub_10028D280((__int64)&v163);
LABEL_252:
v35.i64[0] = v172.u32[0];
v35.f32[0] = v172.f32[0] - *(float *)&v119;
v172.f32[0] = v172.f32[0] - *(float *)&v119;
if ( a1->m_isSideways )
v162.f32[0] = v162.f32[0] - v169.f32[0];
else
v162.f32[1] = v162.f32[1] - v169.f32[0];
LABEL_265:
if ( sub_10028D320(v163.f32, v162.f32) )
{
v125 = 0;
}
else
{
m_collidedObject = a1->m_collidedObject;
v125 = m_collidedObject == nullptr;
if ( m_collidedObject )
v113 = a1->m_collidedObject;
}
if ( !v125 && v169.f32[0] > v172.f32[0] )
{
a1->m_isCollidingWithSlope = 1;
sub_10028D180(&v159, (unsigned __int64 *)&unk_1009A1568);
if ( !a1->m_isSideways )
{
sub_10028D180(&v166, (unsigned __int64 *)&v159);
LODWORD(v174.origin.x) = v35.i32[0];
LODWORD(v174.origin.y) = v35.i32[1];
v174.size = *(cocos2d::CCSize *)&m_yVelocity;
PlayerObject::collidedWithObjectInternal(a1, 0.0, v113, v174, (bool)&v166);
v127 = a1->m_currentSlope2;
if ( !v127 )
goto LABEL_282;
LABEL_273:
if ( !v127->m_isNonStickY )
{
v128 = (double *)GameObject::getLastPosition(v127);
v129 = sub_10028CC60(&v166, v128);
((void (__fastcall *)(__m128 *, double))a1->m_currentSlope2->getRealPosition)(&v168, v129);
if ( v168.f32[0] != v166.f32[0] || v168.f32[1] != v166.f32[1] )
{
v35.i64[0] = v168.u32[1];
if ( a1->m_isUpsideDown )
{
if ( v168.f32[1] <= v166.f32[1] )
goto LABEL_282;
}
else if ( v166.f32[1] <= v168.f32[1] )
{
goto LABEL_282;
}
v130 = 1;
cocos2d::CCDictionary::count(a1->m_collisionLogBottom);
LABEL_283:
a1->m_isCollidingWithSlope = 0;
v131 = a1->m_currentSlope2;
a1->m_currentSlope2 = nullptr;
if ( v130 )
{
a1->m_isCollidingWithSlope = 1;
if ( a1->m_isSideways )
{
sub_10028D180(&v166, (unsigned __int64 *)&unk_1009A1568);
LODWORD(v175.origin.x) = v35.i32[0];
LODWORD(v175.origin.y) = v35.i32[1];
v175.size = *(cocos2d::CCSize *)&m_yVelocity;
PlayerObject::handleRotatedCollisionInternal(a1, 0.0, v131, v175, (bool)&v166, 0, 1);
}
else
{
PlayerObject::collidedWithSlopeInternal(a1, 0.0, v131, 1);
}
}
LABEL_287:
m_yVelocityRelated = a1->m_yVelocityRelated;
if ( m_yVelocityRelated != 0.0 && a1->m_stateBoostX <= 0 )
{
m_groundYVelocity = a1->m_groundYVelocity;
v134 = m_yVelocityRelated - m_groundYVelocity;
if ( fabs(v134) > (float)(0.5 * v171) )
{
v135 = a1->m_isUpsideDown;
if ( m_yVelocityRelated > 5.0 && !v135 && m_yVelocityRelated > m_groundYVelocity )
{
v136 = fmax(-20.0, fmin(20.0, m_yVelocityRelated));
a1->m_yVelocityRelated = v136;
if ( v136 < a1->m_yVelocity )
goto LABEL_300;
goto LABEL_299;
}
if ( m_yVelocityRelated < -5.0 && v135 && m_groundYVelocity > m_yVelocityRelated )
{
v136 = fmax(-20.0, fmin(20.0, m_yVelocityRelated));
a1->m_yVelocityRelated = v136;
if ( a1->m_yVelocity < v136 )
{
LABEL_300:
a1->m_currentSlope2 = nullptr;
a1->m_lastGroundObject = nullptr;
goto LABEL_301;
}
LABEL_299:
v137 = v136;
PlayerObject::boostPlayer(a1, v137);
goto LABEL_300;
}
}
}
LABEL_301:
if ( !a1->m_isPlatformer )
goto LABEL_329;
m_scaleXRelated3 = a1->m_scaleXRelated3;
if ( m_scaleXRelated3 != 0.0
&& !a1->m_isOnGround2
&& a1->m_stateBoostY <= 0
&& !v78
&& a1->m_physDeltaRelated > 0.05000000074505806 )
{
v139 = m_scaleXRelated3 - a1->m_scaleXRelated2;
if ( fabs(v139) > (float)(0.5 * v171) )
{
v140 = m_scaleXRelated3 * 0.8999999761581421 / v170;
v141 = v140 + a1->m_platformerXVelocity;
a1->m_platformerXVelocity = v141;
if ( fabs(v140) >= 2.0 )
{
a1->m_maybeHasStopped = 1;
v142 = v141;
a1->m_xVelocityRelated = v142;
}
a1->m_scaleXRelatedTime = 0.0;
}
}
m_scaleXRelated5 = a1->m_scaleXRelated5;
if ( m_scaleXRelated5 != 0.0 && a1->m_maybeStateForce2 <= 0 )
{
m_scaleXRelated4 = a1->m_scaleXRelated4;
v145 = m_scaleXRelated5 - m_scaleXRelated4;
if ( fabs(v145) > (float)(v171 * 0.5) )
{
m_collidingWithLeft = a1->m_collidingWithLeft;
if ( m_scaleXRelated5 > 5.0 && m_collidingWithLeft && m_scaleXRelated5 > m_scaleXRelated4 )
{
v147 = fmax(-50.0, fmin(50.0, m_scaleXRelated5));
a1->m_scaleXRelated5 = v147;
LABEL_322:
if ( v147 >= a1->m_platformerXVelocity )
{
LABEL_325:
a1->m_platformerXVelocity = v147;
a1->m_affectedByForces = 1;
a1->m_isAccelerating = 1;
goto LABEL_326;
}
if ( !a1->m_collidingWithRight )
{
LABEL_326:
*(_OWORD *)&a1->m_collidingWithLeft = 0;
goto LABEL_327;
}
LABEL_324:
if ( a1->m_platformerXVelocity >= v147 )
goto LABEL_325;
goto LABEL_326;
}
if ( m_scaleXRelated5 < -5.0
&& a1->m_collidingWithRight
&& m_scaleXRelated4 > m_scaleXRelated5 )
{
v147 = fmax(-50.0, fmin(50.0, m_scaleXRelated5));
a1->m_scaleXRelated5 = v147;
if ( !m_collidingWithLeft )
goto LABEL_324;
goto LABEL_322;
}
}
}
LABEL_327:
if ( cocos2d::CCDictionary::count(a1->m_collisionLogLeft) )
{
if ( cocos2d::CCDictionary::count(a1->m_collisionLogRight) )
goto LABEL_329;
}
else
{
a1->m_collidingWithLeft = nullptr;
if ( cocos2d::CCDictionary::count(a1->m_collisionLogRight) )
goto LABEL_329;
}
a1->m_collidingWithRight = nullptr;
LABEL_329:
a1->m_collidedObject = nullptr;
m_scaleXRelated2 = a1->m_scaleXRelated2;
if ( m_scaleXRelated2 == 0.0 )
{
if ( a1->m_scaleXRelated3 != 0.0 )
{
m_scaleXRelated2 = 0.0;
if ( a1->m_totalTime - a1->m_scaleXRelatedTime < 0.03333333507180214 )
{
LABEL_334:
v149 = a1->m_scaleXRelated4;
a1->m_yVelocityRelated = a1->m_groundYVelocity;
*(_OWORD *)&a1->m_scaleXRelated2 = 0;
a1->m_scaleXRelated5 = v149;
a1->m_scaleXRelated4 = 0.0;
if ( v78 )
{
if ( a1->m_isOnGround2 )
goto LABEL_336;
}
else
{
a1->m_physDeltaRelated = 0.0;
if ( a1->m_isOnGround2 )
{
LABEL_336:
a1->m_maybeHasStopped = 0;
if ( a1->m_isOnSlope )
goto LABEL_341;
goto LABEL_340;
}
}
if ( a1->m_isOnSlope )
goto LABEL_341;
LABEL_340:
if ( !a1->m_wasOnSlope )
{
a1->m_collidingWithSlopeId = 0;
v150 = a1->m_yVelocity;
if ( a1->m_isUpsideDown )
{
if ( v150 > 2.0 && a1->m_fallSpeed < 2.0 )
{
v151 = a1->m_gameLayer;
if ( v151 )
{
GJBaseGameLayer::gameEventTriggered(v151, FallSpeedLow, 0, a1->m_uniqueID);
v150 = a1->m_yVelocity;
}
}
if ( v150 > 7.0 && a1->m_fallSpeed < 7.0 )
{
v152 = a1->m_gameLayer;
if ( v152 )
{
GJBaseGameLayer::gameEventTriggered(v152, FallSpeedMed, 0, a1->m_uniqueID);
v150 = a1->m_yVelocity;
}
}
if ( v150 <= 14.0 || a1->m_fallSpeed >= 14.0 )
goto LABEL_341;
}
else
{
if ( v150 < -2.0 && a1->m_fallSpeed > -2.0 )
{
v153 = a1->m_gameLayer;
if ( v153 )
{
GJBaseGameLayer::gameEventTriggered(v153, FallSpeedLow, 0, a1->m_uniqueID);
v150 = a1->m_yVelocity;
}
}
if ( v150 < -7.0 && a1->m_fallSpeed > -7.0 )
{
v154 = a1->m_gameLayer;
if ( v154 )
{
GJBaseGameLayer::gameEventTriggered(v154, FallSpeedMed, 0, a1->m_uniqueID);
v150 = a1->m_yVelocity;
}
}
if ( v150 >= -14.0 || a1->m_fallSpeed <= -14.0 )
goto LABEL_341;
}
v155 = a1->m_gameLayer;
if ( v155 )
GJBaseGameLayer::gameEventTriggered(v155, FallSpeedHigh, 0, a1->m_uniqueID);
}
LABEL_341:
a1->m_fallSpeed = a1->m_yVelocity;
--a1->m_reverseRelated;
return;
}
}
}
else
{
a1->m_scaleXRelatedTime = a1->m_totalTime;
}
a1->m_scaleXRelated3 = m_scaleXRelated2;
goto LABEL_334;
}
}
LABEL_282:
v130 = 0;
if ( cocos2d::CCDictionary::count(a1->m_collisionLogBottom) )
goto LABEL_287;
goto LABEL_283;
}
sub_10028D180(&v168, (unsigned __int64 *)&v159);
sub_10028D180(&v166, (unsigned __int64 *)&v168);
LODWORD(v173.origin.x) = v35.i32[0];
LODWORD(v173.origin.y) = v35.i32[1];
v173.size = *(cocos2d::CCSize *)&m_yVelocity;
PlayerObject::handleRotatedCollisionInternal(a1, 0.0, v113, v173, (bool)&v166, 1, 0);
}
LABEL_272:
v127 = a1->m_currentSlope2;
if ( !v127 )
goto LABEL_282;
goto LABEL_273;
}
v124 = sub_10028D2C0((__int64)&v163);
v172.i32[0] = LODWORD(v124);
v123 = sub_10028D280((__int64)&v167);
}
v35.i64[0] = v172.u32[0];
v35.f32[0] = v172.f32[0] - *(float *)&v123;
v172.f32[0] = v172.f32[0] - *(float *)&v123;
goto LABEL_265;
}
}
v114 = 20.0;
goto LABEL_247;
}
m_platformerMovingLeft = a1->m_platformerMovingLeft;
v105 = a1->m_isUpsideDown;
if ( a1->m_slopeSlidingMaybeRotated )
{
if ( !v105 )
{
LABEL_229:
v106 = 1;
v107 = 0;
LABEL_370:
m_platformerMovingRight = a1->m_platformerMovingRight;
a1->m_platformerMovingLeft = v106;
a1->m_platformerMovingRight = v107;
if ( m_platformerMovingLeft != v106 || m_platformerMovingRight != v107 )
{
v35.i64[0] = *(_QWORD *)&a1->m_totalTime;
*(_QWORD *)&a1->m_changedDirectionsTime = v35.i64[0];
}
a1->m_maybeChangedDirectionAngle = v103;
a1->m_maybeGoingCorrectSlopeDirection = 1;
if ( !a1->m_isOnGround2 )
goto LABEL_231;
goto LABEL_232;
}
}
else if ( v105 )
{
goto LABEL_229;
}
v107 = 1;
v106 = 0;
goto LABEL_370;
}
v79 = (double *)GameObject::getLastPosition(v76);
v80 = sub_10028CC60(&v166, v79);
((void (__fastcall *)(__m128 *, GameObject *, double))v76->getRealPosition)(&v168, v76, v80);
v81 = 0.0;
if ( v76->m_isScaleStick )
{
GameObject::getScalePosDelta((GameObject *)&v167);
v172 = (__m128)v167.u32[0];
v169.i32[0] = v168.i32[0];
v82 = (float *)((__int64 (__fastcall *)(PlayerObject *, GameObject *, float, double))a1->getPosition)(
a1,
v76,
v168.f32[0],
0.0);
if ( v169.f32[0] <= *v82 )
{
v81 = v172.f32[0];
if ( a1->m_isSideways )
goto LABEL_186;
goto LABEL_220;
}
LODWORD(v81) = v172.i32[0] ^ 0x80000000;
}
if ( a1->m_isSideways )
{
LABEL_186:
v83 = (float)(v81 + (float)(v168.f32[1] - v166.f32[1]));
a1->m_scaleXRelated = v83;
a1->m_scaleXRelated2 = v83;
v84 = (unsigned __int64 *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
v35.i32[1] = 0;
v35.f32[0] = a1->m_scaleXRelated;
m_scaleXRelated = 0.0;
goto LABEL_221;
}
LABEL_220:
v102 = (float)(v81 + (float)(v168.f32[0] - v166.f32[0]));
a1->m_scaleXRelated = v102;
a1->m_scaleXRelated2 = v102;
v84 = (unsigned __int64 *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
m_scaleXRelated = a1->m_scaleXRelated;
v35.i64[0] = 0;
LABEL_221:
sub_10028CBE0(v163.f32, m_scaleXRelated, v35.f32[0]);
sub_10028CCE0((double *)v167.i64, v84, (unsigned __int64 *)&v163);
((void (__fastcall *)(PlayerObject *, __m128 *))a1->setPosition)(a1, &v167);
a1->m_physDeltaRelated = (float)(v170 / 60.0) + a1->m_physDeltaRelated;
v75 = a1->m_currentSlope2;
v78 = 1;
if ( !v75 )
goto LABEL_230;
goto LABEL_222;
}
v35.i64[0] = *(_QWORD *)&a1->m_collidedLeftMaxX;
if ( *(double *)v35.i64 != 0.0 )
{
v35.i64[0] = *(_QWORD *)&a1->m_collidedRightMinX;
if ( *(double *)v35.i64 != 0.0 )
{
v69 = (unsigned __int64 *)((__int64 (__fastcall *)(PlayerObject *))a1->getObjectRect)(a1);
sub_10028D180(&v166, v69);
v169.f32[0] = (float)(a1->m_vehicleSize * -5.0) + v166.f32[2];
v70 = (__m128)*(unsigned __int64 *)&a1->m_collidedRightMinX;
*(double *)v70.i64 = *(double *)v70.i64 - a1->m_collidedLeftMaxX;
v70.f32[0] = *(double *)v70.i64;
v172 = v70;
v71 = (float *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
if ( v172.f32[0] != 0.0 )
{
*(_QWORD *)&m_yVelocity = v169.u32[0];
v86 = fabs(v172.f32[0]);
v87 = *v71;
if ( a1->m_platformerXVelocity >= 0.0 )
{
v35.i64[0] = *(_QWORD *)&a1->m_collidedRightMinX;
if ( v87 > *(double *)v35.i64 && a1->m_lastPosition.x > *(double *)v35.i64 )
goto LABEL_163;
}
else
{
v35.i64[0] = *(_QWORD *)&a1->m_collidedLeftMaxX;
if ( *(double *)v35.i64 > v87 && *(double *)v35.i64 > a1->m_lastPosition.x )
goto LABEL_163;
}
if ( v169.f32[0] > v86 )
{
if ( a1->m_isPlatformer )
{
m_gameLayer = a1->m_gameLayer;
v89 = (unsigned __int64 *)((__int64 (__fastcall *)(PlayerObject *))a1->getObjectRect)(a1);
sub_10028D180(&v168, v89);
v168 = _mm_add_ps(v168, (__m128)xmmword_10081B7E0);
v90 = 1;
v172.i32[0] = *(_DWORD *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
while ( 1 )
{
v91 = 0;
v91.f32[0] = (float)v90 * 0.5;
v92 = _mm_round_ss(v91, v91, 10);
v92.f32[0] = v92.f32[0] * 3.0;
v165 = v92;
sub_10028D180(&v167, (unsigned __int64 *)&v168);
if ( (v90 & 1) != 0 )
v35 = v165;
else
v35 = _mm_xor_ps(v165, (__m128)xmmword_1008150B0);
v165 = v35;
v167.f32[1] = v167.f32[1] + v35.f32[0];
v177.origin = COERCE_COCOS2D_CCPOINT(sub_10028D180(&v163, (unsigned __int64 *)&v167));
v177.size = (cocos2d::CCSize)v35.i64[0];
v93 = GJBaseGameLayer::staticObjectsInRect(m_gameLayer, v177, (bool)&v163);
if ( !v93 )
break;
v94 = v93->data;
v95 = v94->num;
if ( !v94->num )
break;
v164 = v90;
v96 = v94->arr;
v169.i64[0] = (__int64)&v96[v95 - 1];
v97 = 0;
v98 = 0;
do
{
v99 = *v96;
if ( !*v96 )
break;
v100 = (float *)((__int64 (__fastcall *)(cocos2d::CCObject *))v99->__vftable[2].acceptVisitor)(*v96);
if ( v172.f32[0] > *v100 )
{
v97 = 1;
if ( (v98 & 1) != 0 )
break;
}
else
{
v101 = ((__int64 (__fastcall *)(cocos2d::CCObject *))v99->__vftable[2].acceptVisitor)(v99);
if ( *(float *)(v101 + 4) <= v172.f32[0] )
v97 = 1;
v98 = 1;
if ( (v97 & 1) != 0 )
break;
}
++v96;
}
while ( (unsigned __int64)v96 <= v169.i64[0] );
if ( (v97 & 1) == 0 || (v98 & 1) == 0 )
break;
v90 = v164 + 1;
if ( v164 == 8 )
goto LABEL_215;
}
v172.i32[0] = *(_DWORD *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
v157 = ((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
v35.i32[1] = v165.i32[1];
v35.f32[0] = v165.f32[0] + *(float *)(v157 + 4);
sub_10028CBE0(v163.f32, v172.f32[0], v35.f32[0]);
((void (__fastcall *)(PlayerObject *, __m128 *))a1->setPosition)(a1, &v163);
}
else
{
LABEL_215:
if ( !a1->m_playEffects )
((void (__fastcall *)(PlayerObject *, cocos2d::CCPoint *))a1->setPosition)(a1, &a1->m_lastPosition);
if ( a1->m_maybeCanRunIntoBlocks )
{
a1->m_maybeIsColliding = !a1->m_ignoreDamage;
}
else
{
v158 = GameManager::sharedState();
((void (__fastcall *)(PlayLayer *, PlayerObject *, _QWORD))v158->m_playLayer->destroyPlayer)(
v158->m_playLayer,
a1,
0);
}
}
}
}
}
}
LABEL_163:
if ( a1->m_ignoreDamage )
goto LABEL_170;
if ( !cocos2d::CCDictionary::count(a1->m_collisionLogLeft) )
goto LABEL_170;
if ( !cocos2d::CCDictionary::count(a1->m_collisionLogRight) )
goto LABEL_170;
v72 = cocos2d::CCDictionary::allKeys(a1->m_collisionLogLeft);
if ( !(unsigned int)sub_100720070(v72) )
goto LABEL_170;
v73 = 0;
while ( 1 )
{
v74 = sub_1007200C0(v72, v73);
if ( cocos2d::CCDictionary::objectForKey(a1->m_collisionLogRight, *(int *)(v74 + 56)) )
break;
if ( ++v73 >= (unsigned int)sub_100720070(v72) )
goto LABEL_170;
}
LABEL_187:
((void (__fastcall *)(PlayerObject *, cocos2d::CCPoint *))a1->setPosition)(a1, &a1->m_lastPosition);
if ( a1->m_maybeCanRunIntoBlocks )
{
a1->m_maybeIsColliding = 1;
}
else
{
v88 = GameManager::sharedState();
((void (__fastcall *)(PlayLayer *, PlayerObject *, _QWORD))v88->m_playLayer->destroyPlayer)(v88->m_playLayer, a1, 0);
}
}