//
// PlatformerControlsPopup::reapplyRuntime from 0x1404508f0 to 0x1404509ff (271 bytes)
//
// 5 xrefs:
// > PlatformerControlsPopup::onApplyCreator @ 0x1404512bf
// > PlatformerControlsPopup::onLevelControlsRefreshed @ 0x140451597
// > PlatformerControlsPopup::onToggleSource @ 0x1404517b0
// > PlatformerControlsPopup::onClose @ 0x140451cfd
// > ??> @ 0x1409276c8
//
// 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:32:27 +0000
//
// Hidden C++ exception states: #wind=5
__int64 PlatformerControlsPopup::reapplyRuntime()
{
__int64 result; // rax
__int64 v1; // rsi
__int64 v2; // rsi
__int64 v3; // rdi
__int64 v4; // rax
__int64 v5; // rax
void *v6; // [rsp+30h] [rbp+8h]
result = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v6 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v6);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
result = qword_14090BFD0;
}
v1 = *(_QWORD *)(result + 560);
if ( v1 )
{
v2 = *(_QWORD *)(v1 + 13888);
if ( v2 )
{
if ( *(_BYTE *)(v2 + 596) )
UILayer::resolveLevelControls(v2);
if ( (!*(_BYTE *)(v2 + 626) || *(_BYTE *)(v2 + 627))
&& *(_BYTE *)(v2 + 596)
&& (v3 = *(_QWORD *)(v2 + 640)) != 0
&& (*(_QWORD *)(v3 + 88) || *(_QWORD *)(v3 + 120)) )
{
v4 = GJKeybindManager::sharedState();
GJKeybindManager::applyMovementOverride(v4, v3 + 72, v3 + 104);
}
else
{
v5 = GJKeybindManager::sharedState();
GJKeybindManager::clearMovementOverride(v5);
}
*(_QWORD *)(v2 + 584) = -1;
*(_WORD *)(v2 + 578) = 0;
*(_BYTE *)(v2 + 580) = 0;
return UILayer::resetUINodeState(v2);
}
}
return result;
}