//
// GameStatsManager::countSecretChests from 0x1003dccac to 0x1003dccf0 (68 bytes)
//
// 4 xrefs:
// > SecretRewardsLayer::init @ 0x100383e50
// > SecretRewardsLayer::updateUnlockedLabel @ 0x100384d04
// > SecretRewardsLayer::updateUnlockedLabel @ 0x100384d54
// > sub_1003850CC @ 0x1003850fc
//
// 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 11:04:19 +0000
//
__int64 __fastcall GameStatsManager::countSecretChests(__int64 a1, int a2)
{
__int64 result; // x0
__int64 v3; // x8
__int64 v4; // x9
result = *(_QWORD *)(a1 + 344);
if ( !a2 )
return cocos2d::CCDictionary::count(result);
if ( result )
{
v3 = *(_QWORD *)(result + 56);
if ( v3 )
{
LODWORD(result) = 0;
do
{
v4 = *(_QWORD *)(v3 + 288);
if ( *(_DWORD *)(*(_QWORD *)(v3 + 264) + 64LL) == a2 )
result = (unsigned int)(result + 1);
else
result = (unsigned int)result;
v3 = *(_QWORD *)(v3 + 288);
}
while ( v4 );
}
else
{
return 0;
}
}
return result;
}