//
// DailyLevelPage::dailyStatusFinished from 0x915c8c to 0x915ea4 (536 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'DailyLevelPage::dailyStatusFinished @ 0x915ea8
// > ??> @ 0x40f38
// > ??> @ 0x11ab238
//
// 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 DailyLevelPage::dailyStatusFinished(DailyLevelPage *a1, GJTimedLevelType a2)
{
GameStatsManager *v3; // x21
GameLevelManager *v4; // x0
int DailyID; // w0
GameLevelManager *v6; // x0
int v7; // w21
GameLevelManager *v8; // x0
DailyLevelNode *m_dailyNode; // x21
void *v10; // x0
unsigned int *v11; // x2
int v12; // w1
GameLevelManager *v13; // x0
__int64 v14; // [xsp+40h] [xbp+40h] BYREF
cocos2d::SEL_SCHEDULE v15; // 0:x1.16
cocos2d::SEL_SCHEDULE v16; // 0:x1.16
DailyLevelPage::updateTimers(a1, 0.0);
a1->m_timeLabel->setVisible(a1->m_timeLabel, 1);
DailyLevelPage::updateTimers(a1, 0.0);
v15.ptr = (void (__cdecl *)(float))DailyLevelPage::updateTimers;
v15.adj = 0;
cocos2d::CCNode::unschedule(a1, v15);
v16.ptr = (void (__cdecl *)(float))DailyLevelPage::updateTimers;
v16.adj = 0;
cocos2d::CCNode::schedule(a1, v16);
a1->m_timeCircle->setVisible(a1->m_timeCircle, 0);
v3 = GameStatsManager::sharedState();
v4 = GameLevelManager::sharedState();
DailyID = GameLevelManager::getDailyID(v4, a1->m_type);
if ( !GameStatsManager::hasCompletedDailyLevel(v3, DailyID) )
{
v6 = GameLevelManager::sharedState();
v7 = GameLevelManager::getDailyID(v6, a1->m_type);
v8 = GameLevelManager::sharedState();
if ( v7 > GameLevelManager::getActiveDailyID(v8, a1->m_type) )
{
m_dailyNode = a1->m_dailyNode;
if ( m_dailyNode )
{
if ( m_dailyNode->m_needsDownloading )
{
sub_D153B8((int)&v14, "00:00:00");
DailyLevelNode::updateTimeLabel((__int64)m_dailyNode, &v14);
v10 = (void *)(v14 - 24);
if ( (__int64 *)(v14 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v11 = (unsigned int *)(v14 - 8);
do
v12 = __ldaxr(v11);
while ( __stlxr(v12 - 1, v11) );
}
else
{
v12 = *(_DWORD *)(v14 - 8);
*(_DWORD *)(v14 - 8) = v12 - 1;
}
if ( v12 <= 0 )
operator delete(v10);
}
DailyLevelPage::exitDailyNode(a1, a1->m_dailyNode, 0.0);
DailyLevelPage::downloadAndCreateNode(a1);
}
else
{
DailyLevelNode::showSkipButton(a1->m_dailyNode);
}
}
else
{
a1->m_nodeCircle->setVisible(a1->m_nodeCircle, 1);
v13 = GameLevelManager::sharedState();
GameLevelManager::downloadLevel(v13, a1->m_downloadLevelID, 0, 0);
}
}
}
}