//
// GJNotificationCell::refreshChest from 0x14015c530 to 0x14015c6d1 (417 bytes)
//
// 2 xrefs:
// > CustomListView::reloadAll @ 0x140146c5c
// > ??> @ 0x140917b40
//
// 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:27:23 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall GJNotificationCell::refreshChest(__int64 a1)
{
__int64 v2; // rcx
__int64 v3; // rcx
_BYTE *v4; // rbx
__int64 v5; // rdi
__int64 v6; // rcx
unsigned __int8 isSpecialChestUnlocked; // si
__int64 v8; // r8
__int64 v9; // rax
__int64 v10; // rdx
unsigned int *v11; // rdi
__int64 v12; // rax
__int64 *v13; // rdi
__int64 *i; // r14
__int64 v15; // rbx
_BYTE v16[56]; // [rsp+20h] [rbp-38h] BYREF
void *v17; // [rsp+68h] [rbp+10h] BYREF
v2 = *(_QWORD *)(a1 + 576);
if ( v2 && *(_QWORD *)(a1 + 568) )
{
v4 = (_BYTE *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 952LL))(v2);
v5 = *(_QWORD *)(a1 + 568);
if ( !qword_14090BFE0 )
{
v17 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v17);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
}
GameStatsManager::getNotificationRewardKey(v3, v16, *(unsigned int *)(v5 + 56));
v6 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v17 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v17);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v6 = qword_14090BFE0;
}
isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked(v6, v16);
if ( isSpecialChestUnlocked )
{
v4[608] = 0;
LOBYTE(v8) = 1;
GJChestSprite::switchToState(v4, 4, v8);
v9 = (*(__int64 (__fastcall **)(_BYTE *))(*(_QWORD *)v4 + 480LL))(v4);
if ( v9 )
{
v11 = *(unsigned int **)(v9 + 56);
v12 = *v11;
if ( (_DWORD)v12 )
{
v13 = *((__int64 **)v11 + 2);
for ( i = &v13[v12 - 1]; v13 <= i; ++v13 )
{
v15 = *v13;
if ( !*v13 )
break;
LOBYTE(v10) = -106;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)(v15 + 320) + 40LL))(v15 + 320, v10);
LOWORD(v17) = -26986;
BYTE2(v17) = -106;
(**(void (__fastcall ***)(__int64, void **))(v15 + 320))(v15 + 320, &v17);
}
}
}
}
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 576) + 936LL))(
*(_QWORD *)(a1 + 576),
isSpecialChestUnlocked ^ 1u);
}
}