//
// GJGarageLayer::scene from 0x14037b600 to 0x14037b7bc (444 bytes)
//
// 5 xrefs:
// > GJShopLayer::onBack @ 0x1403b3126
// > GJShopLayer::dialogClosed @ 0x1403b4b6c
// > LevelInfoLayer::onGarage @ 0x14041ee9f
// > MenuLayer::onGarage @ 0x140474fe9
// > ??> @ 0x1409227fc
//
// 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:31:03 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall GJGarageLayer::scene(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
__int64 v4; // rsi
__int64 v5; // rcx
cocos2d::CCLayer *v6; // rdi
_QWORD *v7; // rax
__int64 (__fastcall *v8)(cocos2d::CCLayer *); // rdx
char v9; // al
v4 = cocos2d::CCScene::create(a1, a2, a3, a4);
*(_QWORD *)(cocos2d::CCApplication::sharedApplication(v5) + 232) = v4;
v6 = (cocos2d::CCLayer *)operator new(0x260u);
cocos2d::CCLayer::CCLayer(v6);
*(_QWORD *)v6 = &GJGarageLayer::`vftable';
*((_QWORD *)v6 + 40) = &GJGarageLayer::`vftable';
*((_QWORD *)v6 + 41) = &GJGarageLayer::`vftable';
*((_QWORD *)v6 + 42) = &GJGarageLayer::`vftable';
*((_QWORD *)v6 + 43) = &GJGarageLayer::`vftable';
*((_QWORD *)v6 + 44) = &GJGarageLayer::`vftable';
*((_QWORD *)v6 + 51) = &GJGarageLayer::`vftable';
*((_QWORD *)v6 + 52) = &GJGarageLayer::`vftable';
*((_QWORD *)v6 + 53) = &GJGarageLayer::`vftable';
*((_QWORD *)v6 + 54) = &GJGarageLayer::`vftable';
*((_QWORD *)v6 + 55) = &GJGarageLayer::`vftable';
*((_QWORD *)v6 + 56) = &GJGarageLayer::`vftable';
*((_QWORD *)v6 + 57) = &GJGarageLayer::`vftable';
*((_QWORD *)v6 + 59) = 0;
*((_QWORD *)v6 + 62) = 0;
*((_QWORD *)v6 + 63) = 0;
*((_BYTE *)v6 + 512) = 0;
*((_QWORD *)v6 + 65) = 0;
*((_QWORD *)v6 + 66) = 0;
v7 = operator new(0x28u);
*v7 = v7;
v7[1] = v7;
v7[2] = v7;
*((_WORD *)v7 + 12) = 257;
*((_QWORD *)v6 + 65) = v7;
*((_QWORD *)v6 + 68) = 0;
*((_QWORD *)v6 + 69) = 0;
*((_QWORD *)v6 + 70) = 0;
*((_QWORD *)v6 + 74) = 0;
*((_BYTE *)v6 + 600) = 0;
v8 = *(__int64 (__fastcall **)(cocos2d::CCLayer *))(*(_QWORD *)v6 + 72LL);
if ( (char *)v8 == (char *)GJGarageLayer::init )
v9 = GJGarageLayer::init(v6);
else
v9 = v8(v6);
if ( v9 )
{
cocos2d::CCObject::autorelease(v6);
}
else
{
(*(void (__fastcall **)(cocos2d::CCLayer *, __int64))(*(_QWORD *)v6 + 8LL))(v6, 1);
v6 = nullptr;
}
(*(void (__fastcall **)(__int64, cocos2d::CCLayer *))(*(_QWORD *)v4 + 464LL))(v4, v6);
return v4;
}