//
// LevelEditorLayer::canAutoSave from 0x10040b340 to 0x10040b414 (212 bytes)
//
// 4 xrefs:
// > LevelEditorLayer::checkAutoSave @ 0x1003ffca0
// > LevelEditorLayer::checkAutoSave @ 0x1003ffd40
// > LevelEditorLayer::doAutoSave @ 0x10040b440
// > LevelEditorLayer::doAutoBackup @ 0x10040b7ec
//
// 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 11:04:45 +0000
//
__int64 __fastcall LevelEditorLayer::canAutoSave(__int64 a1)
{
unsigned __int8 v2; // w8
__int64 v3; // x8
__int64 v4; // x0
__int64 v5; // x0
__int64 v6; // x0
v2 = atomic_load((unsigned __int8 *)(LocalLevelManager::sharedState() + 601));
if ( (v2 & 1) != 0
|| *(_DWORD *)(*(_QWORD *)(a1 + 1936) + 1140LL) != 2
|| *(_DWORD *)(a1 + 1972)
|| (*(_BYTE *)(a1 + 14808) & 1) != 0 )
{
return 0;
}
v3 = *(_QWORD *)(a1 + 14248);
if ( !v3 )
return 1;
if ( (*(_BYTE *)(v3 + 1513) & 1) != 0 || (*(_BYTE *)(v3 + 1512) & 1) != 0 )
return 0;
v4 = *(_QWORD *)(v3 + 760);
if ( v4 )
{
if ( ((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 352LL))(v4) & 1) != 0 )
return 0;
v3 = *(_QWORD *)(a1 + 14248);
}
v5 = *(_QWORD *)(v3 + 784);
if ( v5 )
{
if ( ((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 352LL))(v5) & 1) != 0 )
return 0;
v3 = *(_QWORD *)(a1 + 14248);
}
v6 = *(_QWORD *)(v3 + 792);
if ( !v6 )
return *(_DWORD *)(v3 + 704) == -1;
if ( ((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 352LL))(v6) & 1) != 0 )
return 0;
v3 = *(_QWORD *)(a1 + 14248);
return *(_DWORD *)(v3 + 704) == -1;
}