//
// KeybindingsLayer::dKeybindingsLayer from 0x1403d53a0 to 0x1403d5610 (624 bytes)
//
// 3 xrefs:
// > sub_1403D5610 @ 0x1403d561f
// > sub_14044C6F0 @ 0x14044c6ff
// > ??> @ 0x140924998
//
// 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:31:36 +0000
//
// Merged with: KeybindingsLayer::~KeybindingsLayer, LevelBindingsLayer::~LevelBindingsLayer
__int64 __fastcall KeybindingsLayer::dKeybindingsLayer(__int64 a1)
{
_QWORD *v2; // rax
__int64 v3; // rdx
__int64 v4; // rbx
int *v5; // rax
void *v6; // rcx
void *v7; // rdx
cocos2d::CCObject *v8; // rcx
void (__fastcall ***v9)(_QWORD, __int64); // rcx
_BYTE v11[16]; // [rsp+30h] [rbp-88h] BYREF
void *Block[2]; // [rsp+40h] [rbp-78h] BYREF
__m128i si128; // [rsp+50h] [rbp-68h]
size_t v14[4]; // [rsp+60h] [rbp-58h] BYREF
_QWORD v15[4]; // [rsp+80h] [rbp-38h] BYREF
*(_QWORD *)a1 = &KeybindingsLayer::`vftable';
*(_QWORD *)(a1 + 320) = &KeybindingsLayer::`vftable';
*(_QWORD *)(a1 + 328) = &KeybindingsLayer::`vftable';
*(_QWORD *)(a1 + 336) = &KeybindingsLayer::`vftable';
*(_QWORD *)(a1 + 344) = &KeybindingsLayer::`vftable';
*(_QWORD *)(a1 + 352) = &KeybindingsLayer::`vftable';
*(_QWORD *)(a1 + 408) = &KeybindingsLayer::`vftable';
*(_QWORD *)(a1 + 432) = &KeybindingsLayer::`vftable';
*(_QWORD *)(a1 + 544) = &KeybindingsLayer::`vftable';
*(_QWORD *)(a1 + 664) = &KeybindingsLayer::`vftable';
*(_QWORD *)(a1 + 672) = &KeybindingsLayer::`vftable';
if ( *(_QWORD *)(a1 + 1120) && *(int *)(a1 + 1048) >= 0 )
{
Block[1] = nullptr;
Block[0] = sub_14003D460(0x20u);
si128 = _mm_load_si128((const __m128i *)&xmmword_140836610);
strcpy((char *)Block[0], "keybindings.tab.");
v2 = sub_1400D2750(v15, *(_DWORD *)(a1 + 1048));
sub_140076160((char *)v14, v3, Block, v2);
v4 = *(_QWORD *)(a1 + 1120);
v5 = sub_140080E00();
*(_DWORD *)(*(_QWORD *)sub_1400834C0(v5, (__int64)v11, v14) + 48LL) = *(_DWORD *)(v4 + 436);
sub_14003D310((__int64)v14);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v6 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v6);
}
sub_14003D310((__int64)v15);
}
dword_140909798 = *(_DWORD *)(a1 + 1048);
if ( &qword_1408FE4A8 != (void **)(a1 + 1144) )
{
v7 = (void *)(a1 + 1144);
if ( *(_QWORD *)(a1 + 1168) > 0xFu )
v7 = *(void **)(a1 + 1144);
sub_1400405A0(&qword_1408FE4A8, v7, *(_QWORD *)(a1 + 1160));
}
v8 = *(cocos2d::CCObject **)(a1 + 1072);
if ( v8 )
cocos2d::CCObject::release(v8);
if ( *(_BYTE *)(a1 + 1088) )
{
v9 = *(void (__fastcall ****)(_QWORD, __int64))(a1 + 1080);
if ( v9 )
(**v9)(v9, 1);
}
sub_14003D310(a1 + 1144);
sub_14019EF40((__int64 *)(a1 + 1024));
sub_14019F010((__int64 *)(a1 + 1000));
return SetupTriggerPopup::dSetupTriggerPopup(a1);
}