//
// sub_10064F130 from 0x10064f130 to 0x10064f215 (229 bytes)
//
// 1 xrefs:
// > sub_10064CF70 @ 0x10064deff
//
// 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_10064F130(__int64 a1, char a2, char a3, __int64 a4, __int64 *a5)
{
_QWORD *v8; // r13
__int64 v9; // rax
__int64 v10; // rcx
__int64 result; // rax
_QWORD *v12; // rax
__int64 v13; // rcx
const char **v14; // rax
const char *v15; // rcx
if ( a4 == 1 && *(_BYTE *)(*a5 + 1) != 1 )
{
v14 = *(const char ***)(a1 + 64);
v15 = "Function has to be applied to node set";
goto LABEL_12;
}
v8 = *(_QWORD **)a1;
v9 = *(_QWORD *)(*(_QWORD *)a1 + 8LL);
v10 = v9 + 40;
if ( (unsigned __int64)(v9 + 40) <= 0x1000 )
{
result = *v8 + v9 + 8;
v8[1] = v10;
goto LABEL_7;
}
v12 = (_QWORD *)off_10099E670();
if ( !v12 )
{
v14 = *(const char ***)(a1 + 64);
v15 = "Out of memory";
LABEL_12:
*v14 = v15;
v14[1] = (const char *)(*(_QWORD *)(a1 + 16) - *(_QWORD *)(a1 + 48));
longjmp((int *)(a1 + 104), 1);
}
*v12 = *v8;
*v8 = v12;
v8[1] = 40;
result = (__int64)(v12 + 1);
LABEL_7:
if ( !a4 )
a3 = a2;
v13 = *a5;
*(_BYTE *)result = a3;
*(_WORD *)(result + 1) = 3;
*(_BYTE *)(result + 3) = 0;
*(_QWORD *)(result + 8) = v13;
*(_OWORD *)(result + 16) = 0;
return result;
}