//
// cocos2d::CCDirector::popScene from 0x7caa2a to 0x7caa68 (62 bytes)
//
// 1 xrefs:
// > GJGarageLayer::onBack @ 0x50af18
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:00:30 +0000
//
int __fastcall cocos2d::CCDirector::popScene(cocos2d::CCArray **this)
{
int v2; // r1
int result; // r0
cocos2d::CCArray *v4; // r0
cocos2d::CCDirector::checkSceneReference((int)this);
cocos2d::CCArray::removeLastObject(*(this + 58), 1);
v2 = cocos2d::CCArray::count(*(this + 58));
if ( !v2 )
return cocos2d::CCDirector::end((int)this);
v4 = *(this + 58);
*((_BYTE *)this + 228) = 1;
result = cocos2d::CCArray::objectAtIndex(v4, v2 - 1);
*(this + 56) = (cocos2d::CCArray *)result;
return result;
}