//
// GJLevelList::reorderLevel from 0x10058f6d0 to 0x10058f78d (189 bytes)
//
// 2 xrefs:
// > LevelListLayer::setIDPopupClosed @ 0x10034b0a7
// > sub_10034B110 @ 0x10034b150
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:32:26 +0000
//
__int64 __fastcall GJLevelList::reorderLevel(std::string *a1, int a2, int a3)
{
__int64 v3; // rax
_DWORD *size; // rax
std::string::pointer data; // r14
_DWORD *v6; // rbx
std::string::size_type *p_size; // r15
size_t v8; // r14
int v9; // r13d
char *v10; // rbx
unsigned __int64 v11; // rbx
__int64 v12; // rcx
char v14[44]; // [rsp+0h] [rbp-2Ch] BYREF
*(_DWORD *)v14 = HIDWORD(v3);
size = (_DWORD *)a1[13].__r_.__value_.__l.__size_;
data = a1[13].__r_.__value_.__l.__data_;
v6 = size;
if ( size != (_DWORD *)data )
{
v6 = (_DWORD *)a1[13].__r_.__value_.__l.__size_;
while ( *v6 != a2 )
{
if ( ++v6 == (_DWORD *)data )
return GJLevelList::updateLevelsString(a1);
}
}
if ( v6 != (_DWORD *)data )
{
p_size = &a1[13].__r_.__value_.__l.__size_;
*(_DWORD *)v14 = *v6;
v8 = data - (std::string::pointer)(v6 + 1);
if ( v8 )
{
v9 = a3;
memmove(v6, v6 + 1, v8);
a3 = v9;
size = (_DWORD *)*p_size;
}
v10 = (char *)v6 + v8;
a1[13].__r_.__value_.__r.__words[2] = (std::string::size_type)v10;
v11 = (v10 - (char *)size) >> 2;
if ( v11 >= (unsigned int)a3 )
LODWORD(v11) = a3;
v12 = 0;
if ( a3 >= 0 )
v12 = (unsigned int)v11;
sub_1000D9CD0(p_size, (char *)&size[v12], v14);
}
return GJLevelList::updateLevelsString(a1);
}