//
// sub_100021ED8 from 0x100021ed8 to 0x100021f4c (116 bytes)
//
// 2 xrefs:
// > sub_100021CA0 @ 0x100021d94
// > sub_100021CA0 @ 0x100021dc4
//
// 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_100021ED8(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
__int64 v5; // x20
__int128 v7; // q1
v5 = a2;
if ( a2 != a3 )
{
do
{
v7 = *(_OWORD *)(v5 + 16);
*(_OWORD *)a4 = *(_OWORD *)v5;
*(_OWORD *)(a4 + 16) = v7;
if ( v5 != a4 )
sub_100017888(
(__int64 *)(a4 + 32),
*(char **)(v5 + 32),
*(char **)(v5 + 40),
(__int64)(*(_QWORD *)(v5 + 40) - *(_QWORD *)(v5 + 32)) >> 2);
v5 += 56;
a4 += 56;
}
while ( v5 != a3 );
return a3;
}
return v5;
}