//
// PlayLayer::resetLevelFromStart from 0x140518a50 to 0x140518bff (431 bytes)
//
// 7 xrefs:
// > PauseLayer::onResume @ 0x1404dade7
// > PlayLayer::fullReset @ 0x1405189ba
// > PlayLayer::togglePracticeMode @ 0x14051a097
// > PlayLayer::resumeAndRestart @ 0x14051a9de
// > UILayer::handleAction @ 0x140672847
// > UILayer::handleAction @ 0x140672aba
// > ??> @ 0x14092adf4
//
// 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:33:34 +0000
//
// Hidden C++ exception states: #wind=5
void __fastcall PlayLayer::resetLevelFromStart(_BYTE *a1)
{
__int64 v2; // rcx
bool GameVariable; // si
__int64 v4; // rcx
_QWORD *v5; // rdi
__int64 v6; // rcx
__int64 v7; // rcx
void *v8; // [rsp+30h] [rbp+8h]
void *v9; // [rsp+30h] [rbp+8h]
void *v10; // [rsp+30h] [rbp+8h]
void *v11; // [rsp+30h] [rbp+8h]
v2 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v8 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v8);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = qword_14090BFD0;
}
GameVariable = GameManager::getGameVariable(v2, "0146");
v4 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v9 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v9);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v4 = qword_14090BFD0;
}
GameManager::setGameVariable(v4, "0146", 1u);
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1432LL))(a1);
if ( !a1[13024] || a1[13025] )
{
v5 = (_QWORD *)qword_14090BF60;
if ( !qword_14090BF60 )
{
v10 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v10);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
v5 = (_QWORD *)qword_14090BF60;
}
v6 = v5[69];
if ( v6 )
FMOD::ChannelControl::stop(v6);
sub_14003EB60(v5 + 137);
sub_14003EB60(v5 + 145);
sub_14003EB60(v5 + 153);
}
a1[13097] = 1;
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1456LL))(a1);
v7 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v11 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v11);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v7 = qword_14090BFD0;
}
GameManager::setGameVariable(v7, "0146", GameVariable);
}