//
// GJBaseGameLayer::staticObjectsInRect from 0x140211260 to 0x140211612 (946 bytes)
//
// 7 xrefs:
// > PlayerObject::postCollision @ 0x14038de1f
// > PlayerObject::postCollision @ 0x14038e28f
// > PlayerObject::spiderTestJumpInternal @ 0x1403948a3
// > PlayerObject::spiderTestJumpInternal @ 0x140394942
// > ??> @ 0x14067efbc
// > ??> @ 0x14067eff8
// > ??> @ 0x1406ccf24
//
// 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)
{
GJBaseGameLayer *v5; // rbx
__int64 v6; // rax
float x; // xmm2_4
float v8; // xmm1_4
cocos2d::CCArray *v9; // r12
float v10; // xmm4_4
float m_sectionXFactor; // xmm4_4
float v12; // xmm4_4
float v13; // xmm4_4
float v14; // xmm4_4
float v15; // xmm2_4
int v16; // r11d
float v17; // xmm4_4
float v18; // xmm4_4
std::_Simple_types *, std::allocator *>> *>::value_type *Myfirst; // r10
__int64 v20; // rcx
float v21; // xmm0_4
float v22; // xmm0_4
float v23; // xmm0_4
float y; // xmm2_4
float *p_m_sectionYFactor; // rax
int v26; // edx
float v27; // xmm4_4
float v28; // xmm4_4
float v29; // xmm4_4
float v30; // xmm4_4
float v31; // xmm4_4
float v32; // xmm2_4
int v33; // ecx
float v34; // xmm1_4
int v35; // r9d
__int64 v36; // r13
__int64 v37; // r8
_QWORD *p_Myfirst; // rcx
__int64 v39; // rdx
int v40; // edx
__int64 v41; // rbp
_QWORD *v42; // r14
__int64 v43; // rdi
__int64 v44; // rsi
__int64 v45; // rbx
const struct cocos2d::CCRect *v46; // rax
__int64 v48; // [rsp+20h] [rbp-68h]
__int64 v49; // [rsp+28h] [rbp-60h]
__int64 v50; // [rsp+30h] [rbp-58h]
__int64 v51; // [rsp+38h] [rbp-50h]
cocos2d::CCRect v52; // [rsp+40h] [rbp-48h] BYREF
v5 = a1;
v6 = cocos2d::CCArray::create(a1);
x = a2->origin.x;
v8 = 0.0;
v9 = (cocos2d::CCArray *)v6;
if ( a2->origin.x > 0.0 )
{
m_sectionXFactor = v5->m_sectionXFactor;
if ( x < 10000000.0 )
v10 = x * m_sectionXFactor;
else
v10 = m_sectionXFactor * 10000000.0;
}
else
{
v10 = 0.0;
}
if ( (float)(v10 - 1.0) >= 0.0 )
{
if ( x > 0.0 )
{
v14 = v5->m_sectionXFactor;
if ( x < 10000000.0 )
v13 = x * v14;
else
v13 = v14 * 10000000.0;
}
else
{
v13 = 0.0;
}
v12 = v13 - 1.0;
}
else
{
v12 = 0.0;
}
v15 = x + a2->size.width;
v16 = (int)v12;
if ( v15 > 0.0 )
{
v18 = v5->m_sectionXFactor;
if ( v15 < 10000000.0 )
v17 = v15 * v18;
else
v17 = v18 * 10000000.0;
}
else
{
v17 = 0.0;
}
Myfirst = v5->m_nonEffectObjects._Mypair._Myval2._Myfirst;
v20 = v5->m_nonEffectObjects._Mypair._Myval2._Mylast - Myfirst - 1;
if ( v20 < 0 )
v21 = (float)(v20 & 1 | (unsigned int)((unsigned __int64)v20 >> 1))
+ (float)(v20 & 1 | (unsigned int)((unsigned __int64)v20 >> 1));
else
v21 = (float)(int)v20;
if ( v21 > (float)(v17 + 1.0) )
{
if ( v15 > 0.0 )
{
v23 = v5->m_sectionXFactor;
if ( v15 < 10000000.0 )
v22 = v15 * v23;
else
v22 = v23 * 10000000.0;
}
else
{
v22 = 0.0;
}
v21 = v22 + 1.0;
}
y = a2->origin.y;
p_m_sectionYFactor = &v5->m_sectionYFactor;
v26 = (int)v21;
if ( y > 0.0 )
{
v28 = *p_m_sectionYFactor;
if ( y < 10000000.0 )
v27 = y * v28;
else
v27 = v28 * 10000000.0;
}
else
{
v27 = 0.0;
}
if ( (float)(v27 - 1.0) >= 0.0 )
{
if ( y > 0.0 )
{
v31 = *p_m_sectionYFactor;
if ( y < 10000000.0 )
v30 = y * v31;
else
v30 = v31 * 10000000.0;
}
else
{
v30 = 0.0;
}
v29 = v30 - 1.0;
}
else
{
v29 = 0.0;
}
v32 = y + a2->size.height;
v33 = (int)v29;
if ( v32 > 0.0 )
{
v34 = *p_m_sectionYFactor;
if ( v32 < 10000000.0 )
v8 = v34 * v32;
else
v8 = v34 * 10000000.0;
}
v35 = (int)(float)(v8 + 1.0);
if ( Myfirst == v5->m_nonEffectObjects._Mypair._Myval2._Mylast )
return v9;
v36 = v16;
v48 = v16;
v51 = v26;
if ( v16 <= (__int64)v26 )
{
v37 = v33;
v50 = v33;
do
{
p_Myfirst = &v5->m_nonEffectObjects._Mypair._Myval2._Myfirst[v36]->_Mypair._Myval2._Myfirst;
if ( p_Myfirst )
{
v39 = (__int64)(p_Myfirst[1] - *p_Myfirst) >> 3;
if ( v35 >= (unsigned __int64)(v39 - 1) )
v40 = v39 - 1;
else
v40 = v35;
}
else
{
v40 = -1;
}
v41 = v37;
v49 = v40;
if ( v37 <= v40 )
{
do
{
v42 = &v5->m_nonEffectObjects._Mypair._Myval2._Myfirst[v36]->_Mypair._Myval2._Myfirst[v41]->_Mypair._Myval2._Myfirst;
if ( v42 )
{
v43 = 0;
v44 = v5->m_nonEffectObjectsSizes._Mypair._Myval2._Myfirst[v36]->_Mypair._Myval2._Myfirst[v41];
if ( v44 > 0 )
{
do
{
v45 = *(_QWORD *)(*v42 + 8 * v43);
if ( (*(_BYTE *)(v45 + 773) || a3 && !*(_BYTE *)(v45 + 654))
&& (!(*(unsigned int (__fastcall **)(_QWORD))(*(_QWORD *)v45 + 1632LL))(*(_QWORD *)(*v42 + 8 * v43))
|| (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v45 + 1632LL))(v45) == 25
|| (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v45 + 1632LL))(v45) == 21) )
{
v46 = (const struct cocos2d::CCRect *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v45 + 1168LL))(v45);
cocos2d::CCRect::CCRect(&v52, v46);
if ( cocos2d::CCRect::intersectsRect(a2, &v52) )
cocos2d::CCArray::addObject(v9, (struct cocos2d::CCObject *)v45);
}
++v43;
}
while ( v43 < v44 );
v36 = v48;
v5 = a1;
}
}
++v41;
}
while ( v41 <= v49 );
v37 = v50;
v35 = (int)(float)(v8 + 1.0);
}
v48 = ++v36;
}
while ( v36 <= v51 );
}
return v9;
}