//
// ChallengesPage::challengeStatusFinished from 0x140085e00 to 0x140085f82 (386 bytes)
//
// 2 xrefs:
// > ??> @ 0x14053d6f8
// > ??> @ 0x1406c6c18
//
// 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
//
// Hidden C++ exception states: #wind=1
void ChallengesPage::challengeStatusFinished(ChallengesPage *a1)
{
ChallengesPage *v2; // rdi
__int64 v3; // rdx
int v4; // ebx
__int64 v5; // rsi
unsigned int v6; // ebp
float v7; // xmm6_4
struct cocos2d::CCObject *v8; // rax
GameStatsManager *v9; // rcx
ChallengeNode *ChallengeNode; // rax
__int64 v11; // rcx
void *v12; // [rsp+80h] [rbp+8h]
v2 = (ChallengesPage *)((char *)a1 - 640);
ChallengesPage::updateTimers((ChallengesPage *)((char *)a1 - 640), 0.0);
LODWORD(v3) = 0;
v4 = 1;
v5 = 1;
do
{
v6 = v3;
v7 = (float)(int)v3 * 0.15000001;
v8 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)&a1->m_fRotationX, v5);
if ( v8 && LOBYTE(v8[6].m_nTag) )
{
v9 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v12 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v12);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v9 = (GameStatsManager *)qword_1406C2EE8;
}
if ( GameStatsManager::getQueuedChallenge(v9, v4) )
{
ChallengesPage::exitNodeAtSlot(v2, v4, v7);
v7 = v7 + 0.5;
}
}
ChallengeNode = ChallengesPage::createChallengeNode(v2, v4, 0, v7, 0);
v3 = v6 + 1;
if ( !ChallengeNode )
v3 = v6;
++v4;
++v5;
}
while ( v4 <= 3 );
LOBYTE(v3) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)&a1->m_uAutoReleaseCount + 320LL))(
*(_QWORD *)&a1->m_uAutoReleaseCount,
v3);
ChallengesPage::updateTimers(v2, 0.0);
cocos2d::CCNode::unschedule(v2, ChallengesPage::updateTimers);
cocos2d::CCNode::schedule(v2, ChallengesPage::updateTimers);
v11 = *(_QWORD *)&a1->m_uIndexInArray;
if ( v11 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v11 + 320LL))(v11, 0);
ChallengesPage::updateDots(v2);
}