//
// sub_1004E7E14 from 0x1004e7e14 to 0x1004e7eec (216 bytes)
//
// 0 xrefs:
//
// 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_1004E7E14(__int64 a1, void *__src)
{
_DWORD *v2; // x8
__int64 v4; // x10
__int64 v6; // x9
char *v7; // x0
size_t v8; // x1
_QWORD *v10; // x8
v2 = *(_DWORD **)a1;
if ( **(_DWORD **)a1 != 9 )
return 0;
v4 = *(_QWORD *)(a1 + 8);
if ( *(_DWORD *)(v4 + 840) )
return 1;
v6 = *(_QWORD *)(v4 + 1352);
v7 = *(char **)(v4 + 1344);
if ( v6 != *(_QWORD *)(v4 + 1360) )
{
LABEL_11:
memcpy(&v7[4 * v6], __src, 4u);
++*(_QWORD *)(*(_QWORD *)(a1 + 8) + 1352LL);
return 1;
}
if ( v6 )
{
if ( v6 < 0 )
{
*(_QWORD *)(v4 + 1344) = 0;
goto LABEL_15;
}
v8 = 2 * v6;
}
else
{
v8 = 0;
}
v7 = (char *)realloc(v7, v8);
v10 = *(_QWORD **)(a1 + 8);
v10[168] = v7;
if ( v7 )
{
v10[170] *= 2LL;
v6 = v10[169];
goto LABEL_11;
}
v2 = *(_DWORD **)a1;
LABEL_15:
*v2 = 8;
return 0;
}