//
// KeybindingsLayer::onEditBinding from 0x994974 to 0x994acc (344 bytes)
//
// 4 xrefs:
// > ??> @ 0xb6bf0
// > KeybindingsLayer::buildContentForTab @ 0x996540
// > KeybindingsLayer::buildContentForTab @ 0x996974
// > ??> @ 0x1545430
//
// 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:01 +0000
//
__int64 __fastcall KeybindingsLayer::onEditBinding(KeybindingsLayer *this, cocos2d::CCObject *a2)
{
unsigned int v3; // w0
int v4; // w19
unsigned int v5; // w22
void *v6; // x0
__int64 v7; // x1
unsigned int v8; // w19
void *v10; // [xsp+30h] [xbp+30h] BYREF
_BYTE *v11; // [xsp+38h] [xbp+38h]
v3 = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)a2 + 64LL))(a2);
v4 = HIBYTE(v3);
v5 = v3 & 0xFFFFFF;
(*(void (__fastcall **)(void **__return_ptr, _QWORD, _QWORD))(**((_QWORD **)this + 137) + 16LL))(
&v10,
*((_QWORD *)this + 137),
v3 & 0xFFFFFF);
v6 = v10;
if ( v4 >= (int)((v11 - (_BYTE *)v10) >> 2) )
{
if ( !v10 )
return _stack_chk_guard;
if ( v10 != v11 )
{
v11 += 4 * ~((unsigned __int64)(v11 - 4 - (_BYTE *)v10) >> 2);
operator delete(v10);
return _stack_chk_guard;
}
goto LABEL_7;
}
v7 = *((_QWORD *)this + 139);
v8 = *((_DWORD *)v10 + (unsigned int)v4);
if ( v7 )
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v7 + 1160LL))(*((_QWORD *)this + 139), 0);
(*(void (__fastcall **)(KeybindingsLayer *, _QWORD, _QWORD))(*(_QWORD *)this + 1536LL))(this, v5, v8);
v6 = v10;
if ( v10 )
{
if ( v10 != v11 )
v11 += 4 * ~((unsigned __int64)(v11 - 4 - (_BYTE *)v10) >> 2);
LABEL_7:
operator delete(v6);
}
return _stack_chk_guard;
}