//
// EndLevelLayer::onRestartCheckpoint from 0x7d356c to 0x7d3750 (484 bytes)
//
// 3 xrefs:
// > ??> @ 0x8d3d8
// > EndLevelLayer::customSetup @ 0x7d6a20
// > ??> @ 0x122cd00
//
// 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
//
void EndLevelLayer::onRestartCheckpoint(EndLevelLayer *a1, cocos2d::CCObject *a2)
{
GameManager *v3; // x0
FMODAudioEngine *v4; // x0
FMODAudioEngine *v5; // x22
void *v6; // x0
cocos2d::CCSequence *v7; // x21
cocos2d::CCFiniteTimeAction *v8; // x0
cocos2d::CCAction *v9; // x21
unsigned int *v10; // x2
int v11; // w1
__int64 v12; // [xsp+40h] [xbp+40h] BYREF
if ( !a1->m_exiting )
{
a1->m_exiting = (unsigned __int8)&dword_0 + 1;
v3 = GameManager::sharedState();
if ( !GameManager::getGameVariable(v3, "0024") )
PlatformToolbox::hideCursor();
v4 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::clearAllAudio(v4);
v5 = FMODAudioEngine::sharedEngine();
sub_D153B8((int)&v12, "playSound_01.ogg");
FMODAudioEngine::playEffect((__int64)v5, (__int64)&v12, 1.0, 0.0, 0.3);
v6 = (void *)(v12 - 24);
if ( (__int64 *)(v12 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v10 = (unsigned int *)(v12 - 8);
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
}
else
{
v11 = *(_DWORD *)(v12 - 8);
*(_DWORD *)(v12 - 8) = v11 - 1;
}
if ( v11 <= 0 )
operator delete(v6);
}
a1->exitLayer(a1, nullptr);
a1->setTouchEnabled(a1, 0);
a1->setKeyboardEnabled(a1, 0);
a1->setKeypadEnabled(a1, 0);
v7 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create(0.5);
v8 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1->m_playLayer, 1560, 1);
v9 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v7, v8, 0);
v9->setTag(v9, 16);
cocos2d::CCNode::runAction(a1->m_playLayer, v9);
}
}