//
// GameStatsManager::countUnlockedSecretChests from 0x100052f00 to 0x100052f50 (80 bytes)
//
// 4 xrefs:
// > SecretRewardsLayer::init @ 0x10070dd76
// > SecretRewardsLayer::updateUnlockedLabel @ 0x10070ee9e
// > SecretRewardsLayer::updateUnlockedLabel @ 0x10070ef01
// > SecretRewardsLayer::updateUnlockedGoldLabel @ 0x10070f3bf
//
// 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 12:19:35 +0000
//
__int64 __fastcall GameStatsManager::countUnlockedSecretChests(__int64 a1, int a2)
{
__int64 v2; // rdi
__int64 result; // rax
__int64 v4; // rcx
__int64 v5; // rdx
v2 = *(_QWORD *)(a1 + 760);
if ( !a2 )
return cocos2d::CCDictionary::count(v2);
result = 0;
if ( v2 )
{
v4 = *(_QWORD *)(v2 + 56);
if ( v4 )
{
LODWORD(result) = 0;
do
{
v5 = *(_QWORD *)(v4 + 264);
v4 = *(_QWORD *)(v4 + 288);
result = (*(_DWORD *)(v5 + 64) == a2) + (unsigned int)result;
}
while ( v4 );
}
}
return result;
}