//
// DailyLevelPage::claimLevelReward from 0x1002169e0 to 0x100216b5f (383 bytes)
//
// 1 xrefs:
// > DailyLevelNode::onClaimReward @ 0x100217a15
//
// 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 12:27:00 +0000
//
_QWORD *__fastcall DailyLevelPage::claimLevelReward(__int64 a1, __int64 a2, _DWORD *a3, __int64 a4, __m128 a5)
{
__int64 v5; // rax
_QWORD *v8; // rax
__int64 v9; // rax
__int64 v10; // r12
char *v11; // r13
__int64 v12; // rax
int BonusDiamonds; // r13d
__int64 v14; // rax
__int64 v15; // rax
__int64 v16; // rax
int v17; // r14d
int v18; // eax
int v19; // ecx
int v20; // r8d
int v21; // r9d
__int64 v22; // rax
_QWORD v24[6]; // [rsp+0h] [rbp-30h] BYREF
v24[0] = v5;
v8 = (_QWORD *)GameStatsManager::sharedState();
v9 = GameStatsManager::completedDailyLevel(v8, a3, a5);
if ( v9 )
{
v10 = v9;
v11 = RewardUnlockLayer::create(*(_DWORD *)(v9 + 64), 0);
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v11, 100);
RewardUnlockLayer::showCollectReward((__int64)v11, v10);
}
else
{
v12 = GameStatsManager::sharedState();
BonusDiamonds = GameStatsManager::getBonusDiamonds(a5, v12, a3[237] - a3[238]);
sub_1002782D0(v24, a4);
v14 = CurrencyRewardLayer::create(0, 0, 0, BonusDiamonds, 0, 0, 0, 0, (__int64)v24, 0);
(*(void (__fastcall **)(__int64, __int64, __int64, double, float))(*(_QWORD *)a1 + 464LL))(a1, v14, 14, 0.0, 1.0);
}
DailyLevelPage::exitDailyNode(a1, a2, 0.0);
v15 = GameLevelManager::sharedState(0.0);
if ( (int)GameLevelManager::getDailyID(v15, *(unsigned int *)(a1 + 732)) <= a3[230] - a3[231] )
return DailyLevelPage::createDailyNode(a1, 0, 0, 0, 0.5);
*(_BYTE *)(a1 + 728) = 1;
v16 = GameLevelManager::sharedState(0.0);
GameLevelManager::downloadLevel(v16, *(unsigned int *)(a1 + 736), 0, 0);
v17 = cocos2d::CCDelayTime::create(0.5);
v18 = cocos2d::CCCallFunc::create(a1, DailyLevelPage::createNodeIfLoaded, 0);
v22 = sub_10039EB60(v17, v18, 0, v19, v20, v21);
return (_QWORD *)cocos2d::CCNode::runAction(a1, v22);
}