//
// sub_140418E30 from 0x140418e30 to 0x140418efa (202 bytes)
//
// 6 xrefs:
// > sub_140416DE0 @ 0x140416f2e
// > sub_140416F60 @ 0x1404170a1
// > PlayLayer::saveDynamicSaveObjects @ 0x140517b42
// > sub_14051BA40 @ 0x14051bae3
// > sub_14051D0D0 @ 0x14051d298
// > ??> @ 0x140926594
//
// 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_140418E30(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
_QWORD *v6; // rcx
__int64 result; // rax
v6 = *(_QWORD **)a1;
if ( v6 )
{
if ( (unsigned __int64)(48 * ((*(_QWORD *)(a1 + 16) - (_QWORD)v6) / 48LL)) >= 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 + 48 * a3;
result = a2 + 48 * a4;
*(_QWORD *)(a1 + 16) = result;
return result;
}