//
// GJBaseGameLayer::processCommands from 0x1001535e0 to 0x10015380b (555 bytes)
//
// 0 xrefs:
//
// 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::processCommands(GJBaseGameLayer *a1, float a2, bool a3, bool a4)
{
unsigned int m_commandIndex; // eax
__m128 m_timeWarp_low; // xmm1
__m128 v7; // xmm2
int v8; // ecx
bool v9; // al
unsigned __int64 m_queuedRecordedButtonsSize; // rdi
std::__vector_base::pointer begin; // rdx
unsigned __int64 v12; // rax
int v13; // r9d
__int64 v14; // r8
unsigned __int64 v15; // rcx
unsigned __int64 v16; // rsi
unsigned int v17; // edi
int *p_m_step; // r8
__int64 v19; // rdi
__int64 v20; // r9
int *v21; // rdx
signed int m_pauseCounter; // eax
signed int m_pauseBufferTimer; // ecx
m_commandIndex = a1->m_gameState.m_commandIndex;
a1->m_gameState.m_unkUint4 = m_commandIndex;
if ( a2 <= 0.0 )
{
if ( a1->m_playerDied )
goto LABEL_23;
if ( a1->m_clickBetweenSteps )
goto LABEL_12;
LABEL_11:
v9 = 1;
if ( !a1->m_clickOnSteps )
goto LABEL_13;
goto LABEL_12;
}
m_timeWarp_low = (__m128)LODWORD(a1->m_gameState.m_timeWarp);
m_timeWarp_low.f32[0] = m_timeWarp_low.f32[0] * 1000.0;
v7 = _mm_or_ps(_mm_and_ps((__m128)xmmword_1008150B0, m_timeWarp_low), (__m128)xmmword_1008150C0);
v7.f32[0] = v7.f32[0] + m_timeWarp_low.f32[0];
v8 = (int)_mm_round_ss((__m128)0LL, v7, 11).f32[0];
if ( !a3 )
{
a1->m_gameState.m_commandIndex = m_commandIndex + 2;
a1->m_gameState.m_unkUint6 += v8;
if ( a1->m_playerDied )
goto LABEL_23;
a1->m_gameState.m_currentProgress += 2;
if ( a1->m_clickBetweenSteps )
goto LABEL_12;
goto LABEL_11;
}
a1->m_gameState.m_commandIndex = m_commandIndex + 1;
a1->m_gameState.m_unkUint6 = (int)(float)((float)((float)v8 * 0.5) + (float)a1->m_gameState.m_unkUint6);
if ( a1->m_playerDied )
goto LABEL_23;
++a1->m_gameState.m_currentProgress;
if ( !a1->m_clickBetweenSteps )
goto LABEL_11;
LABEL_12:
v9 = a4;
LABEL_13:
GJBaseGameLayer::processQueuedButtons(a1, a2, v9);
m_queuedRecordedButtonsSize = a1->m_queuedRecordedButtonsSize;
begin = a1->m_queuedRecordedButtons.__begin_;
v12 = a1->m_queuedRecordedButtons.__end_ - begin;
if ( v12 > m_queuedRecordedButtonsSize )
{
v13 = a1->m_gameState.m_unkUint4 - a1->m_currentStep;
a1->m_currentStep = a1->m_gameState.m_unkUint4;
v14 = m_queuedRecordedButtonsSize;
begin[m_queuedRecordedButtonsSize].m_step = v13;
v15 = m_queuedRecordedButtonsSize + 1;
if ( v12 > m_queuedRecordedButtonsSize + 1 )
{
v16 = v12 - m_queuedRecordedButtonsSize - 2;
v17 = ((_BYTE)v12 + ~(_BYTE)m_queuedRecordedButtonsSize) & 3;
if ( v17 )
{
p_m_step = &begin[v14 + 1].m_step;
v19 = -(__int64)v17;
v20 = 0;
do
{
*p_m_step = 0;
--v20;
p_m_step += 4;
}
while ( v19 != v20 );
v15 -= v20;
}
if ( v16 >= 3 )
{
v21 = &begin[v15 + 3].m_step;
do
{
*(v21 - 12) = 0;
*(v21 - 8) = 0;
*(v21 - 4) = 0;
*v21 = 0;
v15 += 4LL;
v21 += 16;
}
while ( v12 > v15 );
}
}
a1->m_queuedRecordedButtonsSize = v15;
}
LABEL_23:
m_pauseCounter = a1->m_gameState.m_pauseCounter;
if ( m_pauseCounter > 0 )
{
m_pauseBufferTimer = a1->m_gameState.m_pauseBufferTimer;
a1->m_gameState.m_pauseBufferTimer = m_pauseBufferTimer - 1;
if ( m_pauseBufferTimer <= 0 )
{
a1->m_gameState.m_pauseBufferTimer = 120;
a1->m_gameState.m_pauseCounter = m_pauseCounter - 1;
}
}
}