//
// sub_1800EBFC0 from 0x1800ebfc0 to 0x1800ec0d4 (276 bytes)
//
// 3 xrefs:
// > sub_180057B70 @ 0x180057ba2
// > sub_180057B70 @ 0x180057bb6
// > ??> @ 0x1802001a0
//
// 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 10:54:19 +0000
//
__int64 __fastcall sub_1800EBFC0(__int16 *a1, __int64 a2, __int16 *a3)
{
_DWORD *v4; // rdx
void *v7; // r10
__int16 v9; // cx
int v10; // edx
int v11; // eax
v4 = *((_DWORD **)a1 + 1);
v7 = v4;
if ( !v4 || a1[1] * *a1 == *a3 * a3[1] )
{
if ( v4 )
{
LABEL_9:
if ( *((_QWORD *)a3 + 1) )
{
if ( a1 != a3 )
{
v10 = *a3;
*a1 = v10;
v11 = a3[1];
a1[1] = a3[1];
memmove(v7, *((const void **)a3 + 1), 4LL * v11 * v10);
}
}
return 0;
}
}
else
{
sub_1800B6AA0(a2 + 67784, v4);
*(_DWORD *)a1 = 0;
*((_QWORD *)a1 + 1) = 0;
}
if ( *((_QWORD *)a3 + 1) )
{
v7 = sub_1800B6530(a2 + 67784, (unsigned int)(4 * a3[1] * *a3), &byte_18014572F, 0, 0, 0, 1);
if ( !v7 )
return 38;
v9 = a3[1];
*a1 = *a3;
a1[1] = v9;
*((_QWORD *)a1 + 1) = v7;
goto LABEL_9;
}
return 0;
}