//
// GJKeybindManager::applyMovementOverride from 0x716210 to 0x7164d0 (704 bytes)
//
// 1 xrefs:
// > UILayer::applyLevelBindings @ 0x3fc6c6
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:57:47 +0000
//
int __fastcall GJKeybindManager::applyMovementOverride(int **this, KeybindSource *a2, KeybindSource *a3)
{
int result; // r0
char *v6; // r6
_DWORD *v7; // r0
int *v8; // r5
int v9; // r4
int v10; // r2
int v11; // r3
int v12; // r1
char *v13; // r3
int v14; // r4
char *v15; // r5
_DWORD *v16; // r0
int v17; // r1
_DWORD *j; // r6
_DWORD *v19; // r9
int *v20; // r6
char *v21; // r3
int v22; // r3
int v23; // r7
GJKeybindManager *v24; // r10
int v25; // t1
char *v26; // r3
int v27; // r1
char *v28; // r7
char *k; // r4
int *v30; // r5
signed int v31; // r2
int v32; // t1
_DWORD *v33; // r3
signed int v34; // r1
_BYTE *v35; // r0
_DWORD *v36; // r0
int i; // [sp+4h] [bp-70h]
int v39; // [sp+4h] [bp-70h]
int *v40; // [sp+10h] [bp-64h]
int v41; // [sp+14h] [bp-60h]
int v42; // [sp+2Ch] [bp-48h] BYREF
_DWORD v43[2]; // [sp+30h] [bp-44h]
int v44[2]; // [sp+38h] [bp-3Ch] BYREF
int v45; // [sp+40h] [bp-34h] BYREF
int v46; // [sp+44h] [bp-30h]
_DWORD *v47; // [sp+48h] [bp-2Ch] BYREF
_DWORD v48[2]; // [sp+4Ch] [bp-28h] BYREF
void *v49; // [sp+54h] [bp-20h] BYREF
char *v50; // [sp+58h] [bp-1Ch]
unsigned int v51; // [sp+5Ch] [bp-18h]
int *v52; // [sp+60h] [bp-14h] BYREF
int v53; // [sp+64h] [bp-10h] BYREF
int v54; // [sp+68h] [bp-Ch]
GJKeybindManager::clearMovementOverride((GJKeybindManager *)this);
if ( sub_71446C((int)a2) || (result = sub_71446C((int)a3)) != 0 )
{
v6 = "erE";
do
{
v47 = *((_DWORD **)v6 + 1);
GJKeybindManager::chordsForAction((GJKeybindManager *)&v49, (int)this, (unsigned int)v47, (int)(v6 + 4));
v7 = std::map>::operator[](this + 23, (int *)&v47);
v8 = (int *)v49;
v9 = (int)v7;
v40 = (int *)v50;
v53 = 0;
v54 = 0;
v52 = &v53;
while ( v8 != v40 )
{
std::__tree::__emplace_hint_unique_key_args(&v52, &v53, v8, v8);
++v8;
}
std::__tree::destroy(v9, *(_DWORD **)(v9 + 4));
v10 = v9 + 4;
*(_DWORD *)v9 = v52;
v11 = v53;
*(_DWORD *)(v9 + 4) = v53;
v12 = v54;
*(_DWORD *)(v9 + 8) = v54;
if ( v12 )
{
*(_DWORD *)&byte_8[v11] = v10;
v52 = &v53;
v53 = 0;
v54 = 0;
}
else
{
*(_DWORD *)v9 = v10;
}
std::__tree::~__tree((int)&v52);
std::__vector_base::~__vector_base((char **)&v49);
v13 = v6 + 8;
v6 += 4;
}
while ( v13 != "GD Keybind Files (*.gdkb)" );
v47 = v48;
v14 = 0;
v43[0] = a2;
v48[0] = 0;
v43[1] = a3;
v48[1] = 0;
v49 = nullptr;
v50 = nullptr;
v51 = 0;
for ( i = 0; ; i = 1 )
{
v23 = v43[i];
if ( sub_71446C(v43[i]) )
{
v15 = "erE";
do
{
v42 = *((_DWORD *)v15 + 1);
v16 = std::map>::operator[](this + 23, &v42);
v19 = v16 + 1;
for ( j = (_DWORD *)*v16; j != v19; j = std::__tree_next *>(j) )
{
v24 = (GJKeybindManager *)j[4];
if ( GJKeybindManager::isControllerChord(v24, v17) == v14 )
GJKeybindManager::unbindChord((GJKeybindManager *)this, (unsigned int)v24, v42);
}
(*(void (__fastcall **)(int **, int, int))(*(_DWORD *)v23 + 8))(&v52, v23, v42);
v20 = v52;
v41 = v53;
while ( v20 != (int *)v41 )
{
v25 = *v20++;
GJKeybindManager::bindChord((GJKeybindManager *)this, v25, v42);
std::__tree::__emplace_unique_key_args((int)v44, (int)&v47, &v42, &v42);
v46 = v25;
v45 = v42;
v26 = v50;
if ( (unsigned int)v50 >= v51 )
{
std::vector>::__push_back_slow_path>(&v49, &v45);
}
else
{
if ( v50 )
{
v27 = v46;
*(_DWORD *)v50 = v45;
*((_DWORD *)v26 + 1) = v27;
}
v50 += 8;
}
}
std::__vector_base::~__vector_base((char **)&v52);
v21 = v15 + 8;
v15 += 4;
}
while ( v21 != "GD Keybind Files (*.gdkb)" );
}
v22 = i;
v14 ^= 1u;
if ( i )
break;
}
v28 = v50;
for ( k = (char *)v49; k != v28; k += 8 )
{
GJKeybindManager::actionsForChord((GJKeybindManager *)&v52, (int)this, *((_DWORD *)k + 1), v22);
v30 = v52;
v39 = v53;
LABEL_33:
while ( v30 != (int *)v39 )
{
v32 = *v30++;
v31 = v32;
v33 = (_DWORD *)v48[0];
v44[0] = v32;
while ( v33 )
{
v34 = v33[4];
if ( v31 >= v34 )
{
if ( v34 >= v31 )
goto LABEL_33;
v33 = (_DWORD *)v33[1];
}
else
{
v33 = (_DWORD *)*v33;
}
}
GJKeybindManager::unbindChord((GJKeybindManager *)this, *((_DWORD *)k + 1), v31);
v36 = std::map>::operator[](this + 26, (int *)k + 1);
std::__tree::__emplace_unique_key_args((int)&v45, (int)v36, v44, v44);
}
std::__vector_base::~__vector_base((char **)&v52);
}
v35 = v49;
*((_BYTE *)this + 116) = 1;
if ( v35 )
{
v50 -= 8 * ((unsigned int)(v50 - v35) >> 3);
operator delete(v35);
}
return std::__tree::~__tree((int)&v47);
}
return result;
}