//
// sub_14005ED30 from 0x14005ed30 to 0x14005edf7 (199 bytes)
//
// 5 xrefs:
// > sub_1404E2540 @ 0x1404e2547
// > ??> @ 0x14066456b
// > ??> @ 0x1406654d0
// > ??> @ 0x140665504
// > ??> @ 0x1406c57f0
//
// 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_14005ED30(_QWORD *a1)
{
_QWORD *v1; // rdi
unsigned __int64 v2; // rcx
__int64 result; // rax
_QWORD **v4; // rcx
_QWORD *v5; // rsi
_QWORD *v6; // rbx
__int64 v7; // rdx
__int64 v8; // rcx
__int64 v9; // [rsp+30h] [rbp+8h] BYREF
v1 = (_QWORD *)*a1;
if ( *a1 )
{
v2 = v1[2];
if ( v2 )
{
if ( v1[7] >> 3 <= v2 )
{
v4 = (_QWORD **)v1[1];
*v4[1] = 0;
v5 = *v4;
if ( *v4 )
{
do
{
v6 = (_QWORD *)*v5;
sub_14003A830((__int64)(v5 + 3));
j_j_free(v5);
v5 = v6;
}
while ( v6 );
}
*(_QWORD *)v1[1] = v1[1];
*(_QWORD *)(v1[1] + 8LL) = v1[1];
v1[2] = 0;
v7 = v1[4];
v8 = v1[3];
v9 = v1[1];
return sub_140060560(v8, v7, &v9);
}
else
{
return sub_14005F200(v1, *(_QWORD *)v1[1], v1[1]);
}
}
}
return result;
}