//
// sub_10064EB80 from 0x10064eb80 to 0x10064ec06 (134 bytes)
//
// 10 xrefs:
// > sub_10064CF70 @ 0x10064e035
// > sub_10064CF70 @ 0x10064e0f0
// > sub_10064CF70 @ 0x10064e1c6
// > sub_10064CF70 @ 0x10064e21b
// > sub_10064CF70 @ 0x10064e26a
// > sub_10064CF70 @ 0x10064e2c3
// > sub_10064CF70 @ 0x10064e49e
// > sub_10064CF70 @ 0x10064e4e8
// > sub_10064CF70 @ 0x10064e557
// > sub_10064CF70 @ 0x10064e6fc
//
// 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_10064EB80(__int64 a1)
{
_QWORD *v1; // rbx
__int64 v2; // rax
__int64 v3; // rcx
__int64 result; // rax
_QWORD *v5; // rax
_QWORD *v6; // rax
v1 = *(_QWORD **)a1;
v2 = *(_QWORD *)(*(_QWORD *)a1 + 8LL);
v3 = v2 + 40;
if ( (unsigned __int64)(v2 + 40) > 0x1000 )
{
v5 = (_QWORD *)off_10099E670();
if ( !v5 )
{
v6 = *(_QWORD **)(a1 + 64);
*v6 = "Out of memory";
v6[1] = *(_QWORD *)(a1 + 16) - *(_QWORD *)(a1 + 48);
longjmp((int *)(a1 + 104), 1);
}
*v5 = *v1;
*v1 = v5;
v1[1] = 40;
return (__int64)(v5 + 1);
}
else
{
result = *v1 + v2 + 8;
v1[1] = v3;
}
return result;
}