//
// sub_14036FE40 from 0x14036fe40 to 0x14036ff03 (195 bytes)
//
// 8 xrefs:
// > GJEffectManager::resetEffects @ 0x140366537
// > sub_140376E40 @ 0x140376e46
// > sub_140515E30 @ 0x140516017
// > sub_14052DA90 @ 0x14052db92
// > ??> @ 0x1408bb770
// > ??> @ 0x1408bb784
// > ??> @ 0x1408bb7b8
// > ??> @ 0x140921c44
//
// 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_14036FE40(_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_14037A380(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_140373510(a1, *(_QWORD *)v3, a1[1]);
}
}
}