//
// sub_1000AE924 from 0x1000ae924 to 0x1000aebc0 (668 bytes)
//
// 1 xrefs:
// > ClearPlatformerSavesPopup::FLAlert_Clicked @ 0x1004aa7e4
//
// 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:37 +0000
//
__int64 __fastcall sub_1000AE924(__int64 a1, int a2)
{
__int64 v3; // x0
_QWORD *v4; // x21
__int64 v5; // x8
__int64 v6; // x22
__int64 v7; // x20
__int64 v8; // x8
__int64 v9; // x22
__int64 v10; // x8
__int64 v11; // x22
__int64 v12; // x8
__int64 v13; // x21
__int64 v14; // x0
__int64 v15; // x21
__int64 v16; // x22
__int64 v17; // x0
v3 = GameLevelManager::sharedState();
v4 = (_QWORD *)v3;
v5 = *(_QWORD *)(v3 + 760);
if ( v5 )
{
v6 = *(_QWORD *)(v5 + 56);
if ( v6 )
{
v7 = 0;
while ( 1 )
{
v3 = *(_QWORD *)(v6 + 264);
v6 = *(_QWORD *)(v6 + 288);
if ( !v3 || *(_DWORD *)(v3 + 900) != 5 )
goto LABEL_14;
if ( a2 == 2 )
{
if ( *(_BYTE *)(v3 + 912) != 1 )
goto LABEL_14;
}
else if ( !a2 && (*(_BYTE *)(v3 + 912) & 1) != 0 )
{
goto LABEL_14;
}
if ( (*(char *)(v3 + 1495) & 0x8000000000000000LL) != 0 )
{
if ( !*(_QWORD *)(v3 + 1480) )
goto LABEL_14;
LABEL_13:
v3 = sub_1000CEBEC();
v7 = (unsigned int)(v7 + 1);
goto LABEL_14;
}
if ( *(_BYTE *)(v3 + 1495) )
goto LABEL_13;
LABEL_14:
if ( !v6 )
goto LABEL_19;
}
}
}
v7 = 0;
LABEL_19:
v8 = v4[106];
if ( v8 )
{
v9 = *(_QWORD *)(v8 + 56);
while ( v9 )
{
v3 = *(_QWORD *)(v9 + 264);
v9 = *(_QWORD *)(v9 + 288);
if ( !v3 || *(_DWORD *)(v3 + 900) != 5 )
continue;
if ( a2 == 2 )
{
if ( *(_BYTE *)(v3 + 912) != 1 )
continue;
}
else if ( !a2 && (*(_BYTE *)(v3 + 912) & 1) != 0 )
{
continue;
}
if ( (*(char *)(v3 + 1495) & 0x8000000000000000LL) != 0 )
{
if ( !*(_QWORD *)(v3 + 1480) )
continue;
LABEL_33:
v3 = sub_1000CEBEC();
v7 = (unsigned int)(v7 + 1);
continue;
}
if ( *(_BYTE *)(v3 + 1495) )
goto LABEL_33;
}
}
v10 = v4[117];
if ( v10 )
{
v11 = *(_QWORD *)(v10 + 56);
while ( v11 )
{
v3 = *(_QWORD *)(v11 + 264);
v11 = *(_QWORD *)(v11 + 288);
if ( !v3 || *(_DWORD *)(v3 + 900) != 5 )
continue;
if ( a2 == 2 )
{
if ( *(_BYTE *)(v3 + 912) != 1 )
continue;
}
else if ( !a2 && (*(_BYTE *)(v3 + 912) & 1) != 0 )
{
continue;
}
if ( (*(char *)(v3 + 1495) & 0x8000000000000000LL) != 0 )
{
if ( !*(_QWORD *)(v3 + 1480) )
continue;
LABEL_49:
v3 = sub_1000CEBEC();
v7 = (unsigned int)(v7 + 1);
continue;
}
if ( *(_BYTE *)(v3 + 1495) )
goto LABEL_49;
}
}
v12 = v4[93];
if ( v12 )
{
v13 = *(_QWORD *)(v12 + 56);
while ( v13 )
{
v3 = *(_QWORD *)(v13 + 264);
v13 = *(_QWORD *)(v13 + 288);
if ( !v3 || *(_DWORD *)(v3 + 900) != 5 )
continue;
if ( a2 == 2 )
{
if ( *(_BYTE *)(v3 + 912) != 1 )
continue;
}
else if ( !a2 && (*(_BYTE *)(v3 + 912) & 1) != 0 )
{
continue;
}
if ( (*(char *)(v3 + 1495) & 0x8000000000000000LL) != 0 )
{
if ( !*(_QWORD *)(v3 + 1480) )
continue;
LABEL_65:
v3 = sub_1000CEBEC();
v7 = (unsigned int)(v7 + 1);
continue;
}
if ( *(_BYTE *)(v3 + 1495) )
goto LABEL_65;
}
}
v14 = LocalLevelManager::sharedState(v3);
v15 = *(_QWORD *)(v14 + 360);
if ( v15 && (unsigned int)sub_1002E757C(*(_QWORD *)(v14 + 360)) )
{
v16 = 0;
do
{
v17 = sub_1002E75A0(v15, v16);
if ( !v17 || *(_DWORD *)(v17 + 900) != 5 )
goto LABEL_80;
if ( a2 == 2 )
{
if ( *(_BYTE *)(v17 + 912) != 1 )
goto LABEL_80;
}
else if ( !a2 && (*(_BYTE *)(v17 + 912) & 1) != 0 )
{
goto LABEL_80;
}
if ( (*(char *)(v17 + 1495) & 0x8000000000000000LL) != 0 )
{
if ( !*(_QWORD *)(v17 + 1480) )
goto LABEL_80;
LABEL_79:
sub_1000CEBEC();
v7 = (unsigned int)(v7 + 1);
goto LABEL_80;
}
if ( *(_BYTE *)(v17 + 1495) )
goto LABEL_79;
LABEL_80:
v16 = (unsigned int)(v16 + 1);
}
while ( (unsigned int)v16 < (unsigned int)sub_1002E757C(v15) );
}
return v7;
}