//
// GJShopLayer::onBack from 0x100310030 to 0x1003101c7 (407 bytes)
//
// 3 xrefs:
// > GJShopLayer::keyBackClicked @ 0x1003113a5
// > sub_1003113B0 @ 0x1003113bc
// > GJShopLayer::init @ 0x10030f091
//
// 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:28:38 +0000
//
void __fastcall GJShopLayer::onBack(__int64 a1, __int64 a2)
{
_DWORD *v2; // rbx
__int64 v3; // rax
__int64 v4; // rax
__int64 v5; // rsi
__int64 v6; // r14
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax
int v10; // r14d
int v11; // eax
int v12; // ecx
int v13; // r8d
int v14; // r9d
_DWORD *v15; // rdi
__int64 v16; // rsi
int v17; // ebx
__int64 v18; // rdx
__int64 v19; // rax
double v20; // xmm0_8
float v21; // [rsp+8h] [rbp-38h] BYREF
_BYTE v22[4]; // [rsp+10h] [rbp-30h] BYREF
float v23; // [rsp+14h] [rbp-2Ch]
char v24; // [rsp+18h] [rbp-28h] BYREF
void *v25[4]; // [rsp+19h] [rbp-27h] BYREF
if ( !*(_BYTE *)(a1 + 432) )
{
v2 = (_DWORD *)a1;
*(_BYTE *)(a1 + 432) = 1;
v3 = cocos2d::CCDirector::sharedDirector(a1, a2);
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 160LL))(v3);
v5 = a1;
cocos2d::CCTouchDispatcher::unregisterForcePrio(v4, a1);
cocos2d::CCObject::retain(a1);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 520LL))(a1);
if ( *(_DWORD *)(a1 + 456) )
{
a1 = 1;
v6 = SecretRewardsLayer::scene(1);
if ( !v6 )
return;
}
else
{
v6 = GJGarageLayer::scene(a1);
if ( !v6 )
return;
}
v7 = cocos2d::CCDirector::sharedDirector(a1, v5);
if ( (unsigned __int8)cocos2d::CCDirector::replaceScene(v7, v6) )
{
(*(void (__fastcall **)(_DWORD *, _QWORD))(*(_QWORD *)v2 + 1072LL))(v2, 0);
(*(void (__fastcall **)(__int64, _DWORD *, __int64))(*(_QWORD *)v6 + 464LL))(v6, v2, 1000);
cocos2d::CCObject::release(v2);
v8 = cocos2d::CCDirector::sharedDirector(v2, v2);
cocos2d::CCDirector::getWinSize(v22, v8);
sub_100278250(&v21, 0.0, v23);
v9 = cocos2d::CCMoveTo::create(&v21, 0.30000001);
v10 = cocos2d::CCEaseIn::create(v9, 2.0);
v11 = cocos2d::CCCallFunc::create(v2, 537, 0);
v15 = v2;
v16 = sub_10039EB60(v10, v11, 0, v12, v13, v14);
cocos2d::CCNode::runAction((__int64)v2, v16);
v17 = v2[114];
*(_QWORD *)&v20 = GameManager::sharedState(v15, v16, v18).u64[0];
if ( v17 )
{
v24 = 28;
strcpy((char *)v25, "secretLoop.mp3");
GameManager::fadeInMusic(v19, &v24, v20);
if ( (v24 & 1) != 0 )
operator delete(*(void **)((char *)&v25[1] + 7));
}
else
{
GameManager::fadeInMenuMusic(v19, v20);
}
}
}
}