//
// PlayerObject::spiderTestJumpInternal from 0x1002c16c0 to 0x1002c21c0 (2816 bytes)
//
// 2 xrefs:
// > PlayerObject::spiderTestJump @ 0x1002bab48
// > PlayerObject::spiderTestJumpInternal @ 0x1002c2180
//
// 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 11:02:31 +0000
//
__int64 __fastcall PlayerObject::spiderTestJumpInternal(__int64 result, int a2)
{
__int64 v2; // x19
unsigned int v4; // w26
float v5; // s8
char v6; // w27
__int64 v7; // x0
double v8; // d0
float MaxPortalY; // s12
float v10; // s11
float v11; // s0
float v12; // s8
__int64 v13; // x8
__int64 v14; // x10
__int64 v15; // x8
__int64 v16; // x10
float v17; // s0
__int64 v18; // x21
float v19; // s0
float v20; // s0
float v21; // s1
__int64 v22; // x20
__int64 v23; // x21
__int64 v24; // x20
__int64 v25; // x25
int (__cdecl *v26)(const void *, const void *); // x9
int (__cdecl *v27)(const void *, const void *); // x10
int (__cdecl *v28)(const void *, const void *); // x23
__int64 v29; // x21
int v30; // w0
int v31; // w23
double v32; // d0
double *v33; // x0
__int64 v34; // x23
float v35; // s11
__int64 v36; // x22
__int64 v37; // x28
_DWORD *v38; // x24
char v39; // w20
float *v40; // x0
float v41; // s0
float *v42; // x8
float *v43; // x8
float v44; // s1
float v45; // s10
__n128 v46; // q0
int v47; // w0
int v48; // w8
_BOOL4 v49; // w20
double v50; // d10
float v51; // s0
__int64 v52; // x8
float v53; // s0
float v54; // s2
float *v55; // x9
float v56; // s0
int v57; // w8
__int64 v58; // x0
float v59; // s0
float *v60; // x8
float *v61; // x0
float v62; // s0
float *v63; // x8
__int64 v64; // x24
char v65; // w25
__int64 v66; // x0
__int64 v67; // x8
__int64 v68; // x0
_BOOL4 v69; // w0
_BOOL4 v70; // w8
__int64 v71; // x0
__int64 v72; // x8
float v73; // s0
_BOOL4 v74; // w8
float v75; // s1
__int64 v76; // x9
float v77; // s0
__int64 v78; // x9
float v79; // s0
__int64 v80; // x0
__int64 v81; // x8
float v82; // s0
_BOOL4 v83; // w8
double *v84; // x0
__n128 v85; // q0
__int64 v86; // x21
double v87; // d0
double v88; // d1
double v89; // d0
float v90; // [xsp+4h] [xbp-13Ch]
int v91; // [xsp+8h] [xbp-138h]
char v92; // [xsp+Ch] [xbp-134h]
__int64 v93; // [xsp+10h] [xbp-130h]
double v94[2]; // [xsp+38h] [xbp-108h] BYREF
__int64 v95; // [xsp+48h] [xbp-F8h] BYREF
__int64 v96; // [xsp+50h] [xbp-F0h] BYREF
double v97[2]; // [xsp+58h] [xbp-E8h] BYREF
_QWORD v98[2]; // [xsp+68h] [xbp-D8h] BYREF
_QWORD v99[2]; // [xsp+78h] [xbp-C8h] BYREF
_QWORD v100[2]; // [xsp+88h] [xbp-B8h] BYREF
__int64 v101; // [xsp+98h] [xbp-A8h] BYREF
_BYTE v102[4]; // [xsp+A0h] [xbp-A0h] BYREF
_BYTE v103[12]; // [xsp+A4h] [xbp-9Ch] BYREF
if ( (*(_BYTE *)(result + 2424) & 1) != 0 )
return result;
v2 = result;
if ( (*(_BYTE *)(result + 2530) & 1) != 0 || (*(_BYTE *)(result + 1969) & 1) != 0 )
return result;
v4 = *(unsigned __int8 *)(result + 2427);
v5 = *(float *)(result + 2472);
if ( (v4 & 1) != 0 || (*(_BYTE *)(*(_QWORD *)(result + 3016) + 785LL) & 1) != 0 )
{
v6 = 1;
}
else if ( (*(_BYTE *)(result + 2417) & 1) != 0
|| (*(_BYTE *)(result + 2418) & 1) != 0
|| (*(_BYTE *)(result + 2420) & 1) != 0
|| (*(_BYTE *)(result + 2428) & 1) != 0
|| (*(_BYTE *)(result + 2419) & 1) != 0 )
{
v6 = 0;
}
else
{
v6 = *(_BYTE *)(result + 2422) ^ 1;
}
v7 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)result + 1328LL))(result);
sub_1000264D4(&v101, v7);
v8 = sub_1000264D4(v100, (__int64)&v101);
if ( (*(_BYTE *)(v2 + 2427) & 1) != 0 )
{
MaxPortalY = *(float *)(*(__int64 (__fastcall **)(__int64, double))(*(_QWORD *)v2 + 192LL))(v2, v8) + 3000.0;
v10 = 0.0;
if ( (float)(*(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 192LL))(v2) + -3000.0) > 0.0 )
v10 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 192LL))(v2) + -3000.0;
}
else if ( (v6 & 1) != 0 )
{
v10 = 90.0;
if ( (float)(*(float *)((*(__int64 (__fastcall **)(__int64, double))(*(_QWORD *)v2 + 192LL))(v2, v8) + 4) + -3000.0) > 90.0 )
v10 = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 192LL))(v2) + 4) + -3000.0;
MaxPortalY = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 192LL))(v2) + 4) + 3000.0;
}
else
{
GJBaseGameLayer::getMinPortalY(*(_QWORD *)(v2 + 3016));
v10 = v11;
MaxPortalY = GJBaseGameLayer::getMaxPortalY(*(_QWORD *)(v2 + 3016));
}
v12 = v5 * 8.0;
if ( (*(_BYTE *)(v2 + 2423) & 1) != 0 )
{
v13 = 4;
if ( v4 )
v13 = 0;
v14 = 12;
if ( v4 )
v14 = 8;
*(float *)((char *)v100 + v14) = (float)(*(float *)((char *)v100 + v13) - v10) + 2.0;
*(float *)((char *)v100 + v13) = v10;
}
else
{
v15 = 12;
if ( v4 )
v15 = 8;
v16 = 4;
if ( v4 )
v16 = 0;
v17 = *(float *)((char *)v100 + v16) + (float)(*(float *)((char *)v100 + v15) + -2.0);
*(float *)((char *)v100 + v16) = v17;
*(float *)((char *)v100 + v15) = MaxPortalY - v17;
}
sub_1000264D4(v99, (__int64)v100);
if ( v4 )
v18 = 12;
else
v18 = 8;
*(_DWORD *)((char *)v99 + v18) = *(_DWORD *)&v102[v18 - 8];
*((_DWORD *)v99 + v4) = *(_DWORD *)&v102[4 * v4 - 8];
sub_1000264D4(v98, (__int64)v99);
*(float *)((char *)v98 + v18) = *(float *)((char *)v98 + v18) + 4.0;
v19 = *(float *)((char *)v100 + v18);
*(float *)((char *)v99 + v18) = v12;
*((float *)v99 + v4) = *((float *)v99 + v4) + (float)((float)(v19 - v12) * 0.5);
if ( (*(_BYTE *)(v2 + 2832) & 1) != 0 )
{
*(float *)((char *)v100 + v18) = v19 + -2.0;
*((float *)v100 + v4) = *((float *)v100 + v4) + 1.0;
}
else
{
v20 = *(float *)&v102[v18 - 8] * 0.5;
*(float *)((char *)v100 + v18) = v20 + 1.0;
v21 = *(float *)&v102[4 * v4 - 8];
if ( (*(_BYTE *)(v2 + 2426) & 1) != 0 )
{
v20 = v21 - v20;
v21 = -1.0;
}
*((float *)v100 + v4) = v20 + v21;
}
v22 = *(_QWORD *)(v2 + 3016);
sub_1000264D4(v97, (__int64)v100);
v23 = GJBaseGameLayer::staticObjectsInRect(v22, (float *)v97, 1);
v24 = *(_QWORD *)(v2 + 3016);
sub_1000264D4(v97, (__int64)v99);
v25 = GJBaseGameLayer::damagingObjectsInRect(v24, (float *)v97, 1);
v26 = (int (__cdecl *)(const void *, const void *))sub_1002B3FF0;
v27 = (int (__cdecl *)(const void *, const void *))sub_1002B3F28;
if ( *(_BYTE *)(v2 + 2423) )
{
v26 = (int (__cdecl *)(const void *, const void *))sub_1002B4054;
v27 = (int (__cdecl *)(const void *, const void *))sub_1002B3F8C;
}
if ( *(_BYTE *)(v2 + 2427) )
v28 = v26;
else
v28 = v27;
if ( (unsigned int)sub_1002E757C(v23) )
{
if ( !a2 )
goto LABEL_52;
goto LABEL_51;
}
if ( (unsigned int)sub_1002E757C(v25) || (a2 & 1) != 0 )
{
LABEL_51:
v29 = *(_QWORD *)(v2 + 3016);
sub_1000264D4(v97, (__int64)v98);
LOBYTE(a2) = 1;
v23 = GJBaseGameLayer::staticObjectsInRect(v29, (float *)v97, 1);
goto LABEL_52;
}
LOBYTE(a2) = 0;
LABEL_52:
if ( (unsigned int)sub_1002E757C(v23) )
qsort(*(void **)(*(_QWORD *)(v23 + 56) + 16LL), **(unsigned int **)(v23 + 56), 8u, v28);
if ( (unsigned int)sub_1002E757C(v25) )
qsort(*(void **)(*(_QWORD *)(v25 + 56) + 16LL), **(unsigned int **)(v25 + 56), 8u, v28);
v30 = sub_1002E757C(v23);
v31 = v30;
if ( v30 )
{
v91 = v30;
v92 = a2;
v93 = v25;
v90 = v10;
v32 = sub_1000264D4(v97, (__int64)&v101);
v33 = (double *)(*(__int64 (__fastcall **)(__int64, double))(*(_QWORD *)v2 + 192LL))(v2, v32);
sub_1000262F4(&v96, v33);
if ( !(unsigned int)sub_1002E757C(v23) )
{
v35 = 0.0;
LABEL_131:
v45 = 0.0;
goto LABEL_132;
}
v34 = 0;
v35 = 0.0;
if ( v4 )
v36 = 0;
else
v36 = 4;
if ( v4 )
v37 = 8;
else
v37 = 12;
while ( 1 )
{
v38 = (_DWORD *)sub_1002E75A0(v23, v34);
v39 = *(_BYTE *)(v2 + 2423);
v40 = (float *)(*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)v38 + 1328LL))(v38);
if ( (v39 & 1) != 0 )
{
if ( v4 )
{
v41 = sub_10002656C(v40);
v42 = (float *)v102;
}
else
{
v41 = sub_1000265A8((__int64)v40);
v42 = (float *)v103;
}
v44 = *v42 * 0.5;
}
else
{
if ( v4 )
{
v41 = sub_1000265A0((__int64)v40);
v43 = (float *)v102;
}
else
{
v41 = sub_1000265DC((__int64)v40);
v43 = (float *)v103;
}
v44 = *v43 * -0.5;
}
v45 = v41 + v44;
if ( (*(unsigned int (__fastcall **)(_DWORD *))(*(_QWORD *)v38 + 1800LL))(v38) == 25 )
{
(*(void (__fastcall **)(double *__return_ptr, _DWORD *))(*(_QWORD *)v38 + 1360LL))(v94, v38);
if ( *(_BYTE *)(v2 + 2427) == 1 )
PlayerObject::rotateGameplayObject((_QWORD *)v2, (__int64)v38);
v47 = sub_1002FE9C0(v46);
v48 = *(unsigned __int8 *)(v2 + 2423);
v49 = v48 != v47;
if ( v48 != v47 )
{
v50 = sub_1002FEA40(v38, *(float *)&v96);
(*(void (__fastcall **)(__int64 *__return_ptr, _DWORD *))(*(_QWORD *)v38 + 1360LL))(&v95, v38);
v52 = 12;
if ( v4 )
v52 = 8;
v51 = v50 - *((float *)&v95 + 1);
v53 = *(float *)((char *)v94 + v36) + v51;
v54 = -1.0;
if ( *(_BYTE *)(v2 + 2423) )
v54 = 1.0;
v45 = v53 + (float)((float)(*(float *)&v102[v52 - 8] * 0.5) * v54);
}
if ( *(_BYTE *)(v2 + 2427) == 1 )
PlayerObject::unrotateGameplayObject(v2, v38);
}
else
{
v49 = 0;
}
v55 = (float *)&v96 + 1;
if ( v4 )
v55 = (float *)&v96;
v56 = *v55;
if ( (*(_BYTE *)(v2 + 2423) & 1) == 0 )
break;
if ( v45 <= (float)(v56 + 10.0) )
goto LABEL_91;
LABEL_124:
v34 = (unsigned int)(v34 + 1);
if ( (unsigned int)v34 >= (unsigned int)sub_1002E757C(v23) )
goto LABEL_131;
}
if ( v45 < (float)(v56 + -10.0) )
goto LABEL_124;
LABEL_91:
v57 = *(unsigned __int8 *)(v2 + 2832);
if ( (v49 & v57 & 1) == 0 )
{
if ( (v57 & 1) != 0 )
goto LABEL_132;
if ( (*(_BYTE *)(v2 + 2426) & 1) != 0 )
goto LABEL_99;
v58 = (*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)v38 + 1328LL))(v38);
if ( (v4 & 1) != 0 )
{
v59 = sub_1000265DC(v58);
v60 = (float *)&v96 + 1;
}
else
{
v59 = sub_1000265A0(v58);
v60 = (float *)&v96;
}
if ( v59 <= *v60 )
{
if ( (*(_BYTE *)(v2 + 2426) & 1) == 0 )
goto LABEL_132;
LABEL_99:
v61 = (float *)(*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)v38 + 1328LL))(v38);
if ( (v4 & 1) != 0 )
{
v62 = sub_1000265A8((__int64)v61);
v63 = (float *)&v96 + 1;
}
else
{
v62 = sub_10002656C(v61);
v63 = (float *)&v96;
}
if ( v62 >= *v63 )
goto LABEL_132;
}
}
if ( !(unsigned int)sub_1002E757C(v23) )
goto LABEL_132;
v64 = 0;
v65 = 1;
while ( 1 )
{
v66 = sub_1002E75A0(v23, v64);
if ( (_DWORD)v34 != (_DWORD)v64 )
{
v67 = 12;
if ( v4 )
v67 = 8;
*(float *)((char *)v97 + v36) = v45 + (float)(*(float *)&v102[v67 - 8] * -0.5);
v68 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v66 + 1328LL))(v66);
sub_1000264D4(v94, v68);
if ( !v49 )
{
*(float *)((char *)v94 + v37) = *(float *)((char *)v94 + v37) + -4.0;
*(float *)((char *)v94 + v36) = *(float *)((char *)v94 + v36) + 2.0;
}
v69 = sub_100026634((float *)v94, (float *)v97);
if ( v49 && v69 )
{
v65 = 0;
if ( v35 == 0.0 )
{
v35 = v45;
if ( v69 )
goto LABEL_123;
}
else
{
if ( *(_BYTE *)(v2 + 2423) )
v70 = v45 > v35;
else
v70 = v45 < v35;
if ( v70 )
v35 = v45;
if ( v69 )
{
LABEL_123:
if ( (v65 & 1) == 0 )
goto LABEL_124;
LABEL_132:
v25 = v93;
v31 = v91;
LOBYTE(a2) = v92;
LABEL_133:
v73 = 0.0;
if ( *(_BYTE *)(v2 + 2832) )
v73 = v35;
if ( v73 == 0.0 )
{
if ( v45 == 0.0 )
{
v76 = 12;
if ( v4 )
v76 = 8;
v77 = *(float *)&v102[v76 - 8] * 0.5;
if ( (*(_BYTE *)(v2 + 2423) & 1) != 0 )
v45 = v90 + v77;
else
v45 = MaxPortalY - v77;
}
}
else
{
if ( *(_BYTE *)(v2 + 2423) )
v74 = v73 > v45;
else
v74 = v73 < v45;
if ( v74 )
v75 = v73;
else
v75 = v45;
if ( v75 == 0.0 )
v45 = v73;
else
v45 = v75;
}
if ( v31 )
goto LABEL_157;
goto LABEL_166;
}
}
}
else
{
v65 &= !v69;
if ( v69 )
goto LABEL_123;
}
}
v64 = (unsigned int)(v64 + 1);
if ( (unsigned int)v64 >= (unsigned int)sub_1002E757C(v23) )
goto LABEL_123;
}
}
if ( (unsigned int)sub_1002E757C(v25) )
{
v90 = v10;
v71 = sub_1002E75A0(v25, 0);
(*(void (__fastcall **)(double *__return_ptr))(*(_QWORD *)v71 + 1360LL))(v97);
v72 = 4;
if ( v4 )
v72 = 0;
v45 = *(float *)((char *)v97 + v72);
v35 = 0.0;
goto LABEL_133;
}
v78 = 12;
if ( v4 )
v78 = 8;
v79 = *(float *)&v102[v78 - 8] * 0.5;
if ( *(_BYTE *)(v2 + 2423) == 1 )
v45 = v10 + v79;
else
v45 = MaxPortalY - v79;
LABEL_157:
if ( !(unsigned int)sub_1002E757C(v25) )
goto LABEL_166;
v80 = sub_1002E75A0(v25, 0);
(*(void (__fastcall **)(double *__return_ptr))(*(_QWORD *)v80 + 1360LL))(v97);
v81 = 4;
if ( v4 )
v81 = 0;
v82 = *(float *)((char *)v97 + v81);
if ( *(_BYTE *)(v2 + 2423) )
v83 = v82 <= v45;
else
v83 = v82 >= v45;
if ( !v83 )
v45 = v82;
if ( (((unsigned __int8)a2 | v83) & 1) == 0 )
return PlayerObject::spiderTestJumpInternal(v2, 1);
LABEL_166:
v84 = (double *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 192LL))(v2);
sub_1000262F4(v97, v84);
v85.n128_f64[0] = sub_1000262F4(v94, v97);
if ( v4 )
v86 = 0;
else
v86 = 4;
*(float *)((char *)v94 + v86) = v45;
(*(void (__fastcall **)(__int64, double *, __n128))(*(_QWORD *)v2 + 184LL))(v2, v94, v85);
PlayerObject::flipGravity(v2, (*(_BYTE *)(v2 + 2423) & 1) == 0, 1);
v87 = -1.0;
if ( *(_BYTE *)(v2 + 2423) )
v87 = 1.0;
v88 = (double)(int)v87;
if ( v87 != v88 )
v87 = round((v87 - v88) * 1000.0) / 1000.0 + v88;
*(double *)(v2 + 2392) = v87;
*(_BYTE *)(v2 + 1976) = 0;
*(_BYTE *)(v2 + 2365) = 0;
PlayerObject::resetCollisionLog((_QWORD *)v2, 1);
*(_DWORD *)(v2 + v86 + 2608) = *(_DWORD *)((char *)v94 + v86);
*(_QWORD *)(v2 + 2032) = *(_QWORD *)(v2 + 2624);
sub_1000262F4(&v96, v97);
v89 = sub_1000262F4(&v95, v94);
result = PlayerObject::playSpiderDashEffect(v2, &v96, &v95, v89);
if ( (v6 & 1) != 0 )
{
result = *(_QWORD *)(v2 + 3016);
if ( result )
return GJBaseGameLayer::checkCameraLimitAfterTeleport(result, (_BYTE *)v2, 60.0);
}
return result;
}