//
// LevelBrowserLayer::setIDPopupClosed from 0x10049a2a4 to 0x10049a3b0 (268 bytes)
//
// 3 xrefs:
// > LevelListLayer::setIDPopupClosed @ 0x1002e3894
// > sub_10049A3B0 @ 0x10049a3b4
// > ??> @ 0x10097bc08
//
// 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:05:58 +0000
//
void __fastcall LevelBrowserLayer::setIDPopupClosed(__int64 a1, __int64 a2, int a3)
{
int v5; // w20
__int64 v6; // x1
__int64 v7; // x8
__int64 v8; // x0
const std::string::value_type *v9; // x1
int v10; // w9
__int64 v12; // x20
__int64 v13; // x8
char *v14; // x1
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) == 4 )
{
if ( (a3 & ~(a3 >> 31)) >= 999 )
v5 = 999;
else
v5 = a3 & ~(a3 >> 31);
if ( *(_QWORD *)(a1 + 664) )
{
*(_DWORD *)(GameManager::sharedState() + 964) = 0;
*(_DWORD *)(GameManager::sharedState() + 968) = 0;
v6 = *(_QWORD *)(a1 + 664);
*(_DWORD *)(v6 + 420) = v5;
*(_DWORD *)(v6 + 392) = 0;
LevelBrowserLayer::loadPage((_QWORD *)a1, v6);
v7 = *(_QWORD *)(a1 + 664);
if ( v7 && *(_DWORD *)(v7 + 316) == 99 )
{
v8 = GameManager::sharedState();
v9 = "0092";
}
else
{
v8 = GameManager::sharedState();
v9 = "0091";
}
GameManager::setIntGameVariable(v8, v9, v5);
}
}
else
{
v10 = *(_DWORD *)(a1 + 744);
if ( v10 >= a3 || v10 <= 0 )
v12 = (unsigned int)(a3 - 1);
else
v12 = (unsigned int)v10;
v13 = *(_QWORD *)(a1 + 664);
if ( v13 && *(_DWORD *)(v13 + 392) != (_DWORD)v12 )
{
*(_DWORD *)(GameManager::sharedState() + 964) = 0;
*(_DWORD *)(GameManager::sharedState() + 968) = 0;
v14 = sub_1000D5DB8(*(_QWORD *)(a1 + 664), v12);
LevelBrowserLayer::loadPage((_QWORD *)a1, (__int64)v14);
}
}
}