//
// sub_10025A23C from 0x10025a23c to 0x10025a524 (744 bytes)
//
// 4 xrefs:
// > RewardsPage::init @ 0x100259f78
// > RewardsPage::rewardsStatusFinished @ 0x10025a6e8
// > RewardsPage::init @ 0x100259fb4
// > RewardsPage::rewardsStatusFinished @ 0x10025a6ec
//
// This function is hookable on this platform (idp: arm, 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:01:35 +0000
//
void __fastcall sub_10025A23C(__int64 a1)
{
__int64 v2; // x0
__int64 v3; // x0
unsigned __int64 v4; // d1
double v5; // d8
__int64 v6; // x0
int v7; // w24
__int64 v8; // x23
__int64 v9; // x0
__int64 v10; // x0
__int64 v11; // x22
int v12; // w21
int v13; // w20
__int64 v14; // x0
__int64 v15; // x0
int v16; // w23
__int64 v17; // x22
time_t time; // x1
void **v19; // x1
__int64 v20; // x21
time_t v21; // x1
void **v22; // x1
__int64 v23; // x20
__int64 v24; // x21
int v25; // w9
__int64 v26; // x0
__int64 CString; // x0
__int64 v28; // x0
__int64 v29; // x20
__int64 v30; // x21
int v31; // w8
__int64 v32; // x0
__int64 v33; // x0
__int64 v34; // x0
void *__p[2]; // [xsp+10h] [xbp-80h] BYREF
char v36; // [xsp+27h] [xbp-69h]
timeb v37; // [xsp+28h] [xbp-68h] BYREF
char v38; // [xsp+3Fh] [xbp-51h]
v2 = GameStatsManager::sharedState(a1);
if ( (unsigned int)sub_1003D1468(v2) )
{
v3 = ftime(&v37);
LOWORD(v4) = v37.millitm;
v5 = (double)v4 / 1000.0 + (double)v37.time;
v6 = GameStatsManager::sharedState(v3);
v7 = 1;
v8 = sub_1003D145C(v6, 1);
v9 = GameStatsManager::sharedState(v8);
v10 = sub_1003D145C(v9, 2);
v11 = v10;
v12 = (int)((double)*(int *)(v8 + 60) - v5);
v13 = (int)((double)*(int *)(v10 + 60) - v5);
if ( v12 >= 1 )
{
v14 = GameStatsManager::sharedState(v10);
v10 = sub_1003D1598(v14, 1, *(unsigned int *)(v8 + 56));
v7 = v10 ^ 1;
}
if ( v13 < 1 )
{
v16 = 1;
}
else
{
v15 = GameStatsManager::sharedState(v10);
v16 = sub_1003D1598(v15, 2, *(unsigned int *)(v11 + 56)) ^ 1;
}
sub_100009900(&v37, "Open");
v17 = *(_QWORD *)(a1 + 680);
if ( v7 )
{
if ( v38 >= 0 )
time = (time_t)&v37;
else
time = v37.time;
(*(void (__fastcall **)(_QWORD, time_t))(*(_QWORD *)v17 + 928LL))(*(_QWORD *)(a1 + 680), time);
}
else
{
sub_10004AFB4(v12, 0, __p);
if ( v36 >= 0 )
v19 = __p;
else
v19 = (void **)__p[0];
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v17 + 928LL))(v17, v19);
if ( v36 < 0 )
operator delete(__p[0]);
}
v20 = *(_QWORD *)(a1 + 688);
if ( v16 )
{
if ( v38 >= 0 )
v21 = (time_t)&v37;
else
v21 = v37.time;
(*(void (__fastcall **)(_QWORD, time_t))(*(_QWORD *)v20 + 928LL))(*(_QWORD *)(a1 + 688), v21);
}
else
{
sub_10004AFB4(v13, 0, __p);
if ( v36 >= 0 )
v22 = __p;
else
v22 = (void **)__p[0];
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v20 + 928LL))(v20, v22);
if ( v36 < 0 )
operator delete(__p[0]);
}
if ( *(unsigned __int8 *)(a1 + 712) != v7 )
{
*(_BYTE *)(a1 + 712) = v7;
v23 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 696) + 1072LL))(*(_QWORD *)(a1 + 696));
v24 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v23);
if ( *(_BYTE *)(a1 + 712) )
v25 = 2;
else
v25 = 1;
v26 = sub_1003065B0("chest_%02d_%02d_001.png", 1, v25);
CString = cocos2d::CCString::getCString(v26);
v28 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v24, CString);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v23 + 1160LL))(v23, v28);
}
if ( *(unsigned __int8 *)(a1 + 713) != v16 )
{
*(_BYTE *)(a1 + 713) = v16;
v29 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 704) + 1072LL))(*(_QWORD *)(a1 + 704));
v30 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v29);
v31 = 1;
if ( *(_BYTE *)(a1 + 713) )
v31 = 2;
v32 = sub_1003065B0("chest_%02d_%02d_001.png", 2, v31);
v33 = cocos2d::CCString::getCString(v32);
v34 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v30, v33);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v29 + 1160LL))(v29, v34);
}
if ( v38 < 0 )
operator delete((void *)v37.time);
}
}