//
// SecretLayer5::onlineRewardStatusFinished from 0x1403f6a20 to 0x1403f6b8b (363 bytes)
//
// 2 xrefs:
// > ??> @ 0x1405d5790
// > ??> @ 0x1406d827c
//
// 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=6
void __fastcall SecretLayer5::onlineRewardStatusFinished(__int64 a1, void **a2)
{
__int64 v4; // rbp
__int64 v5; // rcx
__int64 v6; // rbx
_QWORD *v7; // rbx
__int64 v8; // rcx
void *v9; // rdx
void *v10; // [rsp+20h] [rbp-68h]
void *v11; // [rsp+28h] [rbp-60h]
_BYTE v12[32]; // [rsp+38h] [rbp-50h] BYREF
void **v13; // [rsp+58h] [rbp-30h]
v13 = a2;
v4 = sub_14003BDB0((__int64)v12, (__int64)a2);
v5 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v11 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v11);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v5 = qword_1406C2EE8;
}
v6 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(v5 + 368), v4);
sub_14003A830(v4);
if ( !v6 )
goto LABEL_13;
v7 = (_QWORD *)sub_14003BDB0((__int64)v12, (__int64)a2);
v8 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v10 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v10);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v8 = qword_1406C2EE8;
}
if ( GameStatsManager::isSpecialChestUnlocked(v8, v7) )
{
LABEL_13:
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 8LL))(a1);
}
else
{
*(_DWORD *)(a1 + 84) = 1;
if ( (void **)(a1 + 88) != a2 )
{
v9 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v9 = *a2;
sub_14003CCE0((void **)(a1 + 88), v9, (size_t)a2[2]);
}
if ( !*(_BYTE *)(a1 + 80) )
SecretLayer5::handleSecretResponse((SecretLayer5 *)(a1 - 432));
}
sub_14003A830((__int64)a2);
}