//
// SecretLayer5::incrementChatIdx from 0x10007566c to 0x10007571c (176 bytes)
//
// 1 xrefs:
// > SecretLayer5::onSubmit @ 0x1000750c4
//
// 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 SecretLayer5::incrementChatIdx(SecretLayer5 *a1)
{
__int64 m_chatIndex; // x8
std::__vector_base::pointer end; // x20
std::__vector_base::pointer begin; // x21
int v5; // w22
unsigned int v6; // w0
unsigned int v7; // w8
unsigned int v8; // [xsp+Ch] [xbp-24h] BYREF
m_chatIndex = a1->m_chatIndex;
a1->m_chatIndex = m_chatIndex + 1;
end = a1->m_soundEffects.__end_;
begin = a1->m_soundEffects.__begin_;
if ( end - begin - 1 < (unsigned __int64)(m_chatIndex + 1) )
{
v5 = begin[m_chatIndex];
v6 = rand();
v7 = v6 + ((v6 / 0x7FFFFFFF) | ((v6 / 0x7FFFFFFF) << 31));
if ( v7 <= 1 )
v7 = 1;
v8 = v7;
sub_1000771C8(begin, end, &v8);
a1->m_chatIndex = 0;
a1->m_chatIndex = *a1->m_soundEffects.__begin_ == v5;
}
}