//
// sub_140101990 from 0x140101990 to 0x140101b4d (445 bytes)
//
// 2 xrefs:
// > sub_140101390 @ 0x1401016db
// > ??> @ 0x140915884
//
// 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 11:26:42 +0000
//
void __fastcall sub_140101990(
char *a1,
char *a2,
char *a3,
__int64 a4,
__int64 a5,
void *a6,
__int64 a7,
unsigned __int8 (__fastcall *a8)(_QWORD, _QWORD),
char *Src,
char *a10,
__int64 a11,
__int64 a12)
{
__int64 v13; // r12
size_t v14; // rdi
char *v15; // rbp
size_t v16; // rbx
v13 = a4 - a11;
if ( a4 == a11 )
goto LABEL_9;
if ( !a12 )
goto LABEL_11;
if ( v13 > a12 || v13 > a7 )
{
if ( a12 <= a7 )
{
v16 = a10 - a2;
memmove(a6, a2, a10 - a2);
memmove(&a10[-(a2 - Src)], Src, a2 - Src);
memmove(Src, a6, v16);
v15 = &Src[v16];
goto LABEL_13;
}
if ( Src == a2 )
{
LABEL_9:
v15 = a10;
goto LABEL_13;
}
if ( a2 != a10 )
{
sub_1406773F0(Src);
sub_1406773F0(a2);
sub_1406773F0(Src);
v15 = &Src[8 * ((a10 - a2) >> 3)];
goto LABEL_13;
}
LABEL_11:
v15 = Src;
goto LABEL_13;
}
v14 = a2 - Src;
memmove(a6, Src, a2 - Src);
memmove(Src, a2, a10 - a2);
v15 = &Src[a10 - a2];
memmove(v15, a6, v14);
LABEL_13:
sub_140100890(a1, Src, v15, a11, a12, a6, a7, a8);
sub_140100890(v15, a10, a3, v13, a5 - a12, a6, a7, a8);
}