//
// ChallengesPage::challengeStatusFinished from 0x14009e4b0 to 0x14009e635 (389 bytes)
//
// 2 xrefs:
// > ??> @ 0x14071c3d0
// > ??> @ 0x140912fc8
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:26:05 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall ChallengesPage::challengeStatusFinished(__int64 a1)
{
__int64 v2; // rdi
__int64 v3; // rdx
int v4; // ebx
__int64 v5; // rsi
unsigned int v6; // ebp
struct cocos2d::CCObject *v7; // rax
int v8; // r9d
__int64 v9; // rcx
__int64 ChallengeNode; // rax
__int64 v11; // rcx
void *v13; // [rsp+80h] [rbp+8h]
v2 = a1 - 672;
ChallengesPage::updateTimers(a1 - 672);
LODWORD(v3) = 0;
v4 = 1;
v5 = 1;
do
{
v6 = v3;
v7 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 56), v5);
if ( v7 && *((_BYTE *)v7 + 352) )
{
v9 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v13 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v13);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v9 = qword_14090BFE0;
}
if ( GameStatsManager::getQueuedChallenge(v9, (unsigned int)v4) )
ChallengesPage::exitNodeAtSlot(v2, (unsigned int)v4);
}
ChallengeNode = ChallengesPage::createChallengeNode(v2, v4, 0, v8, 0);
v3 = v6 + 1;
if ( !ChallengeNode )
v3 = v6;
++v4;
++v5;
}
while ( v4 <= 3 );
LOBYTE(v3) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 24) + 336LL))(*(_QWORD *)(a1 + 24), v3);
ChallengesPage::updateTimers(v2);
cocos2d::CCNode::unschedule(v2, ChallengesPage::updateTimers);
cocos2d::CCNode::schedule(v2, ChallengesPage::updateTimers);
v11 = *(_QWORD *)(a1 + 32);
if ( v11 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v11 + 336LL))(v11, 0);
return ChallengesPage::updateDots(v2);
}