//
// sub_14035D6D0 from 0x14035d6d0 to 0x14035d7bd (237 bytes)
//
// 4 xrefs:
// > sub_14035B670 @ 0x14035b7ca
// > ??> @ 0x1408ba0c0
// > ??> @ 0x1408ba0d0
// > ??> @ 0x140921134
//
// 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:30:51 +0000
//
__int64 __fastcall sub_14035D6D0(_QWORD *a1, __int64 a2, __int64 a3, __int64 a4)
{
_QWORD *v4; // rbx
_QWORD *i; // rdi
_QWORD *v10; // r8
v4 = (_QWORD *)*a1;
if ( *a1 )
{
for ( i = (_QWORD *)a1[1]; v4 != i; v4 += 5 )
sub_140069730((__int64)(v4 + 2));
v10 = (_QWORD *)*a1;
if ( (unsigned __int64)(40 * ((a1[2] - *a1) / 40LL)) >= 0x1000 )
{
if ( (unsigned __int64)v10 - *(v10 - 1) - 8 > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
v10 = (_QWORD *)*(v10 - 1);
}
j_j_free(v10);
}
*a1 = a2;
a1[1] = a2 + 40 * a3;
a1[2] = a2 + 40 * a4;
return 5 * a4;
}