//
// GJBaseGameLayer::removeReleasedButtons from 0x140231ba0 to 0x140231d03 (355 bytes)
//
// 4 xrefs:
// > PlayLayer::resetLevel @ 0x1403b9978
// > ??> @ 0x140680f90
// > ??> @ 0x140680fa0
// > ??> @ 0x1406cdecc
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void GJBaseGameLayer::removeReleasedButtons(GJBaseGameLayer *a1)
{
std::_Vector_val
>::pointer Mylast; // r10
std::_Vector_val>::pointer Myfirst; // r9
unsigned __int64 v3; // rbx
std::_Vector_val>::pointer v5; // r8
__int64 v6; // rdi
int v7; // r8d
unsigned __int64 v8; // rdx
std::_Simple_types::value_type *v9; // rax
Mylast = a1->m_queuedButtons._Mypair._Myval2._Mylast;
Myfirst = a1->m_queuedButtons._Mypair._Myval2._Myfirst;
v3 = 0;
if ( Mylast - Myfirst )
{
v5 = a1->m_queuedButtons._Mypair._Myval2._Mylast;
v6 = 0;
do
{
if ( Myfirst[v6].m_isPush )
{
v7 = v3 + 1;
v8 = Mylast - Myfirst;
if ( (int)v3 + 1 < v8 )
{
v9 = &Myfirst[v7];
while ( Myfirst[v6].m_button != v9->m_button || v9->m_isPush )
{
++v7;
++v9;
if ( v7 >= v8 )
goto LABEL_9;
}
memmove(
&Myfirst[v7],
&Myfirst[v7 + 1],
(char *)a1->m_queuedButtons._Mypair._Myval2._Mylast - (char *)&Myfirst[v7 + 1]);
memmove(
&a1->m_queuedButtons._Mypair._Myval2._Myfirst[v6],
&a1->m_queuedButtons._Mypair._Myval2._Myfirst[v6 + 1],
(char *)--a1->m_queuedButtons._Mypair._Myval2._Mylast
- (char *)&a1->m_queuedButtons._Mypair._Myval2._Myfirst[v6 + 1]);
Mylast = --a1->m_queuedButtons._Mypair._Myval2._Mylast;
Myfirst = a1->m_queuedButtons._Mypair._Myval2._Myfirst;
goto LABEL_13;
}
LABEL_9:
Mylast = a1->m_queuedButtons._Mypair._Myval2._Mylast;
}
else
{
Mylast = v5;
}
++v3;
++v6;
LABEL_13:
v5 = Mylast;
}
while ( v3 < Mylast - Myfirst );
}
}