//
// LevelSettingsObject::removeFromIDUseOrder from 0x792770 to 0x792890 (288 bytes)
//
// 3 xrefs:
// > LevelSettingsObject::setIDName @ 0x7a29d4
// > IDNameBrowserPopup::onDeleteRow @ 0xce3b58
// > ??> @ 0x537b8
//
// This function is hookable on this platform (idp: arm, 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:53:30 +0000
//
unsigned __int64 __fastcall LevelSettingsObject::removeFromIDUseOrder(unsigned __int64 this, int a2, int a3)
{
unsigned __int64 v3; // x4
unsigned __int64 v4; // x7
unsigned __int64 v5; // x5
__int64 **v6; // x19
__int64 *v7; // x0
char *v8; // x3
char *v9; // x4
int v10; // t1
__int64 v11; // x20
char *v12; // x3
v3 = *(_QWORD *)(this + 552);
if ( v3 )
{
v4 = v3 - 1;
v5 = ((v3 - 1) & v3) != 0 ? a3 % v3 : v4 & a3;
this = *(_QWORD *)(*(_QWORD *)(this + 544) + 8 * v5);
if ( this )
{
v6 = *(__int64 ***)this;
if ( *(_QWORD *)this )
{
do
{
v7 = v6[1];
this = ((v3 - 1) & v3) != 0 ? (unsigned __int64)v7 % v3 : v4 & (unsigned __int64)v7;
if ( v5 != this )
break;
this = *((unsigned int *)v6 + 4);
if ( (_DWORD)this == a3 )
{
v8 = (char *)v6[3];
v9 = (char *)v6[4];
if ( v8 != v9 )
{
if ( *(_DWORD *)v8 == a2 )
{
LABEL_21:
v11 = v9 - (v8 + 4);
this = v11 >> 2;
if ( v11 >> 2 )
{
this = (unsigned __int64)memmove(v8, v8 + 4, v9 - (v8 + 4));
v8 = (char *)this;
v9 = (char *)v6[4];
}
v12 = &v8[v11];
if ( v12 != v9 )
{
v6[4] = (__int64 *)&v9[4 * ~((unsigned __int64)(v9 - 4 - v12) >> 2)];
return (unsigned __int64)(v9 - 4);
}
}
else
{
this = (unsigned __int64)(v8 + 4);
while ( 1 )
{
v8 = (char *)this;
if ( (char *)this == v9 )
break;
v10 = *(_DWORD *)this;
this += 4LL;
if ( v10 == a2 )
goto LABEL_21;
}
}
}
return this;
}
v6 = (__int64 **)*v6;
}
while ( v6 );
}
}
}
return this;
}