//
// KeybindSet::unbindChord from 0xcf568c to 0xcf57fc (368 bytes)
//
// 2 xrefs:
// > ??> @ 0xdd350
// > ??> @ 0x1504478
//
// 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:06:47 +0000
//
__int64 __fastcall KeybindSet::unbindChord(__int64 this, int a2, int a3)
{
__int64 *v3; // x3
__int64 *v4; // x19
__int64 *v5; // x22
__int64 v6; // x21
__int64 *v7; // x20
__int64 *v8; // x3
_QWORD *v9; // x0
_QWORD *v10; // x0
__int64 *v11; // x0
_QWORD **v12; // x20
v3 = *(__int64 **)(this + 16);
if ( v3 )
{
v4 = (__int64 *)(this + 16);
do
{
while ( *((_DWORD *)v3 + 8) >= a3 )
{
v4 = v3;
v3 = (__int64 *)*v3;
if ( !v3 )
goto LABEL_5;
}
v3 = (__int64 *)v3[1];
}
while ( v3 );
LABEL_5:
if ( (__int64 *)(this + 16) != v4 && *((_DWORD *)v4 + 8) <= a3 )
{
v5 = (__int64 *)v4[6];
v6 = this;
if ( v5 )
{
v7 = v4 + 6;
v8 = (__int64 *)v4[6];
do
{
while ( *((_DWORD *)v8 + 7) >= a2 )
{
v7 = v8;
v8 = (__int64 *)*v8;
if ( !v8 )
goto LABEL_11;
}
v8 = (__int64 *)v8[1];
}
while ( v8 );
LABEL_11:
if ( v7 != v4 + 6 && *((_DWORD *)v7 + 7) <= a2 )
{
v9 = std::__tree_next *>(v7);
if ( v7 == (__int64 *)v4[5] )
v4[5] = (__int64)v9;
--v4[7];
std::__tree_remove *>(v5, v7);
operator delete(v7);
}
}
if ( !v4[7] )
{
v10 = std::__tree_next *>(v4);
if ( v4 == *(__int64 **)(v6 + 8) )
*(_QWORD *)(v6 + 8) = v10;
v11 = *(__int64 **)(v6 + 16);
--*(_QWORD *)(v6 + 24);
std::__tree_remove *>(v11, v4);
v12 = (_QWORD **)v4[6];
if ( v12 )
{
std::__tree::destroy((__int64)(v4 + 5), *v12);
std::__tree::destroy((__int64)(v4 + 5), v12[1]);
operator delete(v12);
}
operator delete(v4);
}
this = 1;
*(_BYTE *)(v6 + 32) = 1;
}
}
return this;
}