//
// sub_1400C2A20 from 0x1400c2a20 to 0x1400c2aca (170 bytes)
//
// 34 xrefs:
// > sub_14030DAE0 @ 0x14030e556
// > sub_14030DAE0 @ 0x14030e569
// > GJBaseGameLayer::activateEventTrigger @ 0x14033aee3
// > GJBaseGameLayer::controlEventLink @ 0x14033b112
// > sub_140359F40 @ 0x14035a134
// > GJEffectManager::controlActionsForControlID @ 0x1403683d2
// > GJEffectManager::controlActionsForControlID @ 0x1403684fc
// > GJEffectManager::controlActionsForControlID @ 0x14036861b
// > GJEffectManager::controlActionsForControlID @ 0x140368739
// > GJEffectManager::controlActionsForControlID @ 0x140368b1b
// > GJEffectManager::controlActionsForTrigger @ 0x140369079
// > GJEffectManager::controlActionsForTrigger @ 0x1403691b2
// > GJEffectManager::controlActionsForTrigger @ 0x1403692dc
// > GJEffectManager::controlActionsForTrigger @ 0x14036940b
// > GJEffectManager::controlActionsForTrigger @ 0x14036958b
// > GJEffectManager::updateSpawnTriggers @ 0x14036c7bd
// > GJEffectManager::updateCountForItem @ 0x14036cf0f
// > GJEffectManager::updateTimers @ 0x14036df9b
// > sub_140370210 @ 0x14037048f
// > sub_140371090 @ 0x1403710f5
// > sub_140373A00 @ 0x140373dbd
// > sub_1403758F0 @ 0x140375a08
// > sub_1403758F0 @ 0x140375aaf
// > sub_1403758F0 @ 0x140375b09
// > sub_140377680 @ 0x14037774a
// > sub_140377680 @ 0x1403777cf
// > sub_140377680 @ 0x14037784f
// > sub_140377680 @ 0x1403778d0
// > sub_140377AD0 @ 0x140377bbc
// > sub_140377AD0 @ 0x140377bff
// > ??> @ 0x1408904cc
// > ??> @ 0x1408904dc
// > ??> @ 0x1408904f0
// > ??> @ 0x140913ba4
//
// 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:26:19 +0000
//
_QWORD *__fastcall sub_1400C2A20(_QWORD *a1, _QWORD *a2)
{
_QWORD *v4; // rcx
if ( a1 != a2 )
{
v4 = (_QWORD *)*a1;
if ( v4 )
{
if ( ((a1[2] - (_QWORD)v4) & 0xFFFFFFFFFFFFFFFCuLL) >= 0x1000 )
{
if ( (unsigned __int64)v4 - *(v4 - 1) - 8 > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
v4 = (_QWORD *)*(v4 - 1);
}
j_j_free(v4);
*a1 = 0;
a1[1] = 0;
a1[2] = 0;
}
*a1 = *a2;
a1[1] = a2[1];
a1[2] = a2[2];
*a2 = 0;
a2[1] = 0;
a2[2] = 0;
}
return a1;
}