//
// sub_1001327F8 from 0x1001327f8 to 0x100132934 (316 bytes)
//
// 2 xrefs:
// > GJNotificationCell::loadFromNotification @ 0x100131608
// > CustomListView::reloadAll @ 0x100132704
//
// This function is hookable on this platform (idp: arm, 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 10:59:24 +0000
//
__int64 __fastcall sub_1001327F8(__int64 a1)
{
__int64 result; // x0
_BYTE *v3; // x21
__int64 v4; // x20
int isSpecialChestUnlocked; // w0
int v6; // w20
__int64 v7; // x0
unsigned int *v8; // x9
__int64 v9; // x8
_QWORD *v10; // x22
unsigned __int64 v11; // x23
__int64 v12; // x21
__int16 v13; // [xsp+4h] [xbp-5Ch] BYREF
char v14; // [xsp+6h] [xbp-5Ah]
void *__p[2]; // [xsp+8h] [xbp-58h] BYREF
char v16; // [xsp+1Fh] [xbp-41h]
result = *(_QWORD *)(a1 + 568);
if ( result && *(_QWORD *)(a1 + 560) )
{
v3 = (_BYTE *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)result + 1072LL))(result);
v4 = GameStatsManager::sharedState(v3);
sub_1000C7110(*(_QWORD *)(a1 + 560), __p);
isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked(v4, __p);
v6 = isSpecialChestUnlocked;
if ( v16 < 0 )
{
operator delete(__p[0]);
if ( !v6 )
return (*(__int64 (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 568) + 1056LL))(
*(_QWORD *)(a1 + 568),
v6 ^ 1u);
}
else if ( !isSpecialChestUnlocked )
{
return (*(__int64 (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 568) + 1056LL))(
*(_QWORD *)(a1 + 568),
v6 ^ 1u);
}
v3[604] = 0;
GJChestSprite::switchToState(v3, 4, 1);
v7 = (*(__int64 (__fastcall **)(_BYTE *))(*(_QWORD *)v3 + 488LL))(v3);
if ( v7 )
{
v8 = *(unsigned int **)(v7 + 56);
v9 = *v8;
if ( (_DWORD)v9 )
{
v10 = *((_QWORD **)v8 + 2);
v11 = (unsigned __int64)&v10[v9 - 1];
do
{
v12 = *v10;
if ( !*v10 )
break;
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)v12 + 912LL))(*v10, 150);
v14 = -106;
v13 = -26986;
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v12 + 960LL))(v12, &v13);
++v10;
}
while ( (unsigned __int64)v10 <= v11 );
}
}
return (*(__int64 (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 568) + 1056LL))(
*(_QWORD *)(a1 + 568),
v6 ^ 1u);
}
return result;
}