//
// sub_1002FB5E0 from 0x1002fb5e0 to 0x1002fb6ba (218 bytes)
//
// 2 xrefs:
// > sub_1002FB340 @ 0x1002fb545
// > sub_1002FB340 @ 0x1002fb565
//
// 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_1002FB5E0(__int64 a1, __int128 *a2, __int128 *a3, __int64 a4)
{
__int64 v4; // rbx
__int128 *v5; // r15
__int64 v6; // rbx
__int128 v7; // xmm0
const void *v8; // r12
signed __int64 v9; // r13
char *v10; // rax
char *v11; // r14
v4 = a4;
if ( a2 != a3 )
{
v5 = a2;
v6 = a4 + 56;
do
{
v7 = *v5;
*(_OWORD *)(v6 - 43) = *(__int128 *)((char *)v5 + 13);
*(_OWORD *)(v6 - 56) = v7;
*(_OWORD *)(v6 - 24) = 0;
*(_QWORD *)(v6 - 8) = 0;
v8 = *((const void **)v5 + 4);
v9 = *((_QWORD *)v5 + 5) - (_QWORD)v8;
if ( v9 )
{
if ( v9 < 0 )
sub_1000C40D0();
v10 = (char *)operator new(v9);
*(_QWORD *)(v6 - 24) = v10;
*(_QWORD *)(v6 - 16) = v10;
v11 = &v10[v9];
*(_QWORD *)(v6 - 8) = &v10[v9];
memcpy(v10, v8, v9);
*(_QWORD *)(v6 - 16) = v11;
}
v5 = (__int128 *)((char *)v5 + 56);
v6 += 56;
}
while ( v5 != a3 );
return v6 - 56;
}
return v4;
}