//
// sub_180057E30 from 0x180057e30 to 0x180057e8c (92 bytes)
//
// 10 xrefs:
// > sub_1800E22D0 @ 0x1800e22f1
// > sub_1800E2300 @ 0x1800e2307
// > unknown_libname_8 @ 0x1800e2317
// > sub_1800E2320 @ 0x1800e2327
// > int `std::exception_ptr::_Current_exception @ 0x1800e234b
// > ??> @ 0x180138aaf
// > ??> @ 0x180138ab6
// > ??> @ 0x180138abc
// > ??> @ 0x1801b29f4
// > ??> @ 0x1801b2a00
//
// 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
//
__int64 __fastcall sub_180057E30(__int64 a1)
{
_QWORD *v2; // rcx
__int64 result; // rax
v2 = *(_QWORD **)a1;
if ( v2 )
{
if ( ((*(_QWORD *)(a1 + 16) - (_QWORD)v2) & 0xFFFFFFFFFFFFFFFCuLL) >= 0x1000 )
{
if ( (unsigned __int64)v2 - *(v2 - 1) - 8 > 0x1F )
invalid_parameter_noinfo_noreturn();
v2 = (_QWORD *)*(v2 - 1);
}
j_j_free_0(v2);
result = 0;
*(_QWORD *)a1 = 0;
*(_QWORD *)(a1 + 8) = 0;
*(_QWORD *)(a1 + 16) = 0;
}
return result;
}