//
// sub_14035D5C0 from 0x14035d5c0 to 0x14035d6ca (266 bytes)
//
// 5 xrefs:
// > sub_14035A160 @ 0x14035a316
// > sub_14054E6E0 @ 0x14054e866
// > ??> @ 0x1408ba09c
// > ??> @ 0x1408ba0ac
// > ??> @ 0x140921110
//
// 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_14035D5C0(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
void **v4; // rbx
void **i; // rsi
void **v10; // r8
__int64 result; // rax
v4 = *(void ***)a1;
if ( *(_QWORD *)a1 )
{
for ( i = *(void ***)(a1 + 8); v4 != i; v4 += 29 )
{
sub_140069730((__int64)(v4 + 25));
sub_140358980(v4, (__int64)v4);
}
v10 = *(void ***)a1;
if ( (unsigned __int64)(232 * ((*(_QWORD *)(a1 + 16) - *(_QWORD *)a1) / 232LL)) >= 0x1000 )
{
if ( (unsigned __int64)((char *)v10 - (_BYTE *)*(v10 - 1) - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
v10 = (void **)*(v10 - 1);
}
j_j_free(v10);
}
*(_QWORD *)a1 = a2;
*(_QWORD *)(a1 + 8) = a2 + 232 * a3;
result = a2 + 232 * a4;
*(_QWORD *)(a1 + 16) = result;
return result;
}