//
// sub_1002E56D0 from 0x1002e56d0 to 0x1002e5859 (393 bytes)
//
// 2 xrefs:
// > sub_1002E5490 @ 0x1002e55eb
// > sub_1002E5490 @ 0x1002e5665
//
// 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_1002E56D0(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
__int64 v5; // r14
__int64 v6; // r15
__int64 v7; // rcx
v5 = a2;
if ( a2 != a3 )
{
v6 = 0;
do
{
*(_DWORD *)(a4 + v6) = *(_DWORD *)(a2 + v6);
sub_100278300((_QWORD *)(a4 + v6 + 4), (_QWORD *)(a2 + v6 + 4));
memcpy((void *)(a4 + v6 + 12), (const void *)(a2 + v6 + 12), 0x1A6u);
if ( a4 == a2 )
{
sub_100278300((_QWORD *)(a4 + v6 + 464), (_QWORD *)(a2 + v6 + 464));
*(_QWORD *)(a4 + v6 + 472) = *(_QWORD *)(a2 + v6 + 472);
*(_DWORD *)(a4 + v6 + 480) = *(_DWORD *)(a2 + v6 + 480);
}
else
{
sub_1002E5860(
a4 + v6 + 440,
*(_QWORD *)(a2 + v6 + 440),
*(_QWORD *)(a2 + v6 + 448),
0x6DB6DB6DB6DB6DB7LL * ((__int64)(*(_QWORD *)(a2 + v6 + 448) - *(_QWORD *)(a2 + v6 + 440)) >> 6));
sub_100278300((_QWORD *)(a4 + v6 + 464), (_QWORD *)(a2 + v6 + 464));
*(_QWORD *)(a4 + v6 + 472) = *(_QWORD *)(a2 + v6 + 472);
*(_DWORD *)(a4 + v6 + 480) = *(_DWORD *)(a2 + v6 + 480);
sub_100094950(
(char **)(a4 + v6 + 488),
*(char **)(a2 + v6 + 488),
*(_QWORD *)(a2 + v6 + 496),
(__int64)(*(_QWORD *)(a2 + v6 + 496) - *(_QWORD *)(a2 + v6 + 488)) >> 2);
}
v7 = a2 + v6;
*(_QWORD *)(a4 + v6 + 512) = *(_QWORD *)(a2 + v6 + 512);
v6 += 520;
}
while ( v7 + 520 != a3 );
return v6 + a2;
}
return v5;
}