//
// sub_1008DC970 from 0x1008dc970 to 0x1008dca4a (218 bytes)
//
// 3 xrefs:
// > sub_1008DC6D0 @ 0x1008dc80b
// > sub_1008DC6D0 @ 0x1008dc936
// > sub_10091D490 @ 0x10091d58c
//
// 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:37:44 +0000
//
__int64 __fastcall sub_1008DC970(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
__int64 v4; // rbx
__int64 v6; // r15
_QWORD *v7; // rdi
__int64 v9; // [rsp+28h] [rbp-28h]
v4 = a4;
v9 = a4;
if ( a2 != a3 )
{
v6 = a2;
do
{
*(_DWORD *)v4 = *(_DWORD *)v6;
if ( (*(_BYTE *)(v6 + 8) & 1) != 0 )
{
sub_10001AD30((_QWORD *)(v4 + 8), *(const void **)(v6 + 24), *(_QWORD *)(v6 + 16));
}
else
{
*(_QWORD *)(v4 + 24) = *(_QWORD *)(v6 + 24);
*(_OWORD *)(v4 + 8) = *(_OWORD *)(v6 + 8);
}
v7 = (_QWORD *)(v4 + 32);
if ( (*(_BYTE *)(v6 + 32) & 1) != 0 )
{
sub_10001AD30(v7, *(const void **)(v6 + 48), *(_QWORD *)(v6 + 40));
}
else
{
*(_QWORD *)(v4 + 48) = *(_QWORD *)(v6 + 48);
*(_OWORD *)v7 = *(_OWORD *)(v6 + 32);
}
v6 += 56;
v4 = v9 + 56;
v9 += 56;
}
while ( v6 != a3 );
}
return v4;
}