//
// PlayLayer::resumeAndRestart from 0x1403ba3c0 to 0x1403ba640 (640 bytes)
//
// 3 xrefs:
// > PauseLayer::onRestart @ 0x14037e48b
// > PauseLayer::onRestartFull @ 0x14037e52b
// > ??> @ 0x1406d70e8
//
// 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
//
// local variable allocation has failed, the output may be wrong!
// Hidden C++ exception states: #wind=5
void PlayLayer::resumeAndRestart(PlayLayer *a1, bool a2)
{
FMODAudioEngine *v4; // rcx
FMODAudioEngine *v5; // rcx
__int64 v6; // rax
__int64 v7; // rdx
__int64 v8; // rcx
UILayer *m_uiLayer; // rcx
__int64 v10; // rcx
GameManager *v11; // rcx
__int64 v12; // rcx
cocos2d::CCEGLView *v13; // rax
GameManager *v14; // rcx
__int64 v15; // rcx
cocos2d::CCEGLView *v16; // rax
FMODAudioEngine *v17; // [rsp+30h] [rbp+8h]
FMODAudioEngine *v18; // [rsp+30h] [rbp+8h]
FMODAudioEngine *v19; // [rsp+30h] [rbp+8h]
void *v20; // [rsp+30h] [rbp+8h]
void *v21; // [rsp+30h] [rbp+8h]
if ( !a1->m_isPracticeMode || a1->m_practiceMusicSync )
{
if ( a2 || !a1->m_isPlatformer )
{
GJBaseGameLayer::resetAudio(a1);
}
else
{
v4 = (FMODAudioEngine *)qword_1406C2E88;
if ( !qword_1406C2E88 )
{
v17 = (FMODAudioEngine *)operator new(0x888u);
qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v17);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);
v4 = (FMODAudioEngine *)qword_1406C2E88;
}
FMODAudioEngine::stopAllEffects(v4);
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::stopAllMusic(v5, 0);
}
a1->m_musicPrepared = 0;
v6 = 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);
v6 = qword_1406C2E88;
}
a1->m_isSilent = *(float *)(v6 + 512) <= 0.0;
}
a1->m_isPaused = 0;
if ( *(_BYTE *)(cocos2d::CCApplication::sharedApplication(a1, a2) + 217) )
{
*(_BYTE *)(cocos2d::CCApplication::sharedApplication(v8, v7) + 217) = 0;
PlayerObject::releaseAllButtons(a1->m_player1);
m_uiLayer = a1->m_uiLayer;
*(_QWORD *)&m_uiLayer->m_p1TouchId = -1;
*(_WORD *)&m_uiLayer->m_p1Jumping = 0;
m_uiLayer->m_checkpointBtnDown = 0;
UILayer::resetUINodeState(m_uiLayer);
UILayer::toggleMenuVisibility(a1->m_uiLayer, 1);
*(_BYTE *)(cocos2d::CCEGLView::sharedOpenGLView(v10) + 237) = 1;
v11 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v20 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v20);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v11 = (GameManager *)qword_1406C2ED8;
}
if ( GameManager::getGameVariable(v11, "0128") )
{
v13 = (cocos2d::CCEGLView *)cocos2d::CCEGLView::sharedOpenGLView(v12);
cocos2d::CCEGLView::toggleLockCursor(v13, 1);
}
else
{
v14 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v21 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v21);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v14 = (GameManager *)qword_1406C2ED8;
}
if ( !GameManager::getGameVariable(v14, "0024") )
{
v16 = (cocos2d::CCEGLView *)cocos2d::CCEGLView::sharedOpenGLView(v15);
cocos2d::CCEGLView::showCursor(v16, 0);
}
}
a1->onEnter(a1);
if ( a2 )
PlayLayer::resetLevelFromStart(a1);
else
a1->resetLevel(a1);
}
}