//
// sub_10054BDE0 from 0x10054bde0 to 0x10054c0b0 (720 bytes)
//
// 1 xrefs:
// > ClearPlatformerSavesPopup::FLAlert_Clicked @ 0x1008b4f90
//
// This function is hookable on this platform (idp: pc, 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:32:01 +0000
//
__int64 __fastcall sub_10054BDE0(double a1, __int64 a2, int a3)
{
_QWORD *v3; // r15
__int64 v4; // rax
unsigned int v5; // r14d
__int64 v6; // r12
__int64 v7; // rdi
unsigned int v8; // eax
__int64 v9; // rax
__int64 v10; // r12
__int64 v11; // rdi
unsigned int v12; // eax
__int64 v13; // rax
__int64 v14; // r12
__int64 v15; // rdi
unsigned int v16; // eax
__int64 v17; // rax
__int64 v18; // r15
__int64 v19; // rdi
unsigned int v20; // eax
__int64 v21; // rax
__int64 v22; // r15
unsigned int i; // r12d
__int64 v24; // rax
unsigned int v25; // ecx
v3 = (_QWORD *)GameLevelManager::sharedState();
v4 = v3[95];
v5 = 0;
if ( v4 )
{
v6 = *(_QWORD *)(v4 + 56);
if ( v6 )
{
v5 = 0;
do
{
v7 = *(_QWORD *)(v6 + 264);
v6 = *(_QWORD *)(v6 + 288);
if ( !v7 || *(_DWORD *)(v7 + 900) != 5 )
continue;
if ( a3 == 2 )
{
if ( *(_BYTE *)(v7 + 912) != 1 )
continue;
}
else if ( !a3 && *(_BYTE *)(v7 + 912) )
{
continue;
}
v8 = *(unsigned __int8 *)(v7 + 1472);
if ( (v8 & 1) == 0 )
{
if ( !(v8 >> 1) )
continue;
LABEL_16:
sub_1005839A0(v7);
++v5;
continue;
}
if ( *(_QWORD *)(v7 + 1480) )
goto LABEL_16;
}
while ( v6 );
}
}
v9 = v3[106];
if ( v9 )
{
v10 = *(_QWORD *)(v9 + 56);
while ( 1 )
{
while ( 1 )
{
do
{
if ( !v10 )
goto LABEL_32;
v11 = *(_QWORD *)(v10 + 264);
v10 = *(_QWORD *)(v10 + 288);
}
while ( !v11 || *(_DWORD *)(v11 + 900) != 5 );
if ( a3 == 2 )
break;
if ( a3 || !*(_BYTE *)(v11 + 912) )
goto LABEL_27;
}
if ( *(_BYTE *)(v11 + 912) == 1 )
{
LABEL_27:
v12 = *(unsigned __int8 *)(v11 + 1472);
if ( (v12 & 1) != 0 )
{
if ( *(_QWORD *)(v11 + 1480) )
{
LABEL_31:
sub_1005839A0(v11);
++v5;
}
}
else if ( v12 >> 1 )
{
goto LABEL_31;
}
}
}
}
LABEL_32:
v13 = v3[117];
if ( v13 )
{
v14 = *(_QWORD *)(v13 + 56);
while ( 1 )
{
while ( 1 )
{
do
{
if ( !v14 )
goto LABEL_47;
v15 = *(_QWORD *)(v14 + 264);
v14 = *(_QWORD *)(v14 + 288);
}
while ( !v15 || *(_DWORD *)(v15 + 900) != 5 );
if ( a3 == 2 )
break;
if ( a3 || !*(_BYTE *)(v15 + 912) )
goto LABEL_42;
}
if ( *(_BYTE *)(v15 + 912) == 1 )
{
LABEL_42:
v16 = *(unsigned __int8 *)(v15 + 1472);
if ( (v16 & 1) != 0 )
{
if ( *(_QWORD *)(v15 + 1480) )
{
LABEL_46:
sub_1005839A0(v15);
++v5;
}
}
else if ( v16 >> 1 )
{
goto LABEL_46;
}
}
}
}
LABEL_47:
v17 = v3[93];
if ( v17 )
{
v18 = *(_QWORD *)(v17 + 56);
while ( 1 )
{
while ( 1 )
{
do
{
if ( !v18 )
goto LABEL_62;
v19 = *(_QWORD *)(v18 + 264);
v18 = *(_QWORD *)(v18 + 288);
}
while ( !v19 || *(_DWORD *)(v19 + 900) != 5 );
if ( a3 == 2 )
break;
if ( a3 || !*(_BYTE *)(v19 + 912) )
goto LABEL_57;
}
if ( *(_BYTE *)(v19 + 912) == 1 )
{
LABEL_57:
v20 = *(unsigned __int8 *)(v19 + 1472);
if ( (v20 & 1) != 0 )
{
if ( *(_QWORD *)(v19 + 1480) )
{
LABEL_61:
sub_1005839A0(v19);
++v5;
}
}
else if ( v20 >> 1 )
{
goto LABEL_61;
}
}
}
}
LABEL_62:
v21 = LocalLevelManager::sharedState(a1);
v22 = *(_QWORD *)(v21 + 360);
if ( v22 && (unsigned int)sub_1007FEF90(*(_QWORD *)(v21 + 360)) )
{
for ( i = 0; i < (unsigned int)sub_1007FEF90(v22); ++i )
{
v24 = sub_1007FEFE0(v22, i);
if ( !v24 || *(_DWORD *)(v24 + 900) != 5 )
continue;
if ( a3 == 2 )
{
if ( *(_BYTE *)(v24 + 912) != 1 )
continue;
}
else if ( !a3 && *(_BYTE *)(v24 + 912) )
{
continue;
}
v25 = *(unsigned __int8 *)(v24 + 1472);
if ( (v25 & 1) == 0 )
{
if ( !(v25 >> 1) )
continue;
LABEL_77:
sub_1005839A0(v24);
++v5;
continue;
}
if ( *(_QWORD *)(v24 + 1480) )
goto LABEL_77;
}
}
return v5;
}