//
// GJBaseGameLayer::removeReleasedButtons from 0x1001fa89c to 0x1001fa9bc (288 bytes)
//
// 1 xrefs:
// > PlayLayer::resetLevel @ 0x100122338
//
// 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 __fastcall GJBaseGameLayer::removeReleasedButtons(GJBaseGameLayer *a1)
{
std::__vector_base
::pointer end; // x9
std::__vector_base::pointer begin; // x8
unsigned __int64 v4; // x24
unsigned __int64 v5; // x10
PlayerButtonCommand *v6; // x13
int v7; // w11
unsigned __int64 v8; // x12
PlayerButton m_button; // w14
__int64 v10; // x13
PlayerButtonCommand *v11; // x20
__int64 v12; // x21
PlayerButtonCommand *v13; // x9
PlayerButtonCommand *v14; // x20
signed __int64 v15; // x21
end = a1->m_queuedButtons.__end_;
begin = a1->m_queuedButtons.__begin_;
if ( end != begin )
{
v4 = 0;
v5 = 0xAAAAAAAAAAAAAAABLL * (((char *)end - (char *)begin) >> 3);
do
{
v6 = &begin[v4];
v7 = v4 + 1;
if ( v6->m_isPush && v5 > v7 )
{
v8 = v7;
m_button = v6->m_button;
v10 = v7;
while ( 1 )
{
if ( m_button == begin[v10].m_button )
{
v11 = &begin[v10];
if ( !begin[v10].m_isPush )
break;
}
++v8;
++v10;
if ( v5 <= v8 )
goto LABEL_9;
}
v12 = (char *)end - (char *)begin - v10 * 24 - 24;
if ( &v11[1] != end )
{
memmove(&begin[v10], &v11[1], (char *)end - (char *)begin - v10 * 24 - 24);
begin = a1->m_queuedButtons.__begin_;
}
v13 = (PlayerButtonCommand *)((char *)v11 + v12);
a1->m_queuedButtons.__end_ = (PlayerButtonCommand *)((char *)v11 + v12);
v14 = &begin[v4];
v15 = (char *)v13 - (char *)&v14[1];
if ( v13 != &v14[1] )
{
memmove(&begin[v4], &v14[1], (char *)v13 - (char *)&v14[1]);
begin = a1->m_queuedButtons.__begin_;
}
end = (PlayerButtonCommand *)((char *)v14 + v15);
a1->m_queuedButtons.__end_ = (PlayerButtonCommand *)((char *)v14 + v15);
}
else
{
LABEL_9:
++v4;
}
v5 = 0xAAAAAAAAAAAAAAABLL * (((char *)end - (char *)begin) >> 3);
}
while ( v4 < v5 );
}
}