//
// sub_100643860 from 0x100643860 to 0x1006438f9 (153 bytes)
//
// 0 xrefs:
//
// 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
//
_OWORD *__fastcall sub_100643860(__int64 a1, char *a2, char *a3, int a4)
{
_OWORD *result; // rax
_OWORD *v5; // r13
size_t v7; // r14
_OWORD *v8; // r15
_OWORD *v9; // rdi
*(_DWORD *)a1 = a4;
v5 = (_OWORD *)(a1 + 8);
*(_OWORD *)(a1 + 8) = 0;
*(_QWORD *)(a1 + 24) = a1 + 8;
*(_QWORD *)(a1 + 32) = a1 + 8;
if ( a2 > a3 )
sub_1007CD560(a1);
v7 = a3 - a2;
if ( (unsigned __int64)(a3 - a2) > 0x10 )
{
result = (_OWORD *)off_10099E670();
if ( !result )
return result;
v8 = result;
result = memcpy(result, a2, v7);
v9 = *(_OWORD **)(a1 + 24);
if ( v9 != v5 )
result = (_OWORD *)off_10099E668(v9);
v5 = v8;
}
else if ( a2 != a3 )
{
*v5 = *(_OWORD *)a2;
}
*(_QWORD *)(a1 + 24) = v5;
*(_QWORD *)(a1 + 32) = (char *)v5 + v7;
return result;
}