//
// NotificationsPage::notificationRewardFinished from 0x140478c30 to 0x140478e8a (602 bytes)
//
// 2 xrefs:
// > ??> @ 0x1407b5428
// > ??> @ 0x140928538
//
// 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:32:41 +0000
//
// Hidden C++ exception states: #wind=6
void __fastcall NotificationsPage::notificationRewardFinished(__int64 a1, unsigned int a2)
{
_QWORD *v4; // rbx
__int64 v5; // rcx
__int64 v6; // rcx
__int64 v7; // rcx
__int64 v8; // rbx
__int64 v9; // rcx
__int64 v10; // rbx
__int64 v11; // rcx
__int64 v12; // rcx
__int64 v13; // rdi
cocos2d::CCObject *v14; // rcx
void *v15; // [rsp+20h] [rbp-68h]
void *v16; // [rsp+20h] [rbp-68h]
void *v17; // [rsp+28h] [rbp-60h]
_BYTE v18[32]; // [rsp+30h] [rbp-58h] BYREF
_QWORD v19[4]; // [rsp+50h] [rbp-38h] BYREF
if ( !qword_14090BFE0 )
{
v15 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)v15);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
}
GameStatsManager::getNotificationRewardKey(a1, v19, a2);
v4 = (_QWORD *)sub_14003F4F0((__int64)v18, (__int64)v19);
v5 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v17 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)v17);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v5 = qword_14090BFE0;
}
if ( GameStatsManager::isSpecialChestUnlocked(v5, v4) )
{
v6 = *(_QWORD *)(a1 + 24);
if ( v6 )
{
v7 = *(_QWORD *)(v6 + 544);
if ( v7 )
CustomListView::reloadAll(v7);
}
}
else
{
v8 = sub_14003F4F0((__int64)v18, (__int64)v19);
v9 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v16 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)v16);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v9 = qword_14090BFE0;
}
v10 = GameStatsManager::unlockOnlineChest(v9, v8);
if ( v10 )
{
v11 = *(_QWORD *)(a1 + 24);
if ( v11 )
{
v12 = *(_QWORD *)(v11 + 544);
if ( v12 )
CustomListView::reloadAll(v12);
}
v13 = RewardUnlockLayer::create(*(unsigned int *)(v10 + 64), 0);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)(a1 - 664) + 456LL))(a1 - 664, v13, 100);
v14 = *(cocos2d::CCObject **)(v13 + 704);
if ( v14 )
cocos2d::CCObject::release(v14);
*(_QWORD *)(v13 + 704) = v10;
cocos2d::CCObject::retain((cocos2d::CCObject *)v10);
if ( !*(_BYTE *)(v10 + 80) || *(_DWORD *)(v10 + 64) == *(_DWORD *)(v13 + 696) )
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v13 + 720) + 336LL))(*(_QWORD *)(v13 + 720), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v13 + 720) + 936LL))(*(_QWORD *)(v13 + 720), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v13 + 712) + 336LL))(*(_QWORD *)(v13 + 712), 0);
*(_BYTE *)(v13 + 700) = 1;
if ( *(_BYTE *)(v13 + 701) )
RewardUnlockLayer::playRewardEffect(v13);
}
}
}
sub_14003D310((__int64)v19);
}