//
// sub_140110240 from 0x140110240 to 0x140110485 (581 bytes)
//
// 16 xrefs:
// > DeathTrackerPopup::refreshView @ 0x140107053
// > DeathTrackerPopup::refreshView @ 0x140107266
// > DeathTrackerPopup::refreshView @ 0x1401073ac
// > DeathTrackerPopup::refreshView @ 0x14010757f
// > DeathTrackerPopup::refreshView @ 0x140107882
// > DeathTrackerPopup::refreshView @ 0x140107a7e
// > DeathTrackerPopup::refreshView @ 0x140107bd3
// > DeathTrackerPopup::refreshGlobal @ 0x140108fc0
// > DeathTrackerPopup::refreshGlobal @ 0x1401091fe
// > DeathTrackerPopup::refreshGlobal @ 0x1401093fa
// > DeathTrackerPopup::refreshGlobal @ 0x14010952d
// > ??> @ 0x140896764
// > ??> @ 0x140896784
// > ??> @ 0x140896798
// > ??> @ 0x1408967a8
// > ??> @ 0x140915d4c
//
// 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
//
_QWORD *__fastcall sub_140110240(_QWORD *a1, _QWORD *a2, __int64 a3)
{
_QWORD *v3; // rbx
__int64 v6; // r8
__int64 v7; // rsi
__int64 v8; // rdx
unsigned __int64 v9; // r12
unsigned __int64 v10; // rdx
unsigned __int64 v11; // rcx
__int64 v12; // r13
_QWORD *v13; // rbp
_QWORD *v14; // r14
__int64 v15; // r8
_QWORD *v16; // r9
_QWORD *v17; // rcx
_QWORD *v18; // rdx
__int64 v19; // rcx
__int64 v20; // rdx
_QWORD *v21; // r9
__int64 v22; // rcx
__int64 v23; // rdx
__int64 v24; // r8
_QWORD *v25; // r9
_QWORD *v26; // rbx
_QWORD *i; // rsi
_QWORD *v28; // r8
v3 = a2;
v6 = 0x249249249249249LL;
v7 = ((__int64)a2 - *a1) / 112;
v8 = (a1[1] - *a1) / 112LL;
if ( v8 == 0x249249249249249LL )
sub_14005A170();
v9 = v8 + 1;
v10 = (a1[2] - *a1) / 112LL;
if ( v10 <= 0x249249249249249LL - (v10 >> 1) )
{
v11 = v9;
if ( (v10 >> 1) + v10 >= v9 )
v11 = (v10 >> 1) + v10;
if ( v11 > 0x249249249249249LL )
sub_140009CF0(v11, v10, 0x249249249249249LL);
v6 = v11;
}
v12 = 14 * v6;
v13 = sub_14003D460(112 * v6);
v14 = &v13[14 * v7];
sub_1401106E0(v14, a3);
v16 = (_QWORD *)a1[1];
v17 = v13;
v18 = (_QWORD *)*a1;
if ( v3 == v16 )
{
if ( v18 != v16 )
{
do
{
sub_1401106E0(v17, v18);
v17 = (_QWORD *)(v19 + 112);
v18 = (_QWORD *)(v20 + 112);
}
while ( v18 != v21 );
}
}
else
{
for ( ; v18 != v3; v18 = (_QWORD *)(v23 + 112) )
{
sub_1401106E0(v17, v18);
v17 = (_QWORD *)(v22 + 112);
}
if ( v3 != (_QWORD *)a1[1] )
{
do
{
sub_1401106E0(v15, v3);
v15 = v24 + 112;
v3 += 14;
}
while ( v3 != v25 );
}
}
v26 = (_QWORD *)*a1;
if ( *a1 )
{
for ( i = (_QWORD *)a1[1]; v26 != i; v26 += 14 )
{
sub_14003D310((__int64)(v26 + 9));
sub_14003D310((__int64)(v26 + 5));
sub_14003D310((__int64)(v26 + 1));
}
v28 = (_QWORD *)*a1;
if ( (unsigned __int64)(112 * ((a1[2] - *a1) / 112LL)) >= 0x1000 )
{
if ( (unsigned __int64)v28 - *(v28 - 1) - 8 > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
v28 = (_QWORD *)*(v28 - 1);
}
j_j_free(v28);
}
*a1 = v13;
a1[1] = &v13[14 * v9];
a1[2] = &v13[v12];
return v14;
}