//
// GJGarageLayer::onBack from 0x1003a10a0 to 0x1003a120c (364 bytes)
//
// 3 xrefs:
// > GJGarageLayer::keyBackClicked @ 0x1003a3c98
// > sub_1003A3C9C @ 0x1003a3ca0
// > GJGarageLayer::init @ 0x10039f218
//
// 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:03:46 +0000
//
__int64 __fastcall GJGarageLayer::onBack(__int64 result)
{
_BYTE *v1; // x19
__int64 v2; // x0
__int64 v3; // x0
__int64 v4; // x0
__int64 v5; // x20
__int64 v6; // x0
__int64 v7; // x0
_OWORD *v8; // x0
_OWORD *v9; // x20
char v10; // w0
__int64 v11; // x1
__int64 v12; // x2
__int64 v13; // x3
__int64 v14; // x4
__int64 v15; // x5
__int64 v16; // x6
__int64 v17; // x7
__int64 v18; // x0
__int64 v19; // x19
_DWORD *v20; // x0
char *v21; // x0
double v22; // [xsp+10h] [xbp-20h] BYREF
__int64 v23; // [xsp+18h] [xbp-18h] BYREF
if ( (*(_BYTE *)(result + 512) & 1) == 0 )
{
v1 = (_BYTE *)result;
result = cocos2d::CCDirector::sharedDirector();
if ( (*(_BYTE *)(result + 176) & 1) == 0 )
{
v2 = (*(__int64 (__fastcall **)(_BYTE *, _QWORD))(*(_QWORD *)v1 + 1072LL))(v1, 0);
v3 = GameManager::sharedState(v2);
if ( (*(_BYTE *)(v3 + 1080) & 1) != 0 )
{
*(_BYTE *)(GameManager::sharedState(v3) + 1080) = 0;
cocos2d::CCObject::retain((__int64)v1);
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)v1 + 520LL))(v1);
(*(void (__fastcall **)(_BYTE *, _QWORD))(*(_QWORD *)v1 + 1072LL))(v1, 0);
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::popScene(v4);
result = cocos2d::CCDirector::sharedDirector();
v5 = *(_QWORD *)(result + 280);
if ( v5 )
{
v1[512] = 1;
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::willSwitchToScene(v6, v5);
(*(void (__fastcall **)(__int64, _BYTE *, __int64))(*(_QWORD *)v5 + 464LL))(v5, v1, 1000);
cocos2d::CCObject::release(v1);
v7 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v7, &v23);
sub_1000262BC((float *)&v22, 0.0, *((float *)&v23 + 1));
v8 = cocos2d::CCMoveTo::create(&v22, 0.3);
v9 = cocos2d::CCEaseIn::create((__int64)v8, 2.0);
v10 = (unsigned __int8)cocos2d::CCCallFunc::create((__int64)v1, 536, 1);
v18 = sub_10021D420((__int64)v9, v11, v12, v13, v14, v15, v16, v17, v10);
return cocos2d::CCNode::runAction((__int64)v1, v18);
}
}
else
{
v1[512] = 1;
v19 = cocos2d::CCDirector::sharedDirector();
v20 = MenuLayer::scene(0);
v21 = cocos2d::CCTransitionFade::create_1((__int64)v20, 0.5);
return cocos2d::CCDirector::replaceScene(v19, v21);
}
}
}
return result;
}