//
// KeybindingsLayer::~KeybindingsLayer from 0x998064 to 0x99838c (808 bytes)
//
// 7 xrefs:
// > `non-virtual thunk to'KeybindingsLayer::~KeybindingsLayer @ 0x998390
// > KeybindingsLayer::~KeybindingsLayer @ 0x9983a4
// > LevelBindingsLayer::~LevelBindingsLayer @ 0xcf0ba8
// > LevelBindingsLayer::~LevelBindingsLayer @ 0xcf0c24
// > ??> @ 0x41830
// > ??> @ 0x47e60
// > ??> @ 0x14749a8
//
// 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:58:03 +0000
//
// Alternative name is '_ZN16KeybindingsLayerD2Ev'
void __fastcall KeybindingsLayer::~KeybindingsLayer(KeybindingsLayer *this)
{
__int64 v2; // x11
__int64 v3; // x20
int v4; // w2
char *v5; // x1
size_t v6; // x2
__int64 v7; // x0
__int64 v8; // x5
char *v9; // x1
size_t v10; // x2
cocos2d::CCObject *v11; // x0
__int64 v12; // x0
_QWORD *v13; // x20
_QWORD *v14; // x2
char *v15; // x0
char *v16; // x3
void **v17; // x22
void **v18; // x0
char *v19; // x20
_QWORD v20[2]; // [xsp+40h] [xbp+40h] BYREF
void *v21; // [xsp+50h] [xbp+50h]
__int64 v22[2]; // [xsp+58h] [xbp+58h] BYREF
void *v23; // [xsp+68h] [xbp+68h]
size_t v24[2]; // [xsp+70h] [xbp+70h] BYREF
void *v25; // [xsp+80h] [xbp+80h]
__int64 v26; // [xsp+88h] [xbp+88h]
v2 = _stack_chk_guard;
v3 = *((_QWORD *)this + 142);
*((_QWORD *)this + 68) = off_1475170;
v26 = v2;
*(_QWORD *)this = &off_14749A0;
*((_QWORD *)this + 40) = off_1474FD0;
*((_QWORD *)this + 41) = &off_1475040;
*((_QWORD *)this + 42) = off_1475058;
*((_QWORD *)this + 43) = off_1475078;
*((_QWORD *)this + 44) = off_14750A0;
*((_QWORD *)this + 51) = &off_14750D0;
*((_QWORD *)this + 54) = &off_1475150;
*((_QWORD *)this + 83) = &off_14751B8;
*((_QWORD *)this + 84) = off_14751D0;
v4 = *((_DWORD *)this + 266);
if ( v3 && (v4 & 0x80000000) == 0 )
{
v22[0] = 0;
v22[1] = 0;
v23 = nullptr;
std::string::__init(v22, "keybindings.tab.", 0x10u);
std::to_string(v24, *((_DWORD *)this + 266));
if ( (v24[0] & 1) != 0 )
{
v5 = (char *)v25;
v6 = v24[1];
}
else
{
v6 = LOBYTE(v24[0]) >> 1;
v5 = (char *)v24 + 1;
}
v7 = std::string::append((__int64)v22, v5, v6);
v8 = *(_QWORD *)(v7 + 8);
v20[0] = *(_QWORD *)v7;
v20[1] = v8;
v21 = *(void **)(v7 + 16);
*(_QWORD *)v7 = 0;
*(_QWORD *)(v7 + 8) = 0;
*(_QWORD *)(v7 + 16) = 0;
ScrollableContentLayer::persistScrollOffset(v3, (__int64)v20);
if ( (v20[0] & 1) != 0 )
operator delete(v21);
if ( (v24[0] & 1) != 0 )
operator delete(v25);
if ( (v22[0] & 1) != 0 )
operator delete(v23);
v4 = *((_DWORD *)this + 266);
}
KeybindingsLayer::s_lastActiveTab = v4;
if ( (__int64 *)((char *)this + 1160) != &KeybindingsLayer::s_lastSearchText )
{
if ( (*((_BYTE *)this + 1160) & 1) != 0 )
{
v9 = *((char **)this + 147);
v10 = *((_QWORD *)this + 146);
}
else
{
v9 = (char *)this + 1161;
v10 = *((_BYTE *)this + 1160) >> 1;
}
std::string::assign(&KeybindingsLayer::s_lastSearchText, v9, v10);
}
v11 = *((cocos2d::CCObject **)this + 136);
if ( v11 )
cocos2d::CCObject::release(v11);
if ( *((_BYTE *)this + 1104) )
{
v12 = *((_QWORD *)this + 137);
if ( v12 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v12 + 8LL))(v12);
}
if ( (*((_BYTE *)this + 1160) & 1) != 0 )
operator delete(*((void **)this + 147));
v13 = *((_QWORD **)this + 130);
*(_QWORD *)this = &off_14E4900;
*((_QWORD *)this + 40) = off_14E4EF8;
*((_QWORD *)this + 41) = &off_14E4F68;
*((_QWORD *)this + 42) = off_14E4F80;
*((_QWORD *)this + 43) = off_14E4FA0;
*((_QWORD *)this + 44) = off_14E4FC8;
*((_QWORD *)this + 51) = &off_14E4FF8;
*((_QWORD *)this + 54) = &off_14E5078;
*((_QWORD *)this + 68) = off_14E5098;
*((_QWORD *)this + 83) = &off_14E50E0;
*((_QWORD *)this + 84) = off_14E50F8;
if ( v13 )
{
v14 = *((_QWORD **)this + 131);
if ( v13 != v14 )
{
do
{
*((_QWORD *)this + 131) = v14 - 3;
v15 = (char *)*(v14 - 3);
if ( v15 )
{
v16 = (char *)*(v14 - 2);
if ( v15 != v16 )
*(v14 - 2) = &v16[4 * ~((unsigned __int64)(v16 - 4 - v15) >> 2)];
operator delete(v15);
}
v14 = *((_QWORD **)this + 131);
}
while ( v13 != v14 );
v14 = *((_QWORD **)this + 130);
}
operator delete(v14);
}
v17 = *((void ***)this + 127);
if ( v17 )
{
v18 = *((void ***)this + 128);
if ( v17 != v18 )
{
do
{
v19 = (char *)(v18 - 9);
*((_QWORD *)this + 128) = v18 - 9;
if ( (*(_BYTE *)(v18 - 6) & 1) != 0 )
operator delete(*(v18 - 4));
if ( (*v19 & 1) != 0 )
operator delete(*((void **)v19 + 2));
v18 = *((void ***)this + 128);
}
while ( v17 != v18 );
v18 = *((void ***)this + 127);
}
operator delete(v18);
}
SetupTriggerPopup::~SetupTriggerPopup(this);
}