//
// sub_140370000 from 0x140370000 to 0x1403700c3 (195 bytes)
//
// 8 xrefs:
// > GJEffectManager::resetEffects @ 0x14036632f
// > sub_140376E50 @ 0x140376e56
// > sub_140515E30 @ 0x140515f8d
// > sub_14052D810 @ 0x14052d912
// > ??> @ 0x1408bb818
// > ??> @ 0x1408bb82c
// > ??> @ 0x1408bb860
// > ??> @ 0x140921cbc
//
// 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:59 +0000
//
void __fastcall sub_140370000(_QWORD *a1)
{
unsigned __int64 v2; // rcx
__int64 v3; // rsi
_QWORD *v4; // rsi
_QWORD *v5; // rbx
unsigned __int64 *v6; // rdx
unsigned __int64 *v7; // rcx
unsigned __int64 v8; // [rsp+30h] [rbp+8h] BYREF
v2 = a1[2];
if ( v2 )
{
v3 = a1[1];
if ( a1[7] >> 3 <= v2 )
{
**(_QWORD **)(v3 + 8) = 0;
v4 = *(_QWORD **)v3;
if ( v4 )
{
do
{
v5 = (_QWORD *)*v4;
sub_140373970(v4 + 3);
j_j_free(v4);
v4 = v5;
}
while ( v5 );
}
*(_QWORD *)a1[1] = a1[1];
*(_QWORD *)(a1[1] + 8LL) = a1[1];
a1[2] = 0;
v6 = (unsigned __int64 *)a1[4];
v7 = (unsigned __int64 *)a1[3];
v8 = a1[1];
sub_14003EC90(v7, v6, &v8);
}
else
{
sub_140373740(a1, *(_QWORD *)v3, a1[1]);
}
}
}