//
// MenuLayer::willClose from 0x140475280 to 0x140475319 (153 bytes)
//
// 5 xrefs:
// > MenuLayer::dMenuLayer @ 0x140471ed9
// > MenuLayer::onPlay @ 0x140474b93
// > MenuLayer::onCreator @ 0x140474f0f
// > MenuLayer::onGarage @ 0x140474f9f
// > ??> @ 0x140928328
//
// 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 11:32:40 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall MenuLayer::willClose(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rdx
__int64 result; // rax
void *v5; // [rsp+30h] [rbp+8h]
v2 = GooglePlayManager::sharedState();
v3 = a1 + 416;
if ( !a1 )
v3 = 0;
if ( *(_QWORD *)(v2 + 320) == v3 )
*(_QWORD *)(GooglePlayManager::sharedState() + 320) = 0;
result = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v5 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v5);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
result = qword_14090BFD0;
}
*(_BYTE *)(qword_14090BFD0 + 600) = 0;
return result;
}