//
// SecretLayer5::incrementChatIdx from 0xa95308 to 0xa953e8 (224 bytes)
//
// 2 xrefs:
// > SecretLayer5::onSubmit @ 0xa9564c
// > ??> @ 0x68f40
//
// 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; // w3
int *m_start; // x21
int *m_finish; // x1
int v5; // w22
unsigned __int64 v6; // x3
int *v7; // [xsp+38h] [xbp+38h]
unsigned __int64 v8; // [xsp+40h] [xbp+40h] BYREF
m_chatIndex = a1->m_chatIndex;
m_start = a1->m_soundEffects.m_start;
m_finish = a1->m_soundEffects.m_finish;
a1->m_chatIndex = m_chatIndex + 1;
if ( m_finish - m_start - 1 < (unsigned __int64)(m_chatIndex + 1) )
{
v5 = m_start[m_chatIndex];
v7 = m_finish;
v6 = rand() % 0x7FFFFFFFuLL;
if ( !v6 )
v6 = 1;
v8 = v6;
std::shuffle<__gnu_cxx::__normal_iterator>,std::linear_congruential_engine>(
m_start,
v7,
&v8);
a1->m_chatIndex = 0;
if ( v5 == *a1->m_soundEffects.m_start )
a1->m_chatIndex = 1;
}
}