//
// sub_14010FDA0 from 0x14010fda0 to 0x14010ffe2 (578 bytes)
//
// 7 xrefs:
// > DeathTrackerPopup::buildHistory @ 0x14010c651
// > DeathTrackerPopup::buildHistory @ 0x14010c72f
// > DeathTrackerPopup::buildHistory @ 0x14010c806
// > DeathTrackerPopup::buildHistory @ 0x14010c999
// > DeathTrackerPopup::buildHistory @ 0x14010ca72
// > DeathTrackerPopup::buildHistory @ 0x14010cbdd
// > ??> @ 0x140915d34
//
// 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:49 +0000
//
// Hidden C++ exception states: #wind=1
_DWORD *__fastcall sub_14010FDA0(_QWORD *a1, _QWORD *a2, _DWORD *a3)
{
_QWORD *v6; // r8
__int64 v7; // r14
__int64 v8; // rdx
unsigned __int64 v9; // r15
unsigned __int64 v10; // rdx
unsigned __int64 v11; // rcx
unsigned __int64 v12; // rbx
_QWORD *v13; // rbp
_DWORD *v14; // r14
_QWORD *v15; // rdx
_QWORD *v16; // rcx
_DWORD *v17; // r8
_QWORD *v18; // rbx
_QWORD *i; // rsi
_QWORD *v20; // r8
__int64 v22; // [rsp+90h] [rbp+8h]
v6 = (_QWORD *)*a1;
v7 = ((__int64)a2 - *a1) / 56;
v8 = (a1[1] - *a1) / 56LL;
if ( v8 == 0x492492492492492LL )
sub_14005A170();
v9 = v8 + 1;
v10 = (a1[2] - (_QWORD)v6) / 56LL;
v11 = v10 >> 1;
if ( v10 <= 0x492492492492492LL - (v10 >> 1) )
{
v12 = v9;
if ( v11 + v10 >= v9 )
v12 = v11 + v10;
if ( v12 > 0x492492492492492LL )
sub_140009CF0(v11, v10, v6);
}
else
{
v12 = 0x492492492492492LL;
}
v22 = 7 * v12;
v13 = sub_14003D460(56 * v12);
v14 = &v13[7 * v7];
*v14 = *a3;
v14[1] = a3[1];
v14[2] = a3[2];
v14[3] = a3[3];
v14[4] = a3[4];
v14[5] = a3[5];
sub_14003F4F0((__int64)(v14 + 6), (__int64)(a3 + 6));
v15 = (_QWORD *)a1[1];
v16 = (_QWORD *)*a1;
v17 = v13;
if ( a2 != v15 )
{
sub_1401104C0(v16, a2, v13);
v17 = v14 + 14;
v15 = (_QWORD *)a1[1];
v16 = a2;
}
sub_1401104C0(v16, v15, v17);
v18 = (_QWORD *)*a1;
if ( *a1 )
{
for ( i = (_QWORD *)a1[1]; v18 != i; v18 += 7 )
sub_14003D310((__int64)(v18 + 3));
v20 = (_QWORD *)*a1;
if ( (unsigned __int64)(56 * ((a1[2] - *a1) / 56LL)) >= 0x1000 )
{
if ( (unsigned __int64)v20 - *(v20 - 1) - 8 > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
v20 = (_QWORD *)*(v20 - 1);
}
j_j_free(v20);
}
*a1 = v13;
a1[1] = &v13[7 * v9];
a1[2] = &v13[v22];
return v14;
}