//
// sub_14035D380 from 0x14035d380 to 0x14035d44a (202 bytes)
//
// 4 xrefs:
// > sub_14035A820 @ 0x14035a9b1
// > sub_14035A9F0 @ 0x14035abeb
// > sub_14054E360 @ 0x14054e4ac
// > ??> @ 0x1409210d4
//
// 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_14035D380(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
_QWORD *v6; // rcx
__int64 result; // rax
v6 = *(_QWORD **)a1;
if ( v6 )
{
if ( (unsigned __int64)(96 * ((*(_QWORD *)(a1 + 16) - (_QWORD)v6) / 96LL)) >= 0x1000 )
{
if ( (unsigned __int64)v6 - *(v6 - 1) - 8 > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
v6 = (_QWORD *)*(v6 - 1);
}
j_j_free(v6);
}
*(_QWORD *)a1 = a2;
*(_QWORD *)(a1 + 8) = a2 + 96 * a3;
result = a2 + 96 * a4;
*(_QWORD *)(a1 + 16) = result;
return result;
}