//
// EndLevelLayer::onRestartCheckpoint from 0x1401354c0 to 0x1401356c7 (519 bytes)
//
// 2 xrefs:
// > EndLevelLayer::customSetup @ 0x140133f63
// > ??> @ 0x1406c9ef4
//
// 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; // rcx
cocos2d::CCEGLView *v4; // rax
FMODAudioEngine *v5; // rcx
__int64 v6; // r8
__int64 v7; // r9
int v8; // ecx
__int64 v9; // rbx
struct cocos2d::CCDelayTime *v10; // rax
struct cocos2d::CCSequence *v11; // rbx
cocos2d::ccColor3B *v12; // r8
float v13; // [rsp+20h] [rbp-38h]
__int128 v14; // [rsp+30h] [rbp-28h] BYREF
__int64 v15; // [rsp+40h] [rbp-18h]
__int64 v16; // [rsp+48h] [rbp-10h]
void *v17; // [rsp+60h] [rbp+8h]
FMODAudioEngine *v18; // [rsp+60h] [rbp+8h]
FMODAudioEngine *v19; // [rsp+70h] [rbp+18h]
if ( !a1->m_exiting )
{
a1->m_exiting = 1;
v3 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v17 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v17);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v3 = (GameManager *)qword_1406C2ED8;
}
if ( !GameManager::getGameVariable(v3, "0024") )
{
v4 = (cocos2d::CCEGLView *)cocos2d::CCEGLView::sharedOpenGLView();
cocos2d::CCEGLView::showCursor(v4, 0);
}
v5 = (FMODAudioEngine *)qword_1406C2E88;
if ( !qword_1406C2E88 )
{
v18 = (FMODAudioEngine *)operator new(0x888u);
qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v18);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);
v5 = (FMODAudioEngine *)qword_1406C2E88;
}
FMODAudioEngine::clearAllAudio(v5);
v14 = 0;
*(_QWORD *)&v14 = sub_14003AA10(0x20u);
v15 = 16;
v16 = 31;
strcpy((char *)v14, "playSound_01.ogg");
v8 = qword_1406C2E88;
if ( !qword_1406C2E88 )
{
v19 = (FMODAudioEngine *)operator new(0x888u);
qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v19);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);
v8 = qword_1406C2E88;
}
FMODAudioEngine::playEffect(v8, (__int64)&v14, v6, v7, 1050253722);
a1->exitLayer(a1, nullptr);
a1->setTouchEnabled(a1, 0);
a1->setKeyboardEnabled(a1, 0);
a1->setKeypadEnabled(a1, 0);
v9 = cocos2d::CCCallFunc::create(a1->m_playLayer, sub_1401377C0);
v10 = cocos2d::CCDelayTime::create(0.5);
v11 = cocos2d::CCSequence::create(v10, v9, 0);
v11->setTag(v11, 16);
cocos2d::CCNode::runAction((CCLightFlash *)a1->m_playLayer, (cocos2d::CCPoint)v11, v12, 0.0, v13);
}
}