//
// SecretLayer5::claimOnlineReward from 0x14058c070 to 0x14058c282 (530 bytes)
//
// 2 xrefs:
// > SecretLayer5::showSuccessAnimation @ 0x14058bf21
// > ??> @ 0x14092cb64
//
// 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:34:29 +0000
//
// Hidden C++ exception states: #wind=3
struct cocos2d::CCAction *__fastcall SecretLayer5::claimOnlineReward(cocos2d::CCNode *a1)
{
_QWORD *v2; // rdi
__int64 v3; // rcx
__int64 v4; // rbx
__int64 v5; // rcx
__int64 v6; // rax
__int64 v7; // r14
_QWORD *v8; // rbp
__int64 *v9; // rdi
__int64 v10; // rbx
int v11; // eax
cocos2d::CCObject *v12; // rcx
__int64 v13; // rbx
struct cocos2d::CCFiniteTimeAction *v14; // rax
struct cocos2d::CCAction *v15; // rax
_BYTE v17[56]; // [rsp+20h] [rbp-38h] BYREF
void *v18; // [rsp+68h] [rbp+10h]
void *v19; // [rsp+68h] [rbp+10h]
v2 = (_QWORD *)sub_14003F4F0((__int64)v17, (__int64)a1 + 520);
v3 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v18 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)v18);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v3 = qword_14090BFE0;
}
if ( GameStatsManager::isSpecialChestUnlocked(v3, v2) )
goto LABEL_14;
v4 = sub_14003F4F0((__int64)v17, (__int64)a1 + 520);
v5 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v19 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)v19);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v5 = qword_14090BFE0;
}
v6 = GameStatsManager::unlockOnlineChest(v5, v4);
v7 = v6;
if ( !v6 )
{
LABEL_14:
*((_BYTE *)a1 + 552) = 0;
return (struct cocos2d::CCAction *)SecretLayer5::showTextInput(a1);
}
else
{
v8 = RewardUnlockLayer::create(*(_DWORD *)(v6 + 64), 0);
v9 = (__int64 *)(*(__int64 (__fastcall **)(cocos2d::CCNode *))(*(_QWORD *)a1 + 504LL))(a1);
v10 = *v9;
v11 = (*(__int64 (__fastcall **)(cocos2d::CCNode *))(*(_QWORD *)a1 + 96LL))(a1);
(*(void (__fastcall **)(__int64 *, _QWORD *, _QWORD))(v10 + 456))(v9, v8, (unsigned int)(v11 + 1));
v12 = (cocos2d::CCObject *)v8[88];
if ( v12 )
cocos2d::CCObject::release(v12);
v8[88] = v7;
cocos2d::CCObject::retain((cocos2d::CCObject *)v7);
if ( !*(_BYTE *)(v7 + 80) || *(_DWORD *)(v7 + 64) == *((_DWORD *)v8 + 174) )
{
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v8[90] + 336LL))(v8[90], 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v8[90] + 936LL))(v8[90], 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v8[89] + 336LL))(v8[89], 0);
*((_BYTE *)v8 + 700) = 1;
if ( *((_BYTE *)v8 + 701) )
RewardUnlockLayer::playRewardEffect((cocos2d::CCNode *)v8);
}
v13 = cocos2d::CCCallFunc::create(a1, SecretLayer5::unlockUI);
v14 = cocos2d::CCDelayTime::create(0.5);
v15 = cocos2d::CCSequence::create(v14, v13, 0);
return cocos2d::CCNode::runAction(a1, v15);
}
}