//
// GJBaseGameLayer::staticObjectsInRect from 0x99c494 to 0x99c988 (1268 bytes)
//
// 9 xrefs:
// > PlayerObject::postCollision @ 0x762688
// > PlayerObject::postCollision @ 0x762890
// > PlayerObject::spiderTestJumpInternal @ 0x762c78
// > PlayerObject::spiderTestJumpInternal @ 0x762cf4
// > PlayerObject::spiderTestJumpY @ 0x7649c4
// > PlayerObject::spiderTestJumpY @ 0x764a18
// > PlayerObject::spiderTestJumpX @ 0x7654b0
// > PlayerObject::spiderTestJumpX @ 0x765504
// > ??> @ 0x89f38
//
// 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 12:58:05 +0000
//
cocos2d::CCArray *__fastcall GJBaseGameLayer::staticObjectsInRect(__int64 a1, float *a2, unsigned __int8 a3)
{
int v5; // w21
float v6; // s2
float v7; // s0
_BOOL4 v8; // w0
float v9; // s2
__int64 v10; // x19
__int64 v11; // x25
float v12; // s1
float v13; // s0
float v14; // s0
float v16; // s0
float v17; // s1
_BOOL4 v18; // w0
_QWORD *v19; // x19
__int64 v20; // x0
unsigned __int64 v21; // x1
int v22; // w0
int v23; // w24
__int64 v24; // x25
_QWORD *v25; // x20
int v26; // w19
__int64 v27; // x27
__int64 v28; // x19
cocos2d::CCObject *v29; // x26
const cocos2d::CCRect *v30; // x0
int v31; // [xsp+84h] [xbp+84h]
int v32; // [xsp+88h] [xbp+88h]
int v33; // [xsp+8Ch] [xbp+8Ch]
cocos2d::CCArray *v34; // [xsp+90h] [xbp+90h]
int v35; // [xsp+98h] [xbp+98h]
int i; // [xsp+9Ch] [xbp+9Ch]
__int64 v37; // [xsp+A0h] [xbp+A0h]
__int64 v38; // [xsp+A8h] [xbp+A8h]
_BYTE v39[16]; // [xsp+B8h] [xbp+B8h] BYREF
v5 = a3;
v34 = (cocos2d::CCArray *)cocos2d::CCArray::create(_stack_chk_guard);
v6 = *a2;
if ( *a2 > 0.0
&& ((v7 = *(float *)(a1 + 13632), v6 < 10000000.0)
? (v8 = (float)((float)(v6 * v7) + -1.0) > 0.0)
: (v8 = (float)((float)(v7 * 10000000.0) + -1.0) > 0.0),
v8) )
{
if ( v6 <= 0.0 )
{
v35 = -1;
}
else
{
if ( v6 >= 10000000.0 )
{
v9 = v6 + a2[2];
v35 = (int)(float)((float)(v7 * 10000000.0) + -1.0);
if ( v9 <= 0.0 )
goto LABEL_8;
goto LABEL_15;
}
v35 = (int)(float)((float)(v6 * v7) + -1.0);
}
}
else
{
v35 = 0;
}
v9 = v6 + a2[2];
if ( v9 <= 0.0 )
{
LABEL_8:
v10 = *(_QWORD *)(a1 + 13392);
v11 = *(_QWORD *)(a1 + 13400);
v12 = (float)(unsigned __int64)(((v11 - v10) >> 3) - 1);
if ( v12 >= 1.0 )
goto LABEL_9;
goto LABEL_17;
}
LABEL_15:
v16 = *(float *)(a1 + 13632);
if ( v9 >= 10000000.0 )
{
v10 = *(_QWORD *)(a1 + 13392);
v11 = *(_QWORD *)(a1 + 13400);
v12 = (float)(unsigned __int64)(((v11 - v10) >> 3) - 1);
if ( (float)((float)(v16 * 10000000.0) + 1.0) > v12 )
goto LABEL_17;
}
else
{
v10 = *(_QWORD *)(a1 + 13392);
v11 = *(_QWORD *)(a1 + 13400);
v12 = (float)(unsigned __int64)(((v11 - v10) >> 3) - 1);
if ( (float)((float)(v9 * v16) + 1.0) > v12 )
{
LABEL_17:
v33 = (int)v12;
goto LABEL_18;
}
}
if ( v9 <= 0.0 )
{
LABEL_9:
v13 = a2[1];
v33 = 1;
if ( v13 <= 0.0 )
goto LABEL_10;
goto LABEL_19;
}
if ( v9 < 10000000.0 )
v33 = (int)(float)((float)(v9 * v16) + 1.0);
else
v33 = (int)(float)((float)(v16 * 10000000.0) + 1.0);
LABEL_18:
v13 = a2[1];
if ( v13 <= 0.0 )
goto LABEL_10;
LABEL_19:
v17 = *(float *)(a1 + 13636);
if ( v13 < 10000000.0 )
v18 = (float)((float)(v13 * v17) + -1.0) > 0.0;
else
v18 = (float)((float)(v17 * 10000000.0) + -1.0) > 0.0;
if ( !v18 )
{
LABEL_10:
v32 = 0;
v14 = v13 + a2[3];
if ( v14 <= 0.0 )
goto LABEL_11;
goto LABEL_26;
}
if ( v13 <= 0.0 )
{
v32 = -1;
}
else if ( v13 < 10000000.0 )
{
v32 = (int)(float)((float)(v13 * v17) + -1.0);
}
else
{
v32 = (int)(float)((float)(v17 * 10000000.0) + -1.0);
}
v14 = v13 + a2[3];
if ( v14 <= 0.0 )
{
LABEL_11:
v31 = 1;
if ( v10 == v11 )
return v34;
goto LABEL_29;
}
LABEL_26:
if ( v14 < 10000000.0 )
v31 = (int)(float)((float)(v14 * *(float *)(a1 + 13636)) + 1.0);
else
v31 = (int)(float)((float)(*(float *)(a1 + 13636) * 10000000.0) + 1.0);
if ( v10 != v11 )
{
LABEL_29:
if ( v35 > v33 )
return v34;
v37 = 8LL * v35;
v19 = *(_QWORD **)(v10 + v37);
if ( !v19 )
goto LABEL_59;
LABEL_31:
v20 = (__int64)(v19[1] - *v19) >> 3;
v21 = v20 - 1;
v22 = v20 - 1;
if ( v31 <= v21 )
v22 = v31;
for ( i = v22; v32 > i; i = -1 )
{
LABEL_57:
v37 += 8;
if ( v33 < ++v35 )
return v34;
v19 = *(_QWORD **)(*(_QWORD *)(a1 + 13392) + v37);
if ( v19 )
goto LABEL_31;
LABEL_59:
;
}
v23 = v32;
v24 = 8LL * v32;
v38 = 4LL * v32;
while ( 1 )
{
v25 = *(_QWORD **)(*v19 + v24);
if ( v25 )
{
v26 = *(_DWORD *)(**(_QWORD **)(*(_QWORD *)(a1 + 13560) + v37) + v38);
if ( v26 > 0 )
break;
}
LABEL_45:
++v23;
v24 += 8;
v38 += 4;
if ( i < v23 )
goto LABEL_57;
v19 = *(_QWORD **)(*(_QWORD *)(a1 + 13392) + v37);
}
v27 = 0;
v28 = 8 * ((unsigned int)(v26 - 1) + 1LL);
while ( 1 )
{
v29 = *(cocos2d::CCObject **)(*v25 + v27);
if ( *((_BYTE *)v29 + 773) )
{
if ( (*(unsigned int (__fastcall **)(_QWORD))(*(_QWORD *)v29 + 1800LL))(*(_QWORD *)(*v25 + v27)) )
goto LABEL_54;
}
else
{
if ( !v5 || (unsigned __int8)GameObject::getGroupDisabled(*(GameObject **)(*v25 + v27)) )
goto LABEL_40;
if ( (*(unsigned int (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v29 + 1800LL))(v29) )
{
LABEL_54:
if ( (*(unsigned int (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v29 + 1800LL))(v29) != 25
&& (*(unsigned int (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v29 + 1800LL))(v29) != 21 )
{
goto LABEL_40;
}
}
}
v30 = (const cocos2d::CCRect *)(*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v29 + 1328LL))(v29);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v39, v30);
if ( (unsigned __int8)cocos2d::CCRect::intersectsRect((cocos2d::CCRect *)a2, (const cocos2d::CCRect *)v39) )
{
v27 += 8;
cocos2d::CCArray::addObject(v34, v29);
if ( v27 == v28 )
goto LABEL_45;
}
else
{
LABEL_40:
v27 += 8;
if ( v27 == v28 )
goto LABEL_45;
}
}
}
return v34;
}