//
// GJBaseGameLayer::staticObjectsInRect from 0x46e248 to 0x46e5b8 (880 bytes)
//
// 8 xrefs:
// > PlayerObject::spiderTestJumpInternal @ 0x348de4
// > PlayerObject::spiderTestJumpInternal @ 0x348e70
// > PlayerObject::spiderTestJumpY @ 0x34a3b2
// > PlayerObject::spiderTestJumpY @ 0x34a3f2
// > PlayerObject::spiderTestJumpX @ 0x34ac52
// > PlayerObject::spiderTestJumpX @ 0x34ac92
// > PlayerObject::postCollision @ 0x34cacc
// > PlayerObject::postCollision @ 0x34cd9e
//
// 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
//
cocos2d::CCArray *GJBaseGameLayer::staticObjectsInRect(GJBaseGameLayer *a1, cocos2d::CCRect a2, bool a3)
{
float v3; // s12
float v4; // s13
float x; // r7
cocos2d::CCArray *v7; // r0
float v8; // s14
float *p_m_sectionXFactor; // r3
float m_sectionXFactor; // s12
float v11; // s11
int v12; // r4
float v13; // s13
float v14; // s13
float v15; // s16
float v16; // s14
float *v17; // r3
float v18; // s13
std::vector *, std::allocator *>> *, std::allocator *, std::allocator *>> *>> *p_m_nonEffectObjects; // r8
std::vector *, std::allocator *>> **m_start; // r1
std::vector *, std::allocator *>> **m_finish; // r2
int v22; // s13
float v23; // s17
float v24; // s14
float *v25; // r3
int v26; // s17
float v27; // s14
float *p_m_sectionYFactor; // r6
float m_sectionYFactor; // s12
float v30; // s11
int v31; // r3
float v32; // s13
float v33; // s12
float v34; // s13
float v35; // s14
float v36; // s13
float *v37; // r3
unsigned int v38; // s16
int v40; // r6
std::vector *, std::allocator *>> *p_m_nonEffectObjectsSizes; // r5
std::vector *, std::allocator *>> *v42; // r2
unsigned int v43; // r3
int v44; // r10
int v45; // r9
GameObject *v46; // r11
const cocos2d::CCRect *v47; // r0
int v48; // [sp+0h] [bp-44h]
int i; // [sp+4h] [bp-40h]
signed int v50; // [sp+8h] [bp-3Ch]
cocos2d::CCArray *v51; // [sp+Ch] [bp-38h]
std::vector *v52; // [sp+10h] [bp-34h]
int v53; // [sp+1Ch] [bp-28h]
float y; // [sp+20h] [bp-24h]
cocos2d::CCRect v55; // [sp+2Ch] [bp-18h] BYREF
x = a2.origin.x;
y = a2.origin.y;
v7 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)a1);
v8 = *(float *)LODWORD(x);
v51 = v7;
if ( *(float *)LODWORD(x) <= 0.0 )
{
v12 = 0;
}
else
{
v4 = 10000000.0;
p_m_sectionXFactor = &a1->m_sectionXFactor;
m_sectionXFactor = a1->m_sectionXFactor;
if ( v8 < 10000000.0 )
v11 = (float)(v8 * m_sectionXFactor) - 1.0;
else
v11 = (float)(m_sectionXFactor * 10000000.0) - 1.0;
v12 = v11 > 0.0;
v3 = v11;
if ( v11 > 0.0 )
{
if ( v8 <= 0.0 )
{
v12 = -1;
}
else
{
if ( v8 < 10000000.0 )
v13 = *p_m_sectionXFactor;
else
v13 = 10000000.0;
if ( v8 < 10000000.0 )
{
v3 = 1.0;
}
else
{
v11 = 1.0;
v3 = *p_m_sectionXFactor;
}
if ( v8 < 10000000.0 )
v3 = (float)(v8 * v13) - v3;
else
v11 = (float)(v3 * v13) - v11;
if ( v8 < 10000000.0 )
v14 = v3;
else
v14 = v11;
LODWORD(v4) = (int)v14;
v12 = LODWORD(v4);
}
}
}
v15 = v8 + *(float *)(LODWORD(x) + 8);
if ( v15 <= 0.0 )
{
v16 = 1.0;
}
else
{
v16 = 10000000.0;
v17 = &a1->m_sectionXFactor;
if ( v15 < 10000000.0 )
{
v16 = *v17;
v4 = 1.0;
}
else
{
v3 = 1.0;
}
if ( v15 < 10000000.0 )
v18 = v4 + (float)(v15 * v16);
else
v18 = *v17;
if ( v15 < 10000000.0 )
v16 = v18;
else
v3 = v3 + (float)(v18 * v16);
if ( v15 >= 10000000.0 )
v16 = v3;
}
p_m_nonEffectObjects = &a1->m_nonEffectObjects;
m_start = a1->m_nonEffectObjects.m_start;
m_finish = a1->m_nonEffectObjects.m_finish;
v22 = m_finish - m_start - 1;
v23 = (float)(unsigned int)v22;
if ( v16 > (float)(unsigned int)v22 )
goto LABEL_44;
if ( v15 > 0.0 )
{
v24 = 10000000.0;
v25 = &a1->m_sectionXFactor;
if ( v15 < 10000000.0 )
v24 = *v25;
else
v22 = *(int *)v25;
if ( v15 < 10000000.0 )
v23 = (float)(v15 * v24) + 1.0;
else
v23 = (float)(*(float *)&v22 * v24) + 1.0;
LABEL_44:
v26 = (int)v23;
goto LABEL_46;
}
v26 = 1;
LABEL_46:
v27 = *(float *)(LODWORD(x) + 4);
if ( v27 <= 0.0 )
{
v31 = 0;
}
else
{
p_m_sectionYFactor = &a1->m_sectionYFactor;
m_sectionYFactor = a1->m_sectionYFactor;
if ( v27 < 10000000.0 )
v30 = (float)(v27 * m_sectionYFactor) - 1.0;
else
v30 = (float)(m_sectionYFactor * 10000000.0) - 1.0;
v31 = v30 > 0.0;
if ( v30 > 0.0 )
{
if ( v27 > 0.0 )
{
if ( v27 < 10000000.0 )
v32 = *p_m_sectionYFactor;
else
v32 = 10000000.0;
if ( v27 < 10000000.0 )
{
v33 = 1.0;
}
else
{
v30 = 1.0;
v33 = *p_m_sectionYFactor;
}
if ( v27 < 10000000.0 )
v33 = (float)(v27 * v32) - v33;
else
v30 = (float)(v33 * v32) - v30;
if ( v27 < 10000000.0 )
v34 = v33;
else
v34 = v30;
v48 = (int)v34;
goto LABEL_68;
}
v31 = -1;
}
}
v48 = v31;
LABEL_68:
v35 = v27 + *(float *)(LODWORD(x) + 12);
if ( v35 <= 0.0 )
{
v38 = 1;
}
else
{
v36 = 10000000.0;
v37 = &a1->m_sectionYFactor;
if ( v35 < 10000000.0 )
v36 = *v37;
else
v35 = *v37;
v38 = (int)(float)((float)(v35 * v36) + 1.0);
}
if ( m_start != m_finish )
{
v40 = v12;
p_m_nonEffectObjectsSizes = &a1->m_nonEffectObjectsSizes;
while ( v12 <= v26 )
{
v42 = p_m_nonEffectObjects->m_start[v40];
if ( v42 )
{
v43 = v42->m_finish - v42->m_start - 1;
if ( v43 >= v38 )
v43 = v38;
}
else
{
v43 = -1;
}
v50 = v43;
v44 = v48;
for ( i = v48; i <= v50; ++i )
{
v52 = p_m_nonEffectObjects->m_start[v40]->m_start[v44];
if ( v52 )
{
v45 = 0;
v53 = p_m_nonEffectObjectsSizes->m_start[v40]->m_start[v44];
while ( v45 < v53 )
{
v46 = v52->m_start[v45];
if ( (v46->m_isActivated || y != 0.0 && !GameObject::getGroupDisabled(v52->m_start[v45]))
&& (v46->getType(v46) == Solid || v46->getType(v46) == Slope || v46->getType(v46) == Breakable) )
{
v47 = v46->getObjectRect(v46);
cocos2d::CCRect::CCRect(&v55, v47);
if ( cocos2d::CCRect::intersectsRect((cocos2d::CCRect *)LODWORD(x), &v55) )
cocos2d::CCArray::addObject(v51, v46);
}
++v45;
}
}
++v44;
}
++v12;
++v40;
}
}
return v51;
}