//
// GameLevelManager::onDeleteServerLevelListCompleted from 0x10052ade0 to 0x10052af28 (328 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x10051cbb2
//
// 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
//
char __fastcall GameLevelManager::onDeleteServerLevelListCompleted(__int64 a1, unsigned __int8 *a2, __int64 a3)
{
_QWORD *v5; // r13
__int64 v6; // r12
_QWORD *v7; // rcx
_QWORD *v8; // rax
_QWORD *v9; // rcx
bool v10; // zf
const char *v11; // r15
unsigned int v12; // r15d
const void *v13; // rdi
unsigned __int64 v14; // rcx
size_t v15; // rdx
bool v16; // r14
int v17; // eax
__int64 (__fastcall ***v18)(_QWORD, _QWORD); // rdi
char result; // al
__int64 (__fastcall **v20)(_QWORD, _QWORD); // rax
_WORD __s2[31]; // [rsp+1h] [rbp-3Fh] BYREF
v5 = (_QWORD *)(a1 + 320);
v6 = sub_10031E0A0(a1 + 320, (unsigned __int8 *)a3);
if ( v6 != a1 + 328 )
{
v7 = *(_QWORD **)(v6 + 8);
if ( v7 )
{
do
{
v8 = v7;
v7 = (_QWORD *)*v7;
}
while ( v7 );
}
else
{
v9 = (_QWORD *)v6;
do
{
v8 = (_QWORD *)v9[2];
v10 = *v8 == (_QWORD)v9;
v9 = v8;
}
while ( !v10 );
}
if ( *v5 == v6 )
*v5 = v8;
--*(_QWORD *)(a1 + 336);
sub_100165F60(*(__int64 **)(a1 + 328), (__int64 *)v6);
if ( (*(_BYTE *)(v6 + 32) & 1) != 0 )
operator delete(*(void **)(v6 + 48));
operator delete((void *)v6);
}
if ( (*(_BYTE *)a3 & 1) != 0 )
v11 = *(const char **)(a3 + 16);
else
v11 = (const char *)(a3 + 1);
v12 = atoi(v11);
strcpy((char *)__s2, "-1");
v13 = a2 + 1;
v14 = *a2 >> 1;
if ( (*a2 & 1) != 0 )
{
v13 = *((const void **)a2 + 2);
v14 = *((_QWORD *)a2 + 1);
}
v15 = 2;
if ( v14 < 2 )
v15 = v14;
v16 = v14 != 2;
v17 = memcmp(v13, __s2, v15);
v18 = *(__int64 (__fastcall ****)(_QWORD, _QWORD))(a1 + 792);
result = v16 || v17 != 0;
if ( result )
{
if ( !v18 )
return result;
v20 = *v18;
}
else
{
if ( !v18 )
return result;
v20 = *v18 + 1;
}
return (*v20)(v18, v12);
}