//
// MenuLayer::willClose from 0x1403360b0 to 0x140336146 (150 bytes)
//
// 5 xrefs:
// > sub_140333810 @ 0x1403338ce
// > MenuLayer::onPlay @ 0x1403359df
// > MenuLayer::onCreator @ 0x140335d3f
// > MenuLayer::onGarage @ 0x140335dcf
// > ??> @ 0x1406d5204
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=1
void MenuLayer::willClose(MenuLayer *a1)
{
GooglePlayManager *v2; // rax
GooglePlayDelegate *v3; // rdx
void *v4; // [rsp+30h] [rbp+8h]
v2 = GooglePlayManager::sharedState();
v3 = &a1->GooglePlayDelegate;
if ( !a1 )
v3 = nullptr;
if ( v2->m_delegate1 == v3 )
GooglePlayManager::sharedState()->m_delegate1 = nullptr;
if ( !qword_1406C2ED8 )
{
v4 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v4);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
}
*(_BYTE *)(qword_1406C2ED8 + 560) = 0;
}