//
// SecretLayer5::incrementChatIdx from 0x59ea40 to 0x59eaba (122 bytes)
//
// 1 xrefs:
// > SecretLayer5::onSubmit @ 0x59ec38
//
// 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 SecretLayer5::incrementChatIdx(SecretLayer5 *a1)
{
int m_chatIndex; // r1
int *m_finish; // r7
int *m_start; // r6
int v5; // r8
unsigned int v6; // r1
SecretLayer5 *v7; // [sp+0h] [bp-8h] BYREF
v7 = a1;
m_chatIndex = a1->m_chatIndex;
m_finish = a1->m_soundEffects.m_finish;
m_start = a1->m_soundEffects.m_start;
a1->m_chatIndex = m_chatIndex + 1;
if ( m_chatIndex + 1 > (unsigned int)(m_finish - m_start - 1) )
{
v5 = m_start[m_chatIndex];
v6 = rand() % 0x7FFFFFFFu;
if ( !v6 )
v6 = 1;
v7 = (SecretLayer5 *)v6;
std::shuffle<__gnu_cxx::__normal_iterator>,std::linear_congruential_engine>(
(unsigned int)m_start,
m_finish,
(unsigned int *)&v7);
a1->m_chatIndex = 0;
if ( *a1->m_soundEffects.m_start == v5 )
a1->m_chatIndex = 1;
}
}