//
// sub_140249D70 from 0x140249d70 to 0x140249e22 (178 bytes)
//
// 9 xrefs:
// > EditorUI::onPlayback @ 0x140111b18
// > sub_140207A90 @ 0x140208858
// > GJBaseGameLayer::resetLevelVariables @ 0x14023b1f4
// > sub_140251160 @ 0x140251166
// > LevelEditorLayer::updateGameObjects @ 0x1402dcdf0
// > LevelEditorLayer::onPlaytest @ 0x1402e05c4
// > ??> @ 0x140682af4
// > ??> @ 0x140682b04
// > ??> @ 0x1406cea0c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
unsigned __int64 __fastcall sub_140249D70(_QWORD *a1)
{
unsigned __int64 v2; // rcx
unsigned __int64 result; // rax
_QWORD **v4; // rcx
_QWORD *v5; // rcx
_QWORD *v6; // rbx
unsigned __int64 *v7; // rdx
unsigned __int64 *v8; // rcx
unsigned __int64 v9; // [rsp+30h] [rbp+8h] BYREF
v2 = a1[2];
if ( v2 )
{
if ( a1[7] >> 3 <= v2 )
{
v4 = (_QWORD **)a1[1];
*v4[1] = 0;
v5 = *v4;
if ( v5 )
{
do
{
v6 = (_QWORD *)*v5;
j_j_free(v5);
v5 = v6;
}
while ( v6 );
}
*(_QWORD *)a1[1] = a1[1];
*(_QWORD *)(a1[1] + 8LL) = a1[1];
a1[2] = 0;
v7 = (unsigned __int64 *)a1[4];
v8 = (unsigned __int64 *)a1[3];
v9 = a1[1];
return sub_140060560(v8, v7, &v9);
}
else
{
return sub_14024BA00(a1, *(_QWORD *)a1[1], a1[1]);
}
}
return result;
}