//
// RewardsPage::updateTimers from 0x1403cd7e0 to 0x1403cdc81 (1185 bytes)
//
// 6 xrefs:
// > RewardsPage::init @ 0x1403cd283
// > RewardsPage::rewardsStatusFinished @ 0x1403cd669
// > RewardsPage::init @ 0x1403cd2f6
// > RewardsPage::rewardsStatusFinished @ 0x1403cd68c
// > RewardsPage::rewardsStatusFinished @ 0x1403cd6a8
// > ??> @ 0x1406d7be0
//
// 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=9
void RewardsPage::updateTimers(RewardsPage *a1, float a2)
{
__int64 v3; // rcx
double v4; // xmm6_8
__int64 v5; // rcx
struct cocos2d::CCObject *v6; // rdi
__int64 v7; // rcx
__int64 v8; // rcx
struct cocos2d::CCObject *v9; // r15
int v10; // r12d
int v11; // esi
__int64 v12; // rbx
_QWORD *ItemKey; // rax
__int64 v14; // rbx
bool v15; // di
__int64 v16; // rbx
_QWORD *v17; // rax
__int64 v18; // rbx
bool v19; // r15
const char *TimeString; // rax
const char *v21; // rdx
void **v22; // rdx
const char *v23; // rax
const char *v24; // rdx
int v25; // r12d
cocos2d::CCNode *v26; // rsi
cocos2d::CCString *v27; // rax
const char *CString; // rbx
cocos2d::CCNode_vtbl *v29; // rdi
__int64 v30; // rcx
cocos2d::CCSpriteFrameCache *v31; // rax
struct cocos2d::CCSpriteFrame *v32; // rax
cocos2d::CCNode *v33; // rsi
cocos2d::CCString *v34; // rax
const char *v35; // rbx
cocos2d::CCNode_vtbl *v36; // rdi
__int64 v37; // rcx
cocos2d::CCSpriteFrameCache *v38; // rax
struct cocos2d::CCSpriteFrame *v39; // rax
void *v40; // rcx
void *v41; // [rsp+28h] [rbp-49h]
void *v42; // [rsp+28h] [rbp-49h]
void *v43; // [rsp+28h] [rbp-49h]
void *v44; // [rsp+28h] [rbp-49h]
void *v45; // [rsp+28h] [rbp-49h]
void *Block[2]; // [rsp+30h] [rbp-41h] BYREF
__int64 v47; // [rsp+40h] [rbp-31h]
unsigned __int64 v48; // [rsp+48h] [rbp-29h]
_QWORD v49[4]; // [rsp+50h] [rbp-21h] BYREF
struct __timeb64 Time; // [rsp+70h] [rbp-1h] BYREF
v3 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v41 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v41);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v3 = qword_1406C2EE8;
}
if ( cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(v3 + 528), 1) )
{
ftime64(&Time);
v4 = (double)(Time.millitm + 1000 * (Time.time & 0xFFFFF)) / 1000.0;
v5 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v42 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v42);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v5 = qword_1406C2EE8;
}
v6 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(v5 + 528), 1);
v7 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v43 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v43);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v7 = qword_1406C2EE8;
}
v9 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(v7 + 528), 2);
v10 = (int)((double)SHIDWORD(v6[1].__vftable) - v4);
v11 = (int)((double)SHIDWORD(v9[1].__vftable) - v4);
if ( v10 <= 0 )
goto LABEL_13;
v12 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v44 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v44);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v12 = qword_1406C2EE8;
}
ItemKey = GameStatsManager::getItemKey(v8, &Time, 1u, (unsigned int)v6[1].__vftable);
v14 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(v12 + 536), ItemKey);
sub_14003A830((__int64)&Time);
if ( v14 )
v15 = 0;
else
LABEL_13:
v15 = 1;
if ( v11 <= 0 )
goto LABEL_19;
v16 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v45 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v45);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v16 = qword_1406C2EE8;
}
v17 = GameStatsManager::getItemKey(v8, v49, 2u, (unsigned int)v9[1].__vftable);
v18 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(v16 + 536), v17);
sub_14003A830((__int64)v49);
if ( v18 )
v19 = 0;
else
LABEL_19:
v19 = 1;
*(_OWORD *)Block = 0;
v47 = 4;
v48 = 15;
strcpy((char *)Block, "Open");
if ( v15 )
{
a1->m_leftLabel->setString(&a1->m_leftLabel->cocos2d::CCLabelProtocol, (const char *)Block);
}
else
{
TimeString = (const char *)GameToolbox::getTimeString(v49, v10, 0);
v21 = TimeString;
if ( *((_QWORD *)TimeString + 3) > 0xFu )
v21 = *(const char **)TimeString;
a1->m_leftLabel->setString(&a1->m_leftLabel->cocos2d::CCLabelProtocol, v21);
sub_14003A830((__int64)v49);
}
if ( v19 )
{
v22 = Block;
if ( v48 > 0xF )
v22 = (void **)Block[0];
a1->m_rightLabel->setString(&a1->m_rightLabel->cocos2d::CCLabelProtocol, (const char *)v22);
}
else
{
v23 = (const char *)GameToolbox::getTimeString(v49, v11, 0);
v24 = v23;
if ( *((_QWORD *)v23 + 3) > 0xFu )
v24 = *(const char **)v23;
a1->m_rightLabel->setString(&a1->m_rightLabel->cocos2d::CCLabelProtocol, v24);
sub_14003A830((__int64)v49);
}
v25 = 0;
if ( v15 != a1->m_leftOpen )
{
a1->m_leftOpen = v15;
v26 = a1->m_leftChest->getNormalImage(a1->m_leftChest);
v27 = cocos2d::CCString::createWithFormat("chest_%02d_%02d_001.png", 1, (unsigned int)a1->m_leftOpen + 1);
CString = cocos2d::CCString::getCString(v27);
v29 = v26->__vftable;
v31 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v30);
v32 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v31, CString);
((void (__fastcall *)(cocos2d::CCNode *, struct cocos2d::CCSpriteFrame *))v29[1].setScaleX)(v26, v32);
}
if ( v19 != a1->m_rightOpen )
{
a1->m_rightOpen = v19;
v33 = a1->m_rightChest->getNormalImage(a1->m_rightChest);
LOBYTE(v25) = a1->m_rightOpen;
v34 = cocos2d::CCString::createWithFormat("chest_%02d_%02d_001.png", 2, v25 + 1);
v35 = cocos2d::CCString::getCString(v34);
v36 = v33->__vftable;
v38 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v37);
v39 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v38, v35);
((void (__fastcall *)(cocos2d::CCNode *, struct cocos2d::CCSpriteFrame *))v36[1].setScaleX)(v33, v39);
}
if ( v48 > 0xF )
{
v40 = Block[0];
if ( v48 + 1 >= 0x1000 )
{
v40 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v40 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v40);
}
}
}