//
// sub_1002E7030 from 0x1002e7030 to 0x1002e7108 (216 bytes)
//
// 2 xrefs:
// > sub_1002E6D90 @ 0x1002e6f97
// > sub_1002E6D90 @ 0x1002e6fb7
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:28:21 +0000
//
__int64 __fastcall sub_1002E7030(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
__int64 v4; // rbx
__int64 v5; // r15
__int64 v6; // rbx
const void *v7; // r12
signed __int64 v8; // r13
char *v9; // rax
char *v10; // r14
v4 = a4;
if ( a2 != a3 )
{
v5 = a2;
v6 = a4 + 48;
do
{
*(_DWORD *)(v6 - 32) = *(_DWORD *)(v5 + 16);
*(_OWORD *)(v6 - 48) = *(_OWORD *)v5;
*(_OWORD *)(v6 - 24) = 0;
*(_QWORD *)(v6 - 8) = 0;
v7 = *(const void **)(v5 + 24);
v8 = *(_QWORD *)(v5 + 32) - (_QWORD)v7;
if ( v8 )
{
if ( v8 < 0 )
sub_100093980();
v9 = (char *)operator new(v8);
*(_QWORD *)(v6 - 24) = v9;
*(_QWORD *)(v6 - 16) = v9;
v10 = &v9[v8];
*(_QWORD *)(v6 - 8) = &v9[v8];
memcpy(v9, v7, v8);
*(_QWORD *)(v6 - 16) = v10;
}
v5 += 48;
v6 += 48;
}
while ( v5 != a3 );
return v6 - 48;
}
return v4;
}