//
// sub_1002F9AE0 from 0x1002f9ae0 to 0x1002f9bbb (219 bytes)
//
// 1 xrefs:
// > sub_1002F9440 @ 0x1002f94fa
//
// 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
//
_QWORD *__fastcall sub_1002F9AE0(_QWORD *a1, __int64 a2, int *a3)
{
char *v4; // r13
__int64 v5; // rax
const void *v6; // r15
signed __int64 v7; // r12
char *v8; // rax
char *v9; // r14
__int64 v11; // [rsp+0h] [rbp-30h]
v4 = (char *)operator new(0x30u);
*a1 = v4;
a1[1] = a2;
a1[2] = 0;
*(_OWORD *)v4 = 0;
v5 = *a3;
*((_DWORD *)v4 + 4) = v5;
*(_OWORD *)(v4 + 24) = 0;
*((_QWORD *)v4 + 5) = 0;
v6 = *((const void **)a3 + 1);
v7 = *((_QWORD *)a3 + 2) - (_QWORD)v6;
if ( v7 )
{
v11 = v5;
if ( 0x8E38E38E38E38E39LL * (v7 >> 3) >= 0x38E38E38E38E38FLL )
sub_1002F4280();
v8 = (char *)operator new(v7);
*((_QWORD *)v4 + 3) = v8;
*((_QWORD *)v4 + 4) = v8;
v9 = &v8[v7];
*((_QWORD *)v4 + 5) = &v8[v7];
memcpy(v8, v6, v7);
*((_QWORD *)v4 + 4) = v9;
v5 = v11;
}
*((_BYTE *)a1 + 16) = 1;
*((_QWORD *)v4 + 1) = v5;
return a1;
}