//
// PlayLayer::togglePracticeMode from 0x10008c560 to 0x10008c6ea (394 bytes)
//
// 6 xrefs:
// > PlayLayer::fullReset @ 0x10008c4f4
// > PauseLayer::onPracticeMode @ 0x1003c1216
// > PauseLayer::onNormalMode @ 0x1003c1247
// > PauseLayer::keyDown @ 0x1003c3404
// > PauseLayer::keyDown @ 0x1003c3446
// > UILayer::handleAction @ 0x1004c4187
//
// 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 12:20:06 +0000
//
void __fastcall PlayLayer::togglePracticeMode(_BYTE *a1, __int64 a2, __int64 a3)
{
unsigned __int8 v3; // r14
unsigned __int8 v4; // r14
__int64 v5; // rdx
if ( a1[12544] != (_BYTE)a2 )
{
if ( (_BYTE)a2 )
{
PlayLayer::writePersistentSave((__int64)a1, a2, a3);
a1[12544] = a2;
v3 = 1;
if ( !(*(unsigned __int8 (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1312LL))(a1) )
v3 = (*(__int64 (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1320LL))(a1);
if ( v3 != (*(unsigned __int8 (__fastcall **)(_QWORD))(**((_QWORD **)a1 + 1727) + 352LL))(*((_QWORD *)a1 + 1727)) )
{
cocos2d::CCDrawNode::clear(*((_QWORD *)a1 + 1727));
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)a1 + 1727) + 344LL))(*((_QWORD *)a1 + 1727), v3);
if ( v3 )
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1304LL))(a1);
}
UILayer::toggleCheckpointsMenu(*((_QWORD *)a1 + 1661), 1);
if ( !a1[12545] )
sub_10008D8C0();
}
else
{
a1[12544] = 0;
v4 = 1;
if ( !(*(unsigned __int8 (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1312LL))(a1) )
v4 = (*(__int64 (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1320LL))(a1);
if ( v4 != (*(unsigned __int8 (__fastcall **)(_QWORD))(**((_QWORD **)a1 + 1727) + 352LL))(*((_QWORD *)a1 + 1727)) )
{
cocos2d::CCDrawNode::clear(*((_QWORD *)a1 + 1727));
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)a1 + 1727) + 344LL))(*((_QWORD *)a1 + 1727), v4);
if ( v4 )
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1304LL))(a1);
}
UILayer::toggleCheckpointsMenu(*((_QWORD *)a1 + 1661), 0);
if ( *(_DWORD *)(*((_QWORD *)a1 + 242) + 1140LL) != 2 && *((_QWORD *)a1 + 1554) )
GJBaseGameLayer::setActiveStartPosObject(a1);
PlayLayer::resetLevelFromStart(a1, 0, v5);
}
if ( a1[12544] == 1 )
cocos2d::CCNode::stopActionByTag(a1, 31);
PlayLayer::dtLiveMarkersChanged(a1);
}
}