//
// GJKeybindManager::applyNewDefaults from 0xc0e690 to 0xc0e8c8 (568 bytes)
//
// 3 xrefs:
// > GJKeybindManager::dataLoaded @ 0xc0e96c
// > GJKeybindManager::applyImportBlob @ 0xc0ea08
// > ??> @ 0x9bf38
//
// 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 13:03:56 +0000
//
__int64 __fastcall GJKeybindManager::applyNewDefaults(GJKeybindManager *this, int a2)
{
char *v4; // x23
char *v5; // x19
char *v6; // x20
char *v7; // x0
_DWORD *v8; // x19
_QWORD *v9; // x0
int v10; // w2
_QWORD *v11; // x20
void *v12; // x0
void *v13; // x0
char *v14; // x1
char *v15; // x1
unsigned __int64 v16; // x6
unsigned __int64 v17; // x5
__int64 *v18; // x0
unsigned __int64 v19; // x1
unsigned __int64 v20; // x1
void *v21; // [xsp+48h] [xbp+48h] BYREF
unsigned __int64 v22; // [xsp+50h] [xbp+50h]
void *v23; // [xsp+58h] [xbp+58h]
void *v24; // [xsp+70h] [xbp+70h] BYREF
void *v25; // [xsp+80h] [xbp+80h]
if ( a2 <= 1 )
{
std::unordered_map>::unordered_map((unsigned __int64)&v21, (__int64)this + 96);
GJKeybindManager::loadDefaults(this);
std::unordered_map>::unordered_map((unsigned __int64)&v24, (__int64)this + 96);
GJKeybindManager::firstSetup(this);
v4 = (char *)v23;
if ( v23 )
{
do
{
v5 = *((char **)v4 + 3);
v6 = v4 + 32;
while ( v6 != v5 )
{
while ( 1 )
{
GJKeybindManager::bindChord(this, *((_DWORD *)v5 + 7), *((_DWORD *)v4 + 4));
v7 = *((char **)v5 + 1);
if ( !v7 )
break;
do
{
v5 = v7;
v7 = *(char **)v7;
}
while ( v7 );
if ( v6 == v5 )
goto LABEL_9;
}
do
{
v14 = v5;
v5 = *((char **)v5 + 2);
if ( v14 == *(char **)v5 )
break;
v15 = v5;
v5 = *((char **)v5 + 2);
}
while ( v15 != *(char **)v5 );
}
LABEL_9:
v4 = *(char **)v4;
}
while ( v4 );
}
v8 = v25;
v9 = nullptr;
if ( v25 )
{
do
{
v10 = v8[4];
if ( v22 )
{
v16 = v22 - 1;
v17 = ((v22 - 1) & v22) != 0 ? v10 % v22 : v10 & v16;
v18 = *((__int64 **)v21 + v17);
if ( v18 )
{
while ( 1 )
{
v18 = (__int64 *)*v18;
if ( !v18 )
break;
v20 = v18[1];
v19 = ((v22 - 1) & v22) != 0 ? v20 % v22 : v16 & v20;
if ( v17 != v19 )
break;
if ( v10 == *((_DWORD *)v18 + 4) )
goto LABEL_16;
}
}
}
v11 = *((_QWORD **)v8 + 3);
if ( v11 != (_QWORD *)(v8 + 8) )
{
while ( 1 )
{
GJKeybindManager::bindChord(this, *((_DWORD *)v11 + 7), v10);
v11 = std::__tree_next *>(v11);
if ( v8 + 8 == (_DWORD *)v11 )
break;
v10 = v8[4];
}
}
LABEL_16:
v8 = *(_DWORD **)v8;
}
while ( v8 );
v9 = v25;
}
sub_C0A648(v9);
v12 = v24;
v24 = nullptr;
if ( v12 )
operator delete(v12);
sub_C0A648(v23);
v13 = v21;
v21 = nullptr;
if ( v13 )
operator delete(v13);
}
return _stack_chk_guard;
}