//
// GJBaseGameLayer::damagingObjectsInRect from 0x100280530 to 0x100280920 (1008 bytes)
//
// 1 xrefs:
// > PlayerObject::spiderTestJumpInternal @ 0x1002c1a18
//
// 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:55 +0000
//
__int64 __fastcall GJBaseGameLayer::damagingObjectsInRect(__int64 a1, float *a2, int a3)
{
double v6; // d0
__int64 updated; // x0
float v8; // s0
float v9; // s1
float v10; // s1
int v11; // w8
float v12; // s1
float v13; // s0
float v14; // s0
float v15; // s2
__int64 v16; // x9
__int64 v17; // x10
float v18; // s0
float v19; // s0
float v20; // s0
float v21; // s1
float v22; // s2
float v23; // s2
float v24; // s2
float v25; // s1
float v26; // s1
__int64 v27; // x28
_QWORD *v28; // x8
__int64 v29; // x9
int v30; // w8
__int64 v31; // x25
_QWORD *v32; // x27
__int64 v33; // x8
__int64 v34; // x26
__int64 v35; // x22
float *v36; // x23
__int64 v37; // x0
float ObjectRadius; // s8
float *v39; // x24
int v41; // [xsp+18h] [xbp-B8h]
int v42; // [xsp+24h] [xbp-ACh]
int v43; // [xsp+28h] [xbp-A8h]
int v44; // [xsp+34h] [xbp-9Ch]
__int64 v45; // [xsp+38h] [xbp-98h]
__int64 v46; // [xsp+40h] [xbp-90h] BYREF
__int64 v47; // [xsp+48h] [xbp-88h] BYREF
__int64 v48; // [xsp+58h] [xbp-78h] BYREF
float v49[4]; // [xsp+60h] [xbp-70h] BYREF
v6 = sub_1000264D4(v49, (__int64)a2);
updated = GJBaseGameLayer::updateOBB2(a1, v49, v6);
v45 = sub_1002E736C(updated);
v8 = *a2;
if ( *a2 <= 0.0
|| ((v9 = *(float *)(a1 + 13632), v8 >= 10000000.0) ? (v10 = v9 * 10000000.0) : (v10 = v8 * v9),
(float)(v10 + -1.0) <= 0.0) )
{
v11 = 0;
}
else
{
v11 = (int)(float)(v10 + -1.0);
}
v12 = v8 + a2[2];
v13 = 0.0;
if ( v12 > 0.0 )
{
v14 = *(float *)(a1 + 13632);
if ( v12 >= 10000000.0 )
v13 = v14 * 10000000.0;
else
v13 = v12 * v14;
}
v15 = v13 + 1.0;
v16 = *(_QWORD *)(a1 + 13400);
v17 = *(_QWORD *)(a1 + 13392);
v18 = (float)(unsigned __int64)(((v16 - v17) >> 3) - 1);
if ( v15 <= v18 )
{
v19 = 0.0;
if ( v12 > 0.0 )
{
v20 = *(float *)(a1 + 13632);
if ( v12 >= 10000000.0 )
v19 = v20 * 10000000.0;
else
v19 = v12 * v20;
}
v18 = v19 + 1.0;
}
v21 = a2[1];
if ( v21 <= 0.0
|| ((v22 = *(float *)(a1 + 13636), v21 >= 10000000.0) ? (v23 = v22 * 10000000.0) : (v23 = v21 * v22),
(float)(v23 + -1.0) <= 0.0) )
{
v43 = 0;
}
else
{
v43 = (int)(float)(v23 + -1.0);
}
v24 = v21 + a2[3];
v25 = 0.0;
if ( v24 > 0.0 )
{
v26 = *(float *)(a1 + 13636);
if ( v24 >= 10000000.0 )
v25 = v26 * 10000000.0;
else
v25 = v24 * v26;
}
if ( v17 != v16 && v11 <= (int)v18 )
{
v41 = (int)(float)(v25 + 1.0);
v27 = v11;
v42 = (int)v18 + 1;
while ( 1 )
{
v28 = *(_QWORD **)(*(_QWORD *)(a1 + 13392) + 8 * v27);
if ( v28 )
{
v29 = v28[1] - *v28;
v30 = v41;
if ( (v29 >> 3) - 1 < (unsigned __int64)v41 )
v30 = ((unsigned __int64)v29 >> 3) - 1;
}
else
{
v30 = -1;
}
if ( v43 <= v30 )
break;
LABEL_57:
if ( v42 == (_DWORD)++v27 )
return v45;
}
v44 = v30 + 1;
v31 = v43;
while ( 1 )
{
v32 = *(_QWORD **)(**(_QWORD **)(*(_QWORD *)(a1 + 13392) + 8 * v27) + 8 * v31);
if ( v32 )
{
v33 = *(unsigned int *)(**(_QWORD **)(*(_QWORD *)(a1 + 13560) + 8 * v27) + 4 * v31);
if ( (int)v33 >= 1 )
break;
}
LABEL_56:
if ( v44 == (_DWORD)++v31 )
goto LABEL_57;
}
v34 = 0;
v35 = 8 * v33;
while ( 1 )
{
v36 = *(float **)(*v32 + v34);
if ( (*(unsigned int (__fastcall **)(float *))(*(_QWORD *)v36 + 1800LL))(v36) != 2
&& (*(unsigned int (__fastcall **)(float *))(*(_QWORD *)v36 + 1800LL))(v36) != 47
|| (*((_BYTE *)v36 + 773) & 1) == 0 && (!a3 || (GameObject::getGroupDisabled(v36) & 1) != 0) )
{
goto LABEL_55;
}
v37 = (*(__int64 (__fastcall **)(float *))(*(_QWORD *)v36 + 1328LL))(v36);
sub_1000264D4(v49, v37);
if ( v36[225] <= 0.0 )
{
if ( !sub_100026634(a2, v49) )
goto LABEL_55;
if ( *((_BYTE *)v36 + 744) == 1 )
{
v39 = (float *)(*(__int64 (__fastcall **)(float *))(*(_QWORD *)v36 + 1560LL))(v36);
if ( !OBB2D::overlaps1Way((__int64)v39, *(float **)(a1 + 2080))
|| !OBB2D::overlaps1Way(*(_QWORD *)(a1 + 2080), v39) )
{
goto LABEL_55;
}
}
}
else
{
ObjectRadius = GameObject::getObjectRadius(v36);
(*(void (__fastcall **)(__int64 *__return_ptr, float *))(*(_QWORD *)v36 + 1360LL))(&v48, v36);
sub_1000264D4(&v47, (__int64)a2);
sub_1000262F4(&v46, (double *)&v48);
if ( !(unsigned int)GJBaseGameLayer::rectIntersectsCircle(ObjectRadius) )
goto LABEL_55;
}
sub_1002E74E0(v45, v36);
LABEL_55:
v34 += 8;
if ( v35 == v34 )
goto LABEL_56;
}
}
return v45;
}