//
// UILayer::resolveLevelControls from 0x1004c2be0 to 0x1004c2ce9 (265 bytes)
//
// 4 xrefs:
// > UILayer::togglePlatformerMode @ 0x1004c2a88
// > UILayer::reapplyLevelControls @ 0x1004c2dad
// > UILayer::refreshDpad @ 0x1004c2f0e
// > UILayer::editorPlaytest @ 0x1004c37ec
//
// 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:31:06 +0000
//
void __fastcall UILayer::resolveLevelControls(__int64 a1)
{
_DWORD *v2; // rdi
__int64 v3; // rax
__int64 v4; // rax
char v5; // cl
__int128 *v6; // rax
unsigned int v7; // eax
unsigned __int64 v8; // rdx
__int64 v9; // rax
__int128 v10; // [rsp+0h] [rbp-20h] BYREF
void *__p; // [rsp+10h] [rbp-10h]
v2 = *(_DWORD **)(a1 + 640);
if ( v2 )
{
cocos2d::CCObject::release(v2);
*(_QWORD *)(a1 + 640) = 0;
}
v3 = *(_QWORD *)(a1 + 600);
if ( v3 )
{
v4 = *(_QWORD *)(v3 + 1936);
if ( v4 )
{
if ( *(_DWORD *)(v4 + 1840) == 1 )
{
v5 = *(_BYTE *)(v4 + 1816);
if ( (v5 & 1) != 0 )
{
if ( !*(_QWORD *)(v4 + 1824) )
return;
v8 = *(_QWORD *)(v4 + 1824);
if ( !v8 )
{
LOWORD(v10) = 0;
v7 = 0;
goto LABEL_16;
}
sub_10001AD30(&v10, *(const void **)(v4 + 1832), v8);
v7 = (unsigned __int8)v10;
if ( (v10 & 1) == 0 )
goto LABEL_16;
}
else
{
if ( !v5 )
return;
v6 = (__int128 *)(v4 + 1816);
__p = *((void **)v6 + 2);
v10 = *v6;
v7 = (unsigned __int8)v10;
if ( (v10 & 1) == 0 )
{
LABEL_16:
if ( v7 >> 1 )
{
LABEL_17:
v9 = sub_100923C60(&v10);
*(_QWORD *)(a1 + 640) = v9;
if ( v9 )
cocos2d::CCObject::retain(v9);
}
LABEL_19:
if ( (v10 & 1) != 0 )
operator delete(__p);
return;
}
}
if ( *((_QWORD *)&v10 + 1) )
goto LABEL_17;
goto LABEL_19;
}
}
}
}