//
// GJBaseGameLayer::staticObjectsInRect from 0x100122390 to 0x100122874 (1252 bytes)
//
// 8 xrefs:
// > PlayerObject::postCollision @ 0x1004050a1
// > PlayerObject::postCollision @ 0x1004056b2
// > PlayerObject::spiderTestJumpInternal @ 0x10040da33
// > PlayerObject::spiderTestJumpInternal @ 0x10040dadb
// > PlayerObject::spiderTestJumpX @ 0x10040ef80
// > PlayerObject::spiderTestJumpX @ 0x10040efdd
// > PlayerObject::spiderTestJumpY @ 0x10040fdd3
// > PlayerObject::spiderTestJumpY @ 0x10040fe30
//
// 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)
{
char v3; // dl
char v4; // r12
GJBaseGameLayer *v5; // r14
float v6; // xmm0_4
int v7; // eax
float v8; // xmm2_4
float m_sectionXFactor; // xmm1_4
float v10; // xmm1_4
float v11; // xmm0_4
float v12; // xmm2_4
float v13; // xmm2_4
std::__vector_base *, std::allocator *>> *, std::allocator *, std::allocator *>> *>>::pointer begin; // rcx
std::__vector_base *, std::allocator *>> *, std::allocator *, std::allocator *>> *>>::pointer end; // rdx
__int64 v16; // rsi
float v17; // xmm1_4
float v18; // xmm1_4
float v19; // xmm1_4
float v20; // xmm2_4
float v21; // xmm0_4
float m_sectionYFactor; // xmm3_4
float v23; // xmm3_4
float v24; // xmm2_4
float v25; // xmm0_4
__int64 v26; // rdx
std::vector *, std::allocator *>> *v27; // rcx
__int64 v28; // rax
int v29; // esi
__int64 v30; // rcx
std::__vector_base *, std::allocator *>>::pointer v31; // rax
std::vector *v32; // r14
__int64 v33; // rbx
__int64 i; // r12
GameObject *v35; // r13
double v36; // xmm0_8
std::vector *, std::allocator *>> *v37; // rcx
__int64 v38; // rax
int v39; // esi
__int64 v40; // rcx
std::__vector_base *, std::allocator *>>::pointer v41; // rax
std::vector *v42; // rbx
__int64 v43; // r14
__int64 j; // r12
GameObject *v45; // r13
double v46; // xmm0_8
_BYTE v48[16]; // [rsp+8h] [rbp-88h] BYREF
unsigned __int64 v49; // [rsp+18h] [rbp-78h]
__int64 v50; // [rsp+20h] [rbp-70h]
cocos2d::CCArray *v51; // [rsp+28h] [rbp-68h]
GJBaseGameLayer *v52; // [rsp+30h] [rbp-60h]
int v53; // [rsp+3Ch] [rbp-54h]
_BOOL8 v54; // [rsp+40h] [rbp-50h]
__int64 v55; // [rsp+48h] [rbp-48h]
__int64 v56; // [rsp+50h] [rbp-40h]
int v57; // [rsp+5Ch] [rbp-34h]
int v58; // [rsp+60h] [rbp-30h]
int v59; // [rsp+64h] [rbp-2Ch]
v4 = v3;
v5 = a1;
v51 = (cocos2d::CCArray *)sub_10071F9E0(a1, a3);
v54 = a3;
v6 = *(float *)a3;
v7 = 0;
v8 = 0.0;
if ( *(float *)a3 > 0.0 )
{
m_sectionXFactor = a1->m_sectionXFactor;
v10 = v6 >= 10000000.0 ? m_sectionXFactor * 10000000.0 : m_sectionXFactor * v6;
if ( (float)(v10 + -1.0) > 0.0 )
v7 = (int)(float)(v10 + -1.0);
}
v11 = v6 + *(float *)(v54 + 8);
if ( v11 > 0.0 )
{
v12 = a1->m_sectionXFactor;
if ( v11 >= 10000000.0 )
v8 = v12 * 10000000.0;
else
v8 = v12 * v11;
}
v13 = v8 + 1.0;
begin = a1->m_nonEffectObjects.__begin_;
end = a1->m_nonEffectObjects.__end_;
v16 = end - begin - 1;
if ( v16 < 0 )
{
v17 = (float)(int)(((unsigned __int64)v16 >> 1) | v16 & 1) + (float)(int)(((unsigned __int64)v16 >> 1) | v16 & 1);
if ( v13 > v17 )
goto LABEL_20;
}
else
{
v17 = (float)(int)v16;
if ( v13 > (float)(int)v16 )
goto LABEL_20;
}
v18 = 0.0;
if ( v11 > 0.0 )
{
v19 = a1->m_sectionXFactor;
if ( v11 >= 10000000.0 )
v18 = v19 * 10000000.0;
else
v18 = v19 * v11;
}
v17 = v18 + 1.0;
LABEL_20:
v20 = *(float *)(v54 + 4);
v59 = 0;
v21 = 0.0;
if ( v20 > 0.0 )
{
m_sectionYFactor = a1->m_sectionYFactor;
v23 = v20 >= 10000000.0 ? m_sectionYFactor * 10000000.0 : m_sectionYFactor * v20;
if ( (float)(v23 + -1.0) > 0.0 )
v59 = (int)(float)(v23 + -1.0);
}
v24 = v20 + *(float *)(v54 + 12);
if ( v24 <= 0.0 )
{
LABEL_29:
if ( begin == end )
return v51;
goto LABEL_30;
}
v25 = a1->m_sectionYFactor;
if ( v24 < 10000000.0 )
{
v21 = v25 * v24;
goto LABEL_29;
}
v21 = v25 * 10000000.0;
if ( begin == end )
return v51;
LABEL_30:
v58 = (int)v17;
if ( v7 <= (int)v17 )
{
v53 = (int)(float)(v21 + 1.0);
v49 = v53;
v50 = v59;
v26 = v7;
++v58;
v52 = a1;
if ( v4 )
{
while ( 1 )
{
v27 = v5->m_nonEffectObjects.__begin_[v26];
if ( v27 )
break;
v29 = -1;
if ( v59 <= -1 )
goto LABEL_40;
LABEL_33:
if ( v58 == (_DWORD)++v26 )
return v51;
}
v28 = v27->__end_ - v27->__begin_;
v29 = v53;
if ( v28 - 1 < v49 )
v29 = v28 - 1;
if ( v59 > v29 )
goto LABEL_33;
LABEL_40:
v30 = v50;
v55 = v26;
v57 = v29 + 1;
do
{
v31 = v5->m_nonEffectObjects.__begin_[v26]->__begin_;
v56 = v30;
v32 = v31[v30];
if ( v32 )
{
v33 = v52->m_nonEffectObjectsSizes.__begin_[v55]->__begin_[v56];
if ( v33 > 0 )
{
for ( i = 0; i != v33; ++i )
{
v35 = v32->__begin_[i];
if ( (v35->m_isActivated || !GameObject::getGroupDisabled(v32->__begin_[i]))
&& (!((unsigned int (__fastcall *)(GameObject *))v35->getType)(v35)
|| ((unsigned int (__fastcall *)(GameObject *))v35->getType)(v35) == 25
|| ((unsigned int (__fastcall *)(GameObject *))v35->getType)(v35) == 21) )
{
((void (__fastcall *)(GameObject *))v35->getObjectRect)(v35);
v36 = sub_10028D180(v48);
if ( (unsigned __int8)sub_10028D320(v54, v48, v36) )
sub_10071FCD0(v51, v35);
}
}
}
}
v30 = v56 + 1;
v5 = v52;
v26 = v55;
}
while ( v57 != (_DWORD)v56 + 1 );
goto LABEL_33;
}
while ( 1 )
{
v37 = v5->m_nonEffectObjects.__begin_[v26];
if ( v37 )
break;
v39 = -1;
if ( v59 <= -1 )
goto LABEL_60;
LABEL_53:
if ( v58 == (_DWORD)++v26 )
return v51;
}
v38 = v37->__end_ - v37->__begin_;
v39 = v53;
if ( v38 - 1 < v49 )
v39 = v38 - 1;
if ( v59 > v39 )
goto LABEL_53;
LABEL_60:
v40 = v50;
v55 = v26;
v57 = v39 + 1;
do
{
v41 = v5->m_nonEffectObjects.__begin_[v26]->__begin_;
v56 = v40;
v42 = v41[v40];
if ( v42 )
{
v43 = v52->m_nonEffectObjectsSizes.__begin_[v55]->__begin_[v56];
if ( v43 > 0 )
{
for ( j = 0; j != v43; ++j )
{
v45 = v42->__begin_[j];
if ( v45->m_isActivated
&& (!((unsigned int (__fastcall *)(GameObject *))v45->getType)(v42->__begin_[j])
|| ((unsigned int (__fastcall *)(GameObject *))v45->getType)(v45) == 25
|| ((unsigned int (__fastcall *)(GameObject *))v45->getType)(v45) == 21) )
{
((void (__fastcall *)(GameObject *))v45->getObjectRect)(v45);
v46 = sub_10028D180(v48);
if ( (unsigned __int8)sub_10028D320(v54, v48, v46) )
sub_10071FCD0(v51, v45);
}
}
}
}
v40 = v56 + 1;
v5 = v52;
v26 = v55;
}
while ( v57 != (_DWORD)v56 + 1 );
goto LABEL_53;
}
return v51;
}