//
// GJLevelList::reorderLevel from 0x1000b1798 to 0x1000b1864 (204 bytes)
//
// 2 xrefs:
// > GJLevelList::reorderLevelStep @ 0x1000b1a74
// > LevelListLayer::setIDPopupClosed @ 0x100246700
//
// 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 GJLevelList::reorderLevel(GJLevelList *a1, int a2, int a3)
{
std::__vector_base::pointer begin; // x8
std::__vector_base::pointer end; // x9
std::__vector_base::pointer v7; // x21
std::__vector_base::pointer v8; // x10
signed __int64 v9; // x22
unsigned __int64 v10; // x9
__int64 v11; // x9
begin = a1->m_levels.__begin_;
end = a1->m_levels.__end_;
v7 = begin;
if ( begin != end )
{
v8 = a1->m_levels.__begin_;
while ( *v8 != a2 )
{
++v8;
++v7;
if ( v8 == end )
{
v7 = a1->m_levels.__end_;
break;
}
}
}
if ( end != v7 )
{
v9 = (char *)end - (char *)(v7 + 1);
if ( end != v7 + 1 )
{
memmove(v7, v7 + 1, (char *)end - (char *)(v7 + 1));
begin = a1->m_levels.__begin_;
}
a1->m_levels.__end_ = (std::__vector_base::pointer)((char *)v7 + v9);
v10 = ((char *)v7 + v9 - (char *)begin) >> 2;
if ( v10 >= (unsigned int)a3 )
LODWORD(v10) = a3;
v11 = (unsigned int)v10;
if ( a3 < 0 )
v11 = 0;
sub_1000B1864((_DWORD)a1 + 320, &begin[v11]);
}
GJLevelList::updateLevelsString(a1);
}