//
// sub_140376ED0 from 0x140376ed0 to 0x140376fa1 (209 bytes)
//
// 4 xrefs:
// > GJEffectManager::createKeyframeCommand @ 0x140367219
// > sub_140374630 @ 0x14037477e
// > sub_14054FE40 @ 0x14054ff9b
// > ??> @ 0x140922220
//
// 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:31:01 +0000
//
__int64 __fastcall sub_140376ED0(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
_QWORD *v6; // rcx
_QWORD *v9; // rcx
__int64 result; // rax
v6 = *(_QWORD **)a1;
if ( v6 )
{
sub_140361FF0(v6, *(_QWORD **)(a1 + 8));
v9 = *(_QWORD **)a1;
if ( (unsigned __int64)(448 * ((*(_QWORD *)(a1 + 16) - *(_QWORD *)a1) / 448LL)) >= 0x1000 )
{
if ( (unsigned __int64)v9 - *(v9 - 1) - 8 > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
v9 = (_QWORD *)*(v9 - 1);
}
j_j_free(v9);
}
*(_QWORD *)a1 = a2;
*(_QWORD *)(a1 + 8) = a2 + 448 * a3;
result = a2 + 448 * a4;
*(_QWORD *)(a1 + 16) = result;
return result;
}