//
// SecretLayer::selectAThread from 0x902658 to 0x902714 (188 bytes)
//
// 2 xrefs:
// > SecretLayer::getMessage @ 0x903c34
// > ??> @ 0x43080
//
// 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 SecretLayer::selectAThread(SecretLayer *a1)
{
cocos2d::CCArray *v2; // x0
int m_threadTag; // w20
cocos2d::CCArray *v4; // x21
unsigned int v5; // w20
__int64 v6; // x0
cocos2d::CCObject *v7; // x0
int v8; // w20
v2 = cocos2d::CCDictionary::allKeys(a1->m_messageThreads);
m_threadTag = a1->m_threadTag;
v4 = v2;
if ( m_threadTag < 0 )
{
v8 = cocos2d::CCArray::count(v2);
v5 = llroundf((float)(unsigned int)(v8 - 1) * (float)((float)rand() * 4.6566e-10));
}
else
{
v5 = m_threadTag + 1;
}
a1->m_threadTag = v5;
if ( v5 >= (unsigned int)cocos2d::CCArray::count(v4) )
a1->m_threadTag = 0;
if ( cocos2d::CCDictionary::count(a1->m_messageThreads) )
{
v6 = cocos2d::CCArray::objectAtIndex(v4, a1->m_threadTag);
v7 = cocos2d::CCDictionary::objectForKey(a1->m_messageThreads, *(int *)(v6 + 56));
a1->m_selectedThread = v7->getTag(v7);
}
a1->m_threadMessageIndex = 0;
}