//
// UILayer::announceLevelControls from 0x6f1c2c to 0x6f1ffc (976 bytes)
//
// 2 xrefs:
// > PlayLayer::onEnterTransitionDidFinish @ 0x6f2dd4
// > ??> @ 0x50e18
//
// 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 12:51:49 +0000
//
__int64 __fastcall UILayer::announceLevelControls(UILayer *this)
{
GameManager *v3; // x0
_QWORD *v4; // x1
__int64 v5; // x0
int v6; // w0
int v7; // w2
size_t v8; // x2
char *v9; // x1
size_t v10; // x2
char *v11; // x1
GameManager *v12; // x0
__int64 v13; // x3
__int64 v14; // x2
__int64 v15; // x1
unsigned __int8 v16; // w0
int v17; // w6
size_t v18; // x2
unsigned __int8 v19; // w0
__int64 v20; // x4
int v21; // w7
__int64 v22; // x3
const char *v23; // x23
size_t v24; // x24
size_t v25; // x25
unsigned __int64 v26; // x0
char *v27; // x3
char *v28; // x1
unsigned __int64 v29; // x22
unsigned __int8 *v30; // x0
unsigned __int8 *v31; // x1
unsigned __int8 *v32; // x3
unsigned __int8 *v33; // x2
int v34; // t1
_QWORD v35[2]; // [xsp+58h] [xbp+58h] BYREF
void *v36; // [xsp+68h] [xbp+68h]
__int64 v37; // [xsp+70h] [xbp+70h] BYREF
size_t v38; // [xsp+78h] [xbp+78h]
void *v39; // [xsp+80h] [xbp+80h]
if ( *((_BYTE *)this + 648) )
return _stack_chk_guard;
if ( *((_BYTE *)this + 626) )
return _stack_chk_guard;
if ( !*((_BYTE *)this + 596) )
return _stack_chk_guard;
v3 = *((GameManager **)this + 80);
if ( !v3 || !*(_QWORD *)(GameManager::sharedState(v3) + 544) )
return _stack_chk_guard;
v4 = *((_QWORD **)this + 80);
*((_BYTE *)this + 648) = 1;
v35[0] = 0;
v5 = v4[12];
v35[1] = 0;
v36 = nullptr;
if ( v5 )
{
strcpy((char *)v35 + 1, "Keyboard");
v13 = v4[19];
v14 = v4[20];
v6 = 16;
LOBYTE(v35[0]) = 16;
if ( v13 == v14 )
{
if ( !v4[17] )
{
LABEL_26:
v12 = (GameManager *)(unsigned int)(v6 >> 1);
if ( !(_DWORD)v12 )
return _stack_chk_guard;
goto LABEL_27;
}
goto LABEL_24;
}
}
else
{
v6 = LOBYTE(v35[0]);
v7 = v35[0] & 1;
if ( v4[19] == v4[20] )
goto LABEL_12;
}
if ( v6 >> 1 )
{
v8 = 8;
v9 = " + Touch";
}
else
{
v8 = 5;
v9 = "Touch";
}
std::string::append((__int64)v35, v9, v8);
v6 = LOBYTE(v35[0]);
v4 = *((_QWORD **)this + 80);
v7 = v35[0] & 1;
LABEL_12:
if ( !v4[17] )
goto LABEL_17;
if ( !v7 )
{
LABEL_24:
if ( v6 >> 1 )
goto LABEL_15;
LABEL_25:
v10 = 10;
v11 = "Controller";
goto LABEL_16;
}
if ( !v35[1] )
goto LABEL_25;
LABEL_15:
v10 = 13;
v11 = " + Controller";
LABEL_16:
std::string::append((__int64)v35, v11, v10);
v6 = LOBYTE(v35[0]);
v7 = v35[0] & 1;
LABEL_17:
if ( !v7 )
goto LABEL_26;
v12 = (GameManager *)v35[1];
if ( !v35[1] )
{
LABEL_19:
operator delete(v36);
return _stack_chk_guard;
}
LABEL_27:
v15 = *(_QWORD *)(*(_QWORD *)(GameManager::sharedState(v12) + 544) + 1936LL);
if ( *(_BYTE *)(v15 + 1844) )
goto LABEL_33;
v16 = *(_BYTE *)(v15 + 1816);
v17 = v16 & 1;
v18 = v16 >> 1;
if ( (v16 & 1) != 0 )
v18 = *(_QWORD *)(v15 + 1824);
v19 = *(_BYTE *)(v15 + 1784);
v20 = v15 + 1784;
v21 = v19 & 1;
v22 = v19 >> 1;
if ( (v19 & 1) != 0 )
v22 = *(_QWORD *)(v15 + 1792);
if ( v18 != v22 )
goto LABEL_33;
v30 = (unsigned __int8 *)(v15 + 1817);
if ( v17 )
v30 = *(unsigned __int8 **)(v15 + 1832);
v31 = (unsigned __int8 *)(v15 + 1785);
if ( v21 )
v31 = *(unsigned __int8 **)(v20 + 16);
if ( v17 )
{
if ( v18 && memcmp(v30, v31, v18) )
goto LABEL_33;
}
else if ( v18 )
{
if ( *v30 == *v31 )
{
v32 = v30 + 1;
v33 = &v30[v18];
do
{
++v31;
if ( v32 == v33 )
goto LABEL_59;
v34 = *v32++;
}
while ( *v31 == v34 );
}
LABEL_33:
v23 = "Custom Controls: ";
goto LABEL_34;
}
LABEL_59:
v23 = "Creator Controls: ";
LABEL_34:
v37 = 0;
v38 = 0;
v39 = nullptr;
v24 = strlen(v23);
v25 = LOBYTE(v35[0]) >> 1;
if ( (v35[0] & 1) != 0 )
v25 = v35[1];
v26 = v25 + v24;
if ( v25 + v24 > 0xFFFFFFFFFFFFFFEFLL )
sub_62BD04();
if ( v26 > 0x16 )
{
v29 = (v26 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v27 = (char *)operator new(v29);
v37 = v29 | 1;
v39 = v27;
v38 = v24;
}
else
{
v27 = (char *)&v37 + 1;
LOBYTE(v37) = 2 * v24;
}
if ( v24 )
v27 = (char *)memcpy(v27, v23, v24);
v27[v24] = 0;
v28 = (char *)v35 + 1;
if ( (v35[0] & 1) != 0 )
v28 = (char *)v36;
std::string::append((__int64)&v37, v28, v25);
UILayer::showTextAlert((__int64)this, (__int64)&v37, 0, 1, 2.0);
if ( (v37 & 1) != 0 )
operator delete(v39);
if ( (v35[0] & 1) != 0 )
goto LABEL_19;
return _stack_chk_guard;
}