//
// GJBaseGameLayer::checkCollisions from 0x100282c7c to 0x1002838cc (3152 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::update @ 0x10029ad48
// > GJBaseGameLayer::update @ 0x10029add0
//
// 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:01:56 +0000
//
__int64 __fastcall GJBaseGameLayer::checkCollisions(__int64 a1, __int64 a2, char a3, float a4)
{
_BYTE *v8; // x28
char v9; // w24
char v10; // w26
__n128 v11; // q0
float v12; // s1
float v13; // s13
float v14; // s12
float v15; // s9
float v16; // s9
int v17; // w22
__int64 v18; // x0
int v19; // w23
float MaxPortalY; // s9
float v21; // s0
float v22; // s10
int v23; // w24
float *v24; // x0
float v26; // s11
float v27; // s9
int v28; // w27
double v29; // d10
int v30; // w0
int v31; // w21
float v32; // s10
float *v33; // x0
_BYTE *v34; // x26
float *v35; // x0
float v36; // s10
double v37; // d9
double YVelocity; // d9
int v39; // w21
int v40; // w0
float v41; // s12
float *v42; // x0
float *v43; // x0
float v44; // s9
float v45; // s0
float v46; // s1
int v47; // w21
int v48; // w9
__int64 v49; // x8
__int64 v50; // x12
__int64 v51; // x13
__int64 v52; // x11
unsigned __int64 v53; // x14
int v54; // w11
int v55; // w10
__int64 v56; // x11
__int64 v57; // x21
_QWORD *v58; // x8
__int64 v59; // x8
unsigned __int64 v60; // x9
int v61; // w8
__int64 v62; // x26
unsigned __int64 v63; // x25
__int64 *v64; // x22
unsigned __int64 v65; // x23
__int64 v66; // x0
__int64 v67; // x1
unsigned __int64 v68; // x8
unsigned __int64 v69; // x3
__int64 v70; // x8
__int64 v71; // x9
__int64 v72; // x8
__int64 v73; // x3
char v74; // w26
float *v75; // x22
float v76; // s9
float v77; // s10
float v78; // s11
__n128 v79; // q0
int v80; // w8
float v81; // s12
int v82; // w27
int v83; // w28
__int64 v84; // x23
float *ObjectRectPointer; // x24
__int64 v86; // x0
__int64 v87; // x0
float v88; // s9
float v89; // s10
float v90; // s11
float v91; // s12
__int64 v92; // x21
__int64 v93; // x22
__int64 v94; // x0
float *v95; // x23
float *v96; // x24
float *v97; // x23
_BYTE *v98; // [xsp+0h] [xbp-C0h]
char v99; // [xsp+Ch] [xbp-B4h]
__int64 v100; // [xsp+10h] [xbp-B0h]
int v101; // [xsp+20h] [xbp-A0h]
int v102; // [xsp+2Ch] [xbp-94h]
__int64 v103; // [xsp+30h] [xbp-90h]
bool (__fastcall *v104)(__int64, __int64); // [xsp+38h] [xbp-88h] BYREF
v8 = (_BYTE *)(a1 + 12238);
v9 = *(_BYTE *)(a2 + 1368);
*(_BYTE *)(a2 + 1368) = 0;
sub_1002BB44C(a2);
v10 = 0;
v11.n128_u32[0] = *(_DWORD *)(a2 + 2472);
v12 = *(float *)(a2 + 2640);
if ( v11.n128_f32[0] == 1.0 )
v13 = 0.0;
else
v13 = (float)(v12 * (float)(1.0 - v11.n128_f32[0])) * 0.5;
v14 = v12 * 0.5;
v11.n128_u32[0] = 1119092736;
v15 = (float)(v12 * 0.5) + 90.0;
if ( (*(_BYTE *)(a1 + 785) & 1) == 0 )
{
if ( (PlayerObject::isFlying(a2) & 1) != 0 || (*(_BYTE *)(a2 + 2419) & 1) != 0 || (*(_BYTE *)(a2 + 2422) & 1) != 0 )
v10 = 1;
else
v10 = *(_BYTE *)(a1 + 1010);
}
v16 = v15 - v13;
v17 = *(unsigned __int8 *)(a2 + 3040);
*(_BYTE *)(a2 + 3040) = 0;
if ( (*v8 & 1) != 0 )
{
v11.n128_u32[0] = *(_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2);
if ( v11.n128_f32[0] < -30.0 )
{
*(_QWORD *)(a2 + 2712) = 0;
v18 = (*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)a2 + 192LL))(a2, v11.n128_f32[0]);
sub_1000262BC((float *)&v104, -30.0, *(float *)(v18 + 4));
(*(void (__fastcall **)(__int64, bool (__fastcall **)(__int64, __int64)))(*(_QWORD *)a2 + 184LL))(a2, &v104);
}
goto LABEL_15;
}
if ( *(_BYTE *)(a2 + 2426) != 1
|| (v11.n128_u32[0] = *(_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2),
v11.n128_f32[0] >= -30.0) )
{
LABEL_15:
v19 = 0;
goto LABEL_16;
}
v19 = 1;
LABEL_16:
if ( *(float *)((*(__int64 (__fastcall **)(__int64, __n128))(*(_QWORD *)a2 + 192LL))(a2, v11) + 4) >= v16
|| (v10 & 1) != 0
&& ((PlayerObject::isFlying(a2) & 1) != 0
|| (*(_BYTE *)(a2 + 2419) & 1) != 0
|| (*(_BYTE *)(a1 + 1010) & 1) != 0
|| (*(_BYTE *)(a2 + 2422) & 1) != 0) )
{
if ( *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2) + 4) > (float)(v13
+ *(float *)(a1 + 13640)) )
LABEL_23:
v19 = 1;
}
else
{
if ( *(_BYTE *)(a2 + 2423) == 1 )
{
if ( (unsigned int)sub_1002C0308(a2, 0.1) )
{
v24 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2);
sub_1000262BC((float *)&v104, *v24, v16);
(*(void (__fastcall **)(__int64, bool (__fastcall **)(__int64, __int64)))(*(_QWORD *)a2 + 184LL))(a2, &v104);
PlayerObject::hitGround(a2, 0, 1);
sub_1002C0960(a2, 0, 0);
*(_BYTE *)(a2 + 2500) = 0;
return 0;
}
goto LABEL_23;
}
if ( (*(_BYTE *)(a2 + 2516) & 1) == 0 )
{
v33 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2);
sub_1000262BC((float *)&v104, *v33, v16);
(*(void (__fastcall **)(__int64, bool (__fastcall **)(__int64, __int64)))(*(_QWORD *)a2 + 184LL))(a2, &v104);
PlayerObject::hitGround(a2, 0, 0);
sub_1002C0960(a2, 1, 0);
}
}
if ( (v10 & 1) == 0 || (v9 & 1) != 0 )
goto LABEL_88;
MaxPortalY = GJBaseGameLayer::getMaxPortalY(a1);
GJBaseGameLayer::getMinPortalY(a1);
v22 = v21;
if ( *(_BYTE *)(a2 + 2417) == 1 )
v23 = *(unsigned __int8 *)(a2 + 2365);
else
v23 = 0;
v26 = MaxPortalY - *(float *)(a1 + 1724);
v27 = v13 + (float)(MaxPortalY - v14);
if ( *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2) + 4) <= v27 )
{
v32 = (float)(v14 + v22) - v13;
if ( *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2) + 4) >= v32 )
{
LABEL_88:
v28 = v19;
goto LABEL_89;
}
if ( *(_BYTE *)(a2 + 2409) != 1
|| *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2) + 4) >= (float)(v32 - v14) )
{
if ( (unsigned int)sub_1002C838C(a2) && *(_BYTE *)(a2 + 2423) == 1 )
{
v28 = 1;
if ( !(unsigned int)sub_1002C9F58(a2) )
goto LABEL_89;
}
else
{
v28 = 0;
}
YVelocity = PlayerObject::getYVelocity(a2);
if ( (*(_BYTE *)(a2 + 2423) & 1) != 0 )
{
v39 = 0;
}
else
{
v40 = sub_1002C62E4(a2);
if ( v26 == 0.0 )
v39 = 0;
else
v39 = v40;
}
v41 = 0.0;
if ( (v28 & 1) == 0 && (sub_1002C62E4(a2) & 1) == 0 && *(float *)(a1 + 424) != *(float *)(a1 + 428) )
v41 = 1.0;
v34 = (_BYTE *)(a2 + 2409);
v42 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2);
sub_1000262BC((float *)&v104, *v42, v32 + v41);
(*(void (__fastcall **)(__int64, bool (__fastcall **)(__int64, __int64)))(*(_QWORD *)a2 + 184LL))(a2, &v104);
if ( v28 )
{
sub_1002C9FB4(a2);
}
else if ( (*(_BYTE *)(a2 + 2417) & 1) == 0 && *(_BYTE *)(a2 + 2428) != 1 || PlayerObject::getYVelocity(a2) < 0.0 )
{
PlayerObject::hitGround(a2, 0, *(unsigned __int8 *)(a2 + 2423));
}
v36 = YVelocity;
sub_1002C0960(a2, *(unsigned __int8 *)(a2 + 2423) ^ 1u, 0);
if ( v39 )
{
v37 = v36;
if ( PlayerObject::getYVelocity(a2) > v36 )
goto LABEL_86;
}
if ( (*(_BYTE *)(a2 + 2423) & (unsigned __int8)v23 & 1) == 0 || v26 >= 0.0 )
goto LABEL_87;
goto LABEL_85;
}
LABEL_45:
v28 = 1;
goto LABEL_89;
}
if ( *(_BYTE *)(a2 + 2409) == 1
&& *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2) + 4) > (float)(v14 + v27) )
{
goto LABEL_45;
}
if ( !(unsigned int)sub_1002C838C(a2) || (*(_BYTE *)(a2 + 2423) & 1) != 0 )
{
v28 = 0;
LABEL_38:
v29 = PlayerObject::getYVelocity(a2);
if ( *(_BYTE *)(a2 + 2423) == 1 )
{
v30 = sub_1002C62E4(a2);
if ( v26 == 0.0 )
v31 = 0;
else
v31 = v30;
}
else
{
v31 = 0;
}
v34 = (_BYTE *)(a2 + 2409);
v35 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2);
sub_1000262BC((float *)&v104, *v35, v27);
(*(void (__fastcall **)(__int64, bool (__fastcall **)(__int64, __int64)))(*(_QWORD *)a2 + 184LL))(a2, &v104);
if ( v28 )
{
sub_1002C9FB4(a2);
}
else if ( PlayerObject::getYVelocity(a2) > 0.0 )
{
PlayerObject::hitGround(a2, 0, (*(_BYTE *)(a2 + 2423) & 1) == 0);
}
v36 = v29;
sub_1002C0960(a2, *(unsigned __int8 *)(a2 + 2423), 0);
if ( v31 )
{
v37 = v36;
if ( PlayerObject::getYVelocity(a2) < v36 )
goto LABEL_86;
}
if ( (v23 & ~*(unsigned __int8 *)(a2 + 2423) & 1) == 0 || v26 <= 0.0 )
goto LABEL_87;
LABEL_85:
v37 = v36;
LABEL_86:
PlayerObject::setYVelocity(a2, 0, v37);
LABEL_87:
*v34 = 0;
goto LABEL_88;
}
v28 = 1;
if ( (unsigned int)sub_1002C9F58(a2) )
goto LABEL_38;
LABEL_89:
if ( v28 && v17 )
{
if ( (a3 & 1) == 0 )
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)a1 + 1296LL))(a1, a2, 0);
return 1;
}
*(_BYTE *)(a2 + 3040) = v28;
v43 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2);
v44 = 0.0;
v45 = 0.0;
if ( *v43 > 0.0 )
{
v46 = *(float *)(*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)a2 + 192LL))(a2, 0.0);
if ( v46 >= 10000000.0 )
v45 = *(float *)(a1 + 13632) * 10000000.0;
else
v45 = *(float *)(*(__int64 (__fastcall **)(__int64, float, float))(*(_QWORD *)a2 + 192LL))(a2, 10000000.0, v46)
* *(float *)(a1 + 13632);
}
v47 = (int)v45;
if ( *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2) + 4) > 0.0 )
{
if ( *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2) + 4) >= 10000000.0 )
v44 = *(float *)(a1 + 13636) * 10000000.0;
else
v44 = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2) + 4) * *(float *)(a1 + 13636);
}
v98 = v8;
v99 = a3;
v48 = (int)v44;
if ( v47 <= 1 )
v49 = 1;
else
v49 = (unsigned int)v47;
v50 = *(_QWORD *)(a1 + 13400);
v51 = *(_QWORD *)(a1 + 13392);
v52 = (v50 - v51) >> 3;
v53 = v52 - 1;
v54 = v52 - 1;
if ( v53 >= v47 + 1 )
v55 = v47 + 1;
else
v55 = v54;
if ( v48 <= 1 )
v56 = 1;
else
v56 = (unsigned int)v48;
*(_DWORD *)(a1 + 12452) = 0;
*(_DWORD *)(a1 + 12488) = 0;
if ( v50 != v51 && (int)v49 - 1 <= v55 )
{
v102 = v56 - 1;
v101 = v48 + 1;
v100 = v56 - 1;
v57 = v49 - 1;
v103 = (unsigned int)(v55 + 1);
do
{
v58 = *(_QWORD **)(*(_QWORD *)(a1 + 13392) + 8 * v57);
if ( v58 )
{
v59 = (__int64)(v58[1] - *v58) >> 3;
v60 = v59 - 1;
v61 = v59 - 1;
if ( v60 >= v101 )
v61 = v101;
if ( v102 <= v61 )
{
v62 = (unsigned int)(v61 + 1);
v63 = v100;
do
{
v64 = *(__int64 **)(**(_QWORD **)(*(_QWORD *)(a1 + 13392) + 8 * v57) + 8 * v63);
if ( v64 )
{
v65 = *(int *)(**(_QWORD **)(*(_QWORD *)(a1 + 13560) + 8 * v57) + 4 * v63);
if ( (*(_QWORD *)(**(_QWORD **)(*(_QWORD *)(a1 + 13608) + 8 * v57) + 8 * (v63 >> 6)) & (1LL << v63)) != 0 )
{
v66 = *v64;
v67 = *v64 + 8 * v65;
v104 = sub_100273F1C;
v68 = 126 - 2 * __clz(v65);
if ( (_DWORD)v65 )
v69 = v68;
else
v69 = 0;
sub_1002A77D8(v66, v67, &v104, v69, 1);
if ( (int)v65 >= 1 )
{
v70 = 0;
v71 = *v64;
do
{
*(_DWORD *)(*(_QWORD *)(v71 + 8 * v70) + 624LL) = v70;
++v70;
}
while ( v65 != v70 );
}
v72 = **(_QWORD **)(*(_QWORD *)(a1 + 13608) + 8 * v57);
*(_QWORD *)(v72 + 8 * (v63 >> 6)) &= ~(1LL << v63);
}
GJBaseGameLayer::collisionCheckObjects(a1, a2, v64, v65, a4);
}
++v63;
}
while ( v63 != v62 );
}
}
++v57;
}
while ( v57 != v103 );
}
v73 = *(unsigned int *)(a1 + 13464);
if ( (int)v73 >= 1 )
GJBaseGameLayer::collisionCheckObjects(a1, a2, a1 + 13440, v73, a4);
if ( *(_QWORD *)(a2 + 1536) )
v74 = *(_BYTE *)(a2 + 1624);
else
v74 = 0;
v75 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 1328LL))(a2);
v76 = sub_10002656C(v75);
v77 = sub_1000265A0((__int64)v75);
v78 = sub_1000265A8((__int64)v75);
v79.n128_f32[0] = sub_1000265DC((__int64)v75);
v80 = *(_DWORD *)(a1 + 12452);
if ( v80 >= 1 )
{
v81 = v79.n128_f32[0];
v82 = 0;
v83 = -1;
do
{
v84 = *(_QWORD *)(*(_QWORD *)(a1 + 12464) + 8LL * (v80 + v83));
if ( (GameObject::getGroupDisabled(v84) & 1) == 0 )
{
ObjectRectPointer = (float *)GameObject::getObjectRectPointer(v84);
if ( (v74 & 1) != 0 )
v74 = *(__int16 *)(v84 + 1168) < 1 ? 1 : sub_1002BCEF8(a2, v84, a4) ^ 1;
else
v74 = 0;
v79.n128_f32[0] = sub_1000265A0((__int64)ObjectRectPointer);
if ( v76 >= v79.n128_f32[0] )
{
v79.n128_f32[0] = sub_10002656C(ObjectRectPointer);
if ( v79.n128_f32[0] >= v77 )
{
v79.n128_f32[0] = sub_1000265DC((__int64)ObjectRectPointer);
if ( v78 >= v79.n128_f32[0] )
{
v79.n128_f32[0] = sub_1000265A8((__int64)ObjectRectPointer);
if ( v79.n128_f32[0] >= v81 )
{
PlayerObject::collidedWithObject_1(a2, v84, a4);
v86 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 1328LL))(a2);
sub_1000264EC(v75, v86);
v76 = sub_10002656C(v75);
v77 = sub_1000265A0((__int64)v75);
v78 = sub_1000265A8((__int64)v75);
v79.n128_f32[0] = sub_1000265DC((__int64)v75);
v81 = v79.n128_f32[0];
}
}
}
}
}
++v82;
v80 = *(_DWORD *)(a1 + 12452);
--v83;
}
while ( v82 < v80 );
}
if ( (*(_BYTE *)(*(_QWORD *)(a1 + 3256) + 2424LL) & 1) != 0 )
PlayerObject::removePlacedCheckpoint(v79);
v87 = (*(__int64 (__fastcall **)(__int64, __n128))(*(_QWORD *)a2 + 1328LL))(a2, v79);
sub_1000264EC(v75, v87);
v88 = sub_10002656C(v75);
v89 = sub_1000265A0((__int64)v75);
v90 = sub_1000265A8((__int64)v75);
v91 = sub_1000265DC((__int64)v75);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a2 + 1568LL))(a2);
if ( *(int *)(a1 + 12488) < 1 )
{
LABEL_170:
PlayerObject::postCollision(a2, (unsigned __int8)v98[1706], a4);
return 0;
}
v92 = 0;
while ( 1 )
{
v93 = *(_QWORD *)(*(_QWORD *)(a1 + 12496) + 8 * v92);
if ( (GameObject::getGroupDisabled(v93) & 1) != 0 )
goto LABEL_155;
v94 = GameObject::getObjectRectPointer(v93);
if ( *(float *)(v93 + 900) <= 0.0 )
break;
if ( (GJBaseGameLayer::playerCircleCollision(a1) & 1) != 0 )
goto LABEL_159;
LABEL_155:
if ( ++v92 >= *(int *)(a1 + 12488) )
goto LABEL_170;
}
v97 = (float *)v94;
if ( v88 < sub_1000265A0(v94)
|| sub_10002656C(v97) < v89
|| v90 < sub_1000265DC((__int64)v97)
|| sub_1000265A8((__int64)v97) < v91 )
{
goto LABEL_155;
}
LABEL_159:
if ( *(_BYTE *)(v93 + 744) == 1 && (*(_BYTE *)(*(_QWORD *)(a1 + 3272) + 455LL) != 1 || *(float *)(v93 + 900) <= 0.0) )
{
v95 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v93 + 1560LL))(v93);
v96 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 1560LL))(a2);
if ( !OBB2D::overlaps1Way((__int64)v95, v96) || !OBB2D::overlaps1Way((__int64)v96, v95) )
goto LABEL_155;
}
if ( (v99 & 1) == 0 )
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 1296LL))(a1, a2, v93);
return 1;
}