//
// PlayLayer::togglePracticeMode from 0x10014b418 to 0x10014b4f4 (220 bytes)
//
// 4 xrefs:
// > UILayer::handleAction @ 0x100051eec
// > PlayLayer::fullReset @ 0x10014b3b0
// > PauseLayer::onPracticeMode @ 0x1001bf830
// > PauseLayer::onNormalMode @ 0x1001bf860
//
// This function is hookable on this platform (idp: arm, 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 10:59:36 +0000
//
__int64 __fastcall PlayLayer::togglePracticeMode(__int64 result, int a2)
{
__int64 v2; // x21
char v3; // w20
__int64 *v4; // x19
__int64 v5; // x0
v2 = result + 12288;
if ( *(unsigned __int8 *)(result + 12544) != a2 )
{
v3 = a2;
v4 = (__int64 *)result;
if ( a2 )
{
PlayLayer::writePersistentSave(result);
*(_BYTE *)(v2 + 256) = v3;
sub_1001425DC(v4);
v5 = UILayer::toggleCheckpointsMenu(v4[1661]);
if ( (*(_BYTE *)(v2 + 257) & 1) == 0 )
PlayLayer::playPracticeMusic(v5);
}
else
{
*(_BYTE *)(result + 12544) = 0;
sub_1001425DC((__int64 *)result);
UILayer::toggleCheckpointsMenu(v4[1661]);
if ( *(_DWORD *)(v4[242] + 1140) != 2 && v4[1554] )
GJBaseGameLayer::setActiveStartPosObject(v4);
PlayLayer::resetLevelFromStart(v4);
}
if ( *(_BYTE *)(v2 + 256) == 1 )
cocos2d::CCNode::stopActionByTag(v4, 31);
return sub_10051DBBC(v4);
}
return result;
}