//
// GJBaseGameLayer::staticObjectsInRect from 0x1001e5014 to 0x1001e536c (856 bytes)
//
// 4 xrefs:
// > PlayerObject::postCollision @ 0x10021f04c
// > PlayerObject::postCollision @ 0x10021faf8
// > PlayerObject::spiderTestJumpInternal @ 0x100224dd0
// > PlayerObject::spiderTestJumpInternal @ 0x100224e84
//
// 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
//
// local variable allocation has failed, the output may be wrong!
cocos2d::CCArray *__fastcall GJBaseGameLayer::staticObjectsInRect(GJBaseGameLayer *a1, cocos2d::CCRect a2, bool a3)
{
int v3; // w2
int v4; // w19
float *v5; // x20
GJBaseGameLayer *v6; // x21
cocos2d::CCArray *v7; // x22
float v8; // s0
float m_sectionXFactor; // s1
float v10; // s1
int v11; // w8
float v12; // s1
float v13; // s0
float v14; // s0
float v15; // s2
std::__vector_base *, std::allocator *>> *, std::allocator *, std::allocator *>> *>>::pointer end; // x9
std::__vector_base *, std::allocator *>> *, std::allocator *, std::allocator *>> *>>::pointer begin; // x10
float v18; // s0
float v19; // s0
float v20; // s0
float v21; // s1
float m_sectionYFactor; // s2
float v23; // s2
float v24; // s2
float v25; // s1
float v26; // s1
__int64 v27; // x28
std::vector *, std::allocator *>> *v28; // x8
__int64 v29; // x9
int v30; // w8
__int64 v31; // x25
GJBaseGameLayer *v32; // x26
std::vector *v33; // x24
__int64 v34; // x8
unsigned __int64 v35; // x27
__int64 v36; // x21
GameObject *v37; // x23
__int64 v38; // x0
int v40; // [xsp+10h] [xbp-80h]
int v41; // [xsp+1Ch] [xbp-74h]
int v42; // [xsp+20h] [xbp-70h]
int v43; // [xsp+2Ch] [xbp-64h]
float v44[4]; // [xsp+30h] [xbp-60h] BYREF
v4 = v3;
v5 = (float *)a3;
v6 = a1;
v7 = (cocos2d::CCArray *)sub_10024A15C(a1);
v8 = *v5;
if ( *v5 <= 0.0
|| ((m_sectionXFactor = v6->m_sectionXFactor, v8 >= 10000000.0)
? (v10 = m_sectionXFactor * 10000000.0)
: (v10 = v8 * m_sectionXFactor),
(float)(v10 + -1.0) <= 0.0) )
{
v11 = 0;
}
else
{
v11 = (int)(float)(v10 + -1.0);
}
v12 = v8 + v5[2];
v13 = 0.0;
if ( v12 > 0.0 )
{
v14 = v6->m_sectionXFactor;
if ( v12 >= 10000000.0 )
v13 = v14 * 10000000.0;
else
v13 = v12 * v14;
}
v15 = v13 + 1.0;
end = v6->m_nonEffectObjects.__end_;
begin = v6->m_nonEffectObjects.__begin_;
v18 = (float)(unsigned __int64)(end - begin - 1);
if ( v15 <= v18 )
{
v19 = 0.0;
if ( v12 > 0.0 )
{
v20 = v6->m_sectionXFactor;
if ( v12 >= 10000000.0 )
v19 = v20 * 10000000.0;
else
v19 = v12 * v20;
}
v18 = v19 + 1.0;
}
v21 = v5[1];
if ( v21 <= 0.0
|| ((m_sectionYFactor = v6->m_sectionYFactor, v21 >= 10000000.0)
? (v23 = m_sectionYFactor * 10000000.0)
: (v23 = v21 * m_sectionYFactor),
(float)(v23 + -1.0) <= 0.0) )
{
v42 = 0;
}
else
{
v42 = (int)(float)(v23 + -1.0);
}
v24 = v21 + v5[3];
v25 = 0.0;
if ( v24 > 0.0 )
{
v26 = v6->m_sectionYFactor;
if ( v24 >= 10000000.0 )
v25 = v26 * 10000000.0;
else
v25 = v24 * v26;
}
if ( begin != end && v11 <= (int)v18 )
{
v40 = (int)(float)(v25 + 1.0);
v27 = v11;
v41 = (int)v18 + 1;
do
{
v28 = v6->m_nonEffectObjects.__begin_[v27];
if ( v28 )
{
v29 = (char *)v28->__end_ - (char *)v28->__begin_;
v30 = v40;
if ( (v29 >> 3) - 1 < (unsigned __int64)v40 )
v30 = ((unsigned __int64)v29 >> 3) - 1;
}
else
{
v30 = -1;
}
if ( v42 <= v30 )
{
v43 = v30 + 1;
v31 = v42;
do
{
v32 = v6;
v33 = v6->m_nonEffectObjects.__begin_[v27]->__begin_[v31];
if ( v33 )
{
v34 = (unsigned int)v6->m_nonEffectObjectsSizes.__begin_[v27]->__begin_[v31];
if ( (int)v34 >= 1 )
{
v35 = 0;
v36 = 8 * v34;
do
{
v37 = v33->__begin_[v35 / 8];
if ( (v37->m_isActivated || v4 && !GameObject::getGroupDisabled(v33->__begin_[v35 / 8]))
&& (!((unsigned int (__fastcall *)(GameObject *))v37->getType)(v37)
|| ((unsigned int (__fastcall *)(GameObject *))v37->getType)(v37) == 25
|| ((unsigned int (__fastcall *)(GameObject *))v37->getType)(v37) == 21) )
{
v38 = ((__int64 (__fastcall *)(GameObject *))v37->getObjectRect)(v37);
sub_100022B98(v44, v38);
if ( sub_100022CB0(v5, v44) )
sub_10024A2D0(v7, v37);
}
v35 += 8LL;
}
while ( v36 != v35 );
}
}
++v31;
v6 = v32;
}
while ( v43 != (_DWORD)v31 );
}
++v27;
}
while ( v41 != (_DWORD)v27 );
}
return v7;
}