//
// GJBaseGameLayer::staticObjectsInRect from 0x8589ac to 0x858ea0 (1268 bytes)
//
// 9 xrefs:
// > PlayerObject::spiderTestJumpInternal @ 0x63415c
// > PlayerObject::spiderTestJumpInternal @ 0x6341d8
// > PlayerObject::spiderTestJumpY @ 0x635f2c
// > PlayerObject::spiderTestJumpY @ 0x635f80
// > PlayerObject::spiderTestJumpX @ 0x636a18
// > PlayerObject::spiderTestJumpX @ 0x636a6c
// > PlayerObject::postCollision @ 0x639cc0
// > PlayerObject::postCollision @ 0x639ec8
// > ??> @ 0x65880
//
// 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 *GJBaseGameLayer::staticObjectsInRect(GJBaseGameLayer *a1, cocos2d::CCRect a2, bool a3)
{
unsigned __int8 v3; // w2
_BOOL8 v5; // x23
int v6; // w21
float v7; // s2
float m_sectionXFactor; // s0
_BOOL4 v9; // w0
float v10; // s2
std::vector *, std::allocator *>> **m_start; // x19
std::vector *, std::allocator *>> **m_finish; // x25
float v13; // s1
float v14; // s0
float v15; // s0
float v17; // s0
float m_sectionYFactor; // s1
_BOOL4 v19; // w0
std::vector *, std::allocator *>> *v20; // x19
__int64 v21; // x0
unsigned __int64 v22; // x1
int v23; // w0
int v24; // w24
__int64 v25; // x25
std::vector *v26; // x20
int v27; // w19
unsigned __int64 v28; // x27
__int64 v29; // x19
cocos2d::CCObject *v30; // x26
const cocos2d::CCRect *v31; // x0
int v32; // [xsp+84h] [xbp+84h]
int v33; // [xsp+88h] [xbp+88h]
int v34; // [xsp+8Ch] [xbp+8Ch]
cocos2d::CCArray *v35; // [xsp+90h] [xbp+90h]
int v36; // [xsp+98h] [xbp+98h]
int i; // [xsp+9Ch] [xbp+9Ch]
__int64 v38; // [xsp+A0h] [xbp+A0h]
__int64 v39; // [xsp+A8h] [xbp+A8h]
cocos2d::CCRect v40; // [xsp+B8h] [xbp+B8h] BYREF
v5 = a3;
v6 = v3;
v35 = (cocos2d::CCArray *)cocos2d::CCArray::create(_stack_chk_guard);
v7 = *(float *)v5;
if ( *(float *)v5 > 0.0
&& ((m_sectionXFactor = a1->m_sectionXFactor, v7 < 10000000.0)
? (v9 = (float)((float)(v7 * m_sectionXFactor) + -1.0) > 0.0)
: (v9 = (float)((float)(m_sectionXFactor * 10000000.0) + -1.0) > 0.0),
v9) )
{
if ( v7 <= 0.0 )
{
v36 = -1;
}
else
{
if ( v7 >= 10000000.0 )
{
v10 = v7 + *(float *)(v5 + 8);
v36 = (int)(float)((float)(m_sectionXFactor * 10000000.0) + -1.0);
if ( v10 <= 0.0 )
goto LABEL_8;
goto LABEL_15;
}
v36 = (int)(float)((float)(v7 * m_sectionXFactor) + -1.0);
}
}
else
{
v36 = 0;
}
v10 = v7 + *(float *)(v5 + 8);
if ( v10 <= 0.0 )
{
LABEL_8:
m_start = a1->m_nonEffectObjects.m_start;
m_finish = a1->m_nonEffectObjects.m_finish;
v13 = (float)(unsigned __int64)(m_finish - m_start - 1);
if ( v13 >= 1.0 )
goto LABEL_9;
goto LABEL_17;
}
LABEL_15:
v17 = a1->m_sectionXFactor;
if ( v10 >= 10000000.0 )
{
m_start = a1->m_nonEffectObjects.m_start;
m_finish = a1->m_nonEffectObjects.m_finish;
v13 = (float)(unsigned __int64)(m_finish - m_start - 1);
if ( (float)((float)(v17 * 10000000.0) + 1.0) > v13 )
goto LABEL_17;
}
else
{
m_start = a1->m_nonEffectObjects.m_start;
m_finish = a1->m_nonEffectObjects.m_finish;
v13 = (float)(unsigned __int64)(m_finish - m_start - 1);
if ( (float)((float)(v10 * v17) + 1.0) > v13 )
{
LABEL_17:
v34 = (int)v13;
goto LABEL_18;
}
}
if ( v10 <= 0.0 )
{
LABEL_9:
v14 = *(float *)(v5 + 4);
v34 = 1;
if ( v14 <= 0.0 )
goto LABEL_10;
goto LABEL_19;
}
if ( v10 < 10000000.0 )
v34 = (int)(float)((float)(v10 * v17) + 1.0);
else
v34 = (int)(float)((float)(v17 * 10000000.0) + 1.0);
LABEL_18:
v14 = *(float *)(v5 + 4);
if ( v14 <= 0.0 )
goto LABEL_10;
LABEL_19:
m_sectionYFactor = a1->m_sectionYFactor;
if ( v14 < 10000000.0 )
v19 = (float)((float)(v14 * m_sectionYFactor) + -1.0) > 0.0;
else
v19 = (float)((float)(m_sectionYFactor * 10000000.0) + -1.0) > 0.0;
if ( !v19 )
{
LABEL_10:
v33 = 0;
v15 = v14 + *(float *)(v5 + 12);
if ( v15 <= 0.0 )
goto LABEL_11;
goto LABEL_26;
}
if ( v14 <= 0.0 )
{
v33 = -1;
}
else if ( v14 < 10000000.0 )
{
v33 = (int)(float)((float)(v14 * m_sectionYFactor) + -1.0);
}
else
{
v33 = (int)(float)((float)(m_sectionYFactor * 10000000.0) + -1.0);
}
v15 = v14 + *(float *)(v5 + 12);
if ( v15 <= 0.0 )
{
LABEL_11:
v32 = 1;
if ( m_start == m_finish )
return v35;
goto LABEL_29;
}
LABEL_26:
if ( v15 < 10000000.0 )
v32 = (int)(float)((float)(v15 * a1->m_sectionYFactor) + 1.0);
else
v32 = (int)(float)((float)(a1->m_sectionYFactor * 10000000.0) + 1.0);
if ( m_start != m_finish )
{
LABEL_29:
if ( v36 > v34 )
return v35;
v38 = v36;
v20 = m_start[v38];
if ( !v20 )
goto LABEL_59;
LABEL_31:
v21 = v20->m_finish - v20->m_start;
v22 = v21 - 1;
v23 = v21 - 1;
if ( v32 <= v22 )
v23 = v32;
for ( i = v23; v33 > i; i = -1 )
{
LABEL_57:
++v38;
if ( v34 < ++v36 )
return v35;
v20 = a1->m_nonEffectObjects.m_start[v38];
if ( v20 )
goto LABEL_31;
LABEL_59:
;
}
v24 = v33;
v25 = v33;
v39 = v33;
while ( 1 )
{
v26 = v20->m_start[v25];
if ( v26 )
{
v27 = a1->m_nonEffectObjectsSizes.m_start[v38]->m_start[v39];
if ( v27 > 0 )
break;
}
LABEL_45:
++v24;
++v25;
++v39;
if ( i < v24 )
goto LABEL_57;
v20 = a1->m_nonEffectObjects.m_start[v38];
}
v28 = 0;
v29 = 8 * ((unsigned int)(v27 - 1) + 1LL);
while ( 1 )
{
v30 = v26->m_start[v28 / 8];
if ( BYTE1(v30[13].m_nZOrder) )
{
if ( ((unsigned int (__fastcall *)(GameObject *))v30->__vftable[22].isEqual)(v26->m_start[v28 / 8]) )
goto LABEL_54;
}
else
{
if ( !v6 || GameObject::getGroupDisabled(v26->m_start[v28 / 8]) )
goto LABEL_40;
if ( ((unsigned int (__fastcall *)(cocos2d::CCObject *))v30->__vftable[22].isEqual)(v30) )
{
LABEL_54:
if ( ((unsigned int (__fastcall *)(cocos2d::CCObject *))v30->__vftable[22].isEqual)(v30) != 25
&& ((unsigned int (__fastcall *)(cocos2d::CCObject *))v30->__vftable[22].isEqual)(v30) != 21 )
{
goto LABEL_40;
}
}
}
v31 = (const cocos2d::CCRect *)((__int64 (__fastcall *)(cocos2d::CCObject *))v30->__vftable[16].acceptVisitor)(v30);
cocos2d::CCRect::CCRect(&v40, v31);
if ( (unsigned __int8)cocos2d::CCRect::intersectsRect((cocos2d::CCRect *)v5, &v40) )
{
v28 += 8LL;
cocos2d::CCArray::addObject(v35, v30);
if ( v28 == v29 )
goto LABEL_45;
}
else
{
LABEL_40:
v28 += 8LL;
if ( v28 == v29 )
goto LABEL_45;
}
}
}
return v35;
}