//
// sub_140418C70 from 0x140418c70 to 0x140418d5c (236 bytes)
//
// 5 xrefs:
// > sub_1404178B0 @ 0x140417a9f
// > sub_140417AE0 @ 0x140417cce
// > ??> @ 0x1408c87c4
// > ??> @ 0x1408c87d4
// > ??> @ 0x14092654c
//
// 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:32:05 +0000
//
__int64 __fastcall sub_140418C70(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
_QWORD *v4; // rbx
_QWORD *i; // rdi
_QWORD *v10; // r8
v4 = *(_QWORD **)a1;
if ( *(_QWORD *)a1 )
{
for ( i = *(_QWORD **)(a1 + 8); v4 != i; v4 += 3 )
sub_1404166E0(v4);
v10 = *(_QWORD **)a1;
if ( (unsigned __int64)(24 * ((*(_QWORD *)(a1 + 16) - *(_QWORD *)a1) / 24LL)) >= 0x1000 )
{
if ( (unsigned __int64)v10 - *(v10 - 1) - 8 > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
v10 = (_QWORD *)*(v10 - 1);
}
j_j_free(v10);
}
*(_QWORD *)a1 = a2;
*(_QWORD *)(a1 + 8) = a2 + 24 * a3;
*(_QWORD *)(a1 + 16) = a2 + 24 * a4;
return 3 * a4;
}