//
// SecretLayer::selectAThread from 0x1003bf4bc to 0x1003bf578 (188 bytes)
//
// 1 xrefs:
// > SecretLayer::getMessage @ 0x1003bdbb0
//
// 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 SecretLayer::selectAThread(SecretLayer *a1)
{
cocos2d::CCArray *v2; // x0
__int64 v3; // x20
int m_threadTag; // w8
unsigned int v5; // w21
float v6; // s8
__int64 v7; // x0
cocos2d::CCObject *v8; // x0
v2 = cocos2d::CCDictionary::allKeys(a1->m_messageThreads);
v3 = (__int64)v2;
m_threadTag = a1->m_threadTag;
if ( m_threadTag < 0 )
{
v6 = (float)((unsigned int)sub_10024A36C((__int64)v2) - 1);
v5 = llroundf(vcvts_n_f32_s32(rand(), 0x1Fu) * v6);
}
else
{
v5 = m_threadTag + 1;
}
a1->m_threadTag = v5;
if ( v5 >= (unsigned int)sub_10024A36C(v3) )
a1->m_threadTag = 0;
if ( cocos2d::CCDictionary::count(a1->m_messageThreads) )
{
v7 = sub_10024A388(v3, a1->m_threadTag);
v8 = cocos2d::CCDictionary::objectForKey(a1->m_messageThreads, *(int *)(v7 + 56));
a1->m_selectedThread = ((__int64 (__fastcall *)(cocos2d::CCObject *))v8->getTag)(v8);
}
a1->m_threadMessageIndex = 0;
}