//
// sub_1000AFF8C from 0x1000aff8c to 0x1000b00d4 (328 bytes)
//
// 2 xrefs:
// > LocalLevelManager::saveFinished @ 0x100260894
// > GameManager::saveFinished @ 0x1003baf4c
//
// 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 10:58:38 +0000
//
void __fastcall sub_1000AFF8C(__int64 a1, __int64 *a2)
{
std::mutex *v3; // x19
_QWORD *v4; // x20
__int64 v5; // x8
__int64 v6; // x24
unsigned __int64 v7; // x25
_QWORD *v8; // x1
int IntegerForKey; // w23
__int64 *v10; // x1
void *v11; // x0
void *v12; // x0
if ( *a2 != a2[1] )
{
v3 = (std::mutex *)qword_1009F3988;
std::mutex::lock((std::mutex *)qword_1009F3988);
v4 = operator new(0xF0u);
j_DS_Dictionary::DS_Dictionary();
if ( (unsigned int)sub_1000AF258((__int64)v4) )
{
v5 = *a2;
if ( a2[1] != *a2 )
{
v6 = 0;
v7 = 0;
do
{
v8 = (_QWORD *)(v5 + v6);
if ( *(char *)(v5 + v6 + 23) < 0 )
v8 = (_QWORD *)*v8;
if ( (unsigned int)DS_Dictionary::stepIntoSubDictWithKey(v4, v8) )
{
IntegerForKey = DS_Dictionary::getIntegerForKey(v4, "sq");
sub_1001EA32C(v4);
}
else
{
IntegerForKey = -1;
}
v5 = *a2;
v10 = (__int64 *)(*a2 + v6);
if ( IntegerForKey == *((_DWORD *)v10 + 6) )
{
if ( *((char *)v10 + 23) < 0 )
v10 = (__int64 *)*v10;
DS_Dictionary::removeKey(v4, v10);
v5 = *a2;
}
++v7;
v6 += 32;
}
while ( v7 < (a2[1] - v5) >> 5 );
}
sub_1000AF6A4();
}
v11 = (void *)v4[26];
if ( v11 )
{
v4[27] = v11;
operator delete(v11);
}
v12 = (void *)pugi::xml_document::dxml_document(v4);
operator delete(v12);
std::mutex::unlock(v3);
}
}