//
// sub_1002E6770 from 0x1002e6770 to 0x1002e6852 (226 bytes)
//
// 3 xrefs:
// > sub_1002E64E0 @ 0x1002e66d3
// > sub_1002E64E0 @ 0x1002e66f3
// > sub_1002E6C30 @ 0x1002e6ccb
//
// 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_1002E6770(__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 + 64;
do
{
*(_BYTE *)(v6 - 32) = *((_BYTE *)v5 + 32);
v7 = *v5;
*(_OWORD *)(v6 - 48) = v5[1];
*(_OWORD *)(v6 - 64) = v7;
*(_OWORD *)(v6 - 24) = 0;
*(_QWORD *)(v6 - 8) = 0;
v8 = *((const void **)v5 + 5);
v9 = *((_QWORD *)v5 + 6) - (_QWORD)v8;
if ( v9 )
{
if ( v9 < 0 )
sub_100093980();
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 += 4;
v6 += 64;
}
while ( v5 != a3 );
return v6 - 64;
}
return v4;
}