//
// GJShopLayer::onBack from 0x1402acd70 to 0x1402acf8c (540 bytes)
//
// 3 xrefs:
// > GJShopLayer::keyBackClicked @ 0x1402acf99
// > GJShopLayer::init @ 0x1402aaa73
// > ??> @ 0x1406d2264
//
// 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=3
void GJShopLayer::onBack(GJShopLayer *a1, cocos2d::CCObject *a2)
{
float v2; // xmm0_4
float v3; // xmm3_4
__int64 v5; // rax
cocos2d::CCTouchDispatcher *v6; // rax
cocos2d::CCScene *v7; // rax
__int64 v8; // rcx
struct cocos2d::CCScene *v9; // rbx
cocos2d::CCDirector *v10; // rax
__int64 v11; // rcx
cocos2d::CCDirector *v12; // rax
const struct cocos2d::CCPoint *v13; // rax
struct cocos2d::CCMoveTo *v14; // rax
struct cocos2d::CCEaseIn *v15; // rbx
__int64 v16; // rax
struct cocos2d::CCSequence *v17; // rax
cocos2d::ccColor3B *v18; // r8
__int64 v19; // rcx
GameManager *v20; // rcx
float v21[4]; // [rsp+20h] [rbp-28h] BYREF
__int64 v22; // [rsp+30h] [rbp-18h]
__int64 v23; // [rsp+38h] [rbp-10h]
void *v24; // [rsp+60h] [rbp+18h]
void *v25; // [rsp+68h] [rbp+20h]
if ( !a1->m_closing )
{
a1->m_closing = 1;
v5 = cocos2d::CCDirector::sharedDirector(a1);
v6 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 144LL))(v5);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v6, a1);
cocos2d::CCObject::retain(a1);
a1->removeFromParent(a1);
v7 = a1->m_type ? SecretRewardsLayer::scene(1) : GJGarageLayer::scene();
v9 = v7;
if ( v7 )
{
v10 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v8);
if ( cocos2d::CCDirector::replaceScene(v10, v9) )
{
a1->setKeypadEnabled(a1, 0);
v9->addChild_0(v9, a1, 1000);
cocos2d::CCObject::release(a1);
v12 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v11);
cocos2d::CCDirector::getWinSize(v12);
cocos2d::CCPoint::CCPoint(v2, 0.0);
v14 = cocos2d::CCMoveTo::create(0.30000001, v13);
v15 = cocos2d::CCEaseIn::create(v14, 2.0);
v16 = cocos2d::CCCallFunc::create(a1, sub_14003BE70);
v17 = cocos2d::CCSequence::create(v15, v16, 0);
cocos2d::CCNode::runAction((CCLightFlash *)a1, (cocos2d::CCPoint)v17, v18, v3, v21[0]);
if ( a1->m_type )
{
HIBYTE(v21[3]) = 0;
v22 = 14;
v23 = 15;
strcpy((char *)v21, "secretLoop.mp3");
if ( !qword_1406C2ED8 )
{
v25 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v25);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
}
GameManager::fadeInMusic(v19, (__int64)v21);
}
else
{
v20 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v24 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v24);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v20 = (GameManager *)qword_1406C2ED8;
}
GameManager::fadeInMenuMusic(v20);
}
}
}
}
}