//
// GJBaseGameLayer::sortSectionVector from 0x1001f3b30 to 0x1001f3d14 (484 bytes)
//
// 1 xrefs:
// > PlayLayer::resetLevel @ 0x1001223d8
//
// 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
//
void __fastcall GJBaseGameLayer::sortSectionVector(GJBaseGameLayer *a1)
{
std::__vector_base *, std::allocator *>> *, std::allocator *, std::allocator *>> *>>::pointer end; // x8
std::__vector_base *, std::allocator *>> *, std::allocator *, std::allocator *>> *>>::pointer begin; // x9
unsigned __int64 v4; // x21
std::vector *, std::allocator *>> *v5; // x10
unsigned __int64 v6; // x10
__int64 v7; // x23
__int64 v8; // x24
std::vector *v9; // x26
unsigned __int64 v10; // x25
std::__vector_base::pointer v11; // x0
__int64 v12; // x1
unsigned __int64 v13; // x8
unsigned __int64 v14; // x3
__int64 v15; // x8
std::__vector_base::pointer v16; // x9
std::__vector_base *, std::allocator *>>::pointer v17; // x8
std::__vector_base *, std::allocator *>>::pointer v18; // x9
unsigned __int64 v19; // x21
std::vector *v20; // x10
unsigned __int64 v21; // x10
__int64 v22; // x23
__int64 v23; // x24
GameObject *v24; // x26
unsigned __int64 v25; // x25
GameObject_vtbl *v26; // x0
__int64 v27; // x1
unsigned __int64 v28; // x8
unsigned __int64 v29; // x3
__int64 v30; // x8
GameObject_vtbl *v31; // x9
bool (__fastcall *v32)(__int64, __int64); // [xsp+8h] [xbp-48h] BYREF
end = a1->m_nonEffectObjects.__end_;
begin = a1->m_nonEffectObjects.__begin_;
if ( end != begin )
{
v4 = 0;
do
{
v5 = begin[v4];
if ( v5 )
{
v6 = (char *)v5->__end_ - (char *)v5->__begin_;
if ( (int)(v6 >> 3) >= 1 )
{
v7 = 0;
v8 = (v6 >> 3) & 0x7FFFFFFF;
do
{
v9 = a1->m_nonEffectObjects.__begin_[v4]->__begin_[v7];
if ( v9 )
{
v10 = a1->m_nonEffectObjectsSizes.__begin_[v4]->__begin_[v7];
v11 = v9->__begin_;
v12 = (__int64)&v9->__begin_[v10];
v32 = sub_1001D9AD0;
v13 = 126 - 2 * __clz(v10);
v14 = (_DWORD)v10 ? v13 : 0LL;
sub_10020AA24(v11, v12, &v32, v14, 1);
if ( (int)v10 >= 1 )
{
v15 = 0;
v16 = v9->__begin_;
do
{
v16[v15]->m_innerSectionIndex = v15;
++v15;
}
while ( v10 != v15 );
}
}
++v7;
}
while ( v7 != v8 );
end = a1->m_nonEffectObjects.__end_;
begin = a1->m_nonEffectObjects.__begin_;
}
}
++v4;
}
while ( v4 < end - begin );
}
v17 = a1->m_collisionBlockSections.__end_;
v18 = a1->m_collisionBlockSections.__begin_;
if ( v17 != v18 )
{
v19 = 0;
do
{
v20 = v18[v19];
if ( v20 )
{
v21 = (char *)v20->__end_ - (char *)v20->__begin_;
if ( (int)(v21 >> 3) >= 1 )
{
v22 = 0;
v23 = (v21 >> 3) & 0x7FFFFFFF;
do
{
v24 = a1->m_collisionBlockSections.__begin_[v19]->__begin_[v22];
if ( v24 )
{
v25 = a1->m_collisionBlockSectionSizes.__begin_[v19]->__begin_[v22];
v26 = v24->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v27 = (__int64)v24->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ 8 * v25;
v32 = sub_1001D9AD0;
v28 = 126 - 2 * __clz(v25);
if ( (_DWORD)v25 )
v29 = v28;
else
v29 = 0;
sub_10020CA70(v26, v27, &v32, v29, 1);
if ( (int)v25 >= 1 )
{
v30 = 0;
v31 = v24->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
do
{
*(_DWORD *)(*((_QWORD *)&v31->copyWithZone + v30) + 624LL) = v30;
++v30;
}
while ( v25 != v30 );
}
}
++v22;
}
while ( v22 != v23 );
v17 = a1->m_collisionBlockSections.__end_;
v18 = a1->m_collisionBlockSections.__begin_;
}
}
++v19;
}
while ( v19 < v17 - v18 );
}
}