//
// sub_998DD4 from 0x998dd4 to 0x998e30 (92 bytes)
//
// 4 xrefs:
// > GJBaseGameLayer::unlockExistingFirstParents @ 0x9a399c
// > GJBaseGameLayer::lockExistingFirstParents @ 0x9c99e8
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x9e2324
// > GJBaseGameLayer::resetLevelVariables @ 0x9e782c
//
// This function is hookable on this platform (idp: arm, 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 12:58:03 +0000
//
__int64 __fastcall sub_998DD4(_QWORD *a1)
{
_QWORD *v2; // x0
_QWORD *v3; // x19
__int64 v4; // x2
__int64 result; // x0
v2 = (_QWORD *)a1[2];
if ( v2 )
{
do
{
v3 = (_QWORD *)*v2;
operator delete(v2);
v2 = v3;
}
while ( v3 );
}
v4 = a1[1];
result = 0;
a1[2] = 0;
if ( v4 )
{
do
*(_QWORD *)(*a1 + 8 * result++) = 0;
while ( result != v4 );
}
a1[3] = 0;
return result;
}