//
// SecretRewardsLayer::updateUnlockedLabel from 0xb9e1d8 to 0xb9e3cc (500 bytes)
//
// 4 xrefs:
// > SecretRewardsLayer::onSelectItem @ 0xb9eef8
// > SecretRewardsLayer::init @ 0xba0b60
// > SecretRewardsLayer::createSecondaryLayer @ 0xba1b70
// > ??> @ 0x1026b8
//
// 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 13:02:44 +0000
//
__int64 __fastcall SecretRewardsLayer::updateUnlockedLabel(SecretRewardsLayer *this)
{
__int64 v2; // x0
GameStatsManager *v3; // x0
unsigned int v4; // w23
__int64 v5; // x0
unsigned int v6; // w0
__int64 v7; // x22
const char *v8; // x1
void (__fastcall *v9)(__int64, __int64); // x23
cocos2d::CCString *v10; // x0
__int64 CString; // x0
__int64 v13; // x0
GameStatsManager *v14; // x0
unsigned int v15; // w23
__int64 v16; // x0
unsigned int v17; // w24
cocos2d::CCString *v18; // x0
const char *v19; // x0
size_t v20; // x0
__int64 v21; // x0
char *v22; // x1
__int64 v23; // x0
__int64 v24; // x21
char *v25; // x1
__int64 v26; // x0
void (__fastcall *v27)(__int64, char *); // x3
void (__fastcall *v28)(__int64, char *); // x3
char *v29; // [xsp+48h] [xbp+48h]
char v30; // [xsp+58h] [xbp+58h] BYREF
char v31; // [xsp+59h] [xbp+59h]
char v32; // [xsp+5Ah] [xbp+5Ah]
__int64 v33[2]; // [xsp+60h] [xbp+60h] BYREF
void *v34; // [xsp+70h] [xbp+70h]
v2 = GameStatsManager::sharedState(_stack_chk_guard);
v3 = (GameStatsManager *)GameStatsManager::countUnlockedSecretChests(v2, 0);
v4 = (unsigned int)v3;
v5 = GameStatsManager::sharedState(v3);
v6 = GameStatsManager::countSecretChests(v5, 0);
v7 = *((_QWORD *)this + 55);
v8 = (const char *)v4;
v9 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v7 + 928LL);
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i/%i", v8, v6);
CString = cocos2d::CCString::getCString(v10);
v9(v7, CString);
if ( !*((_BYTE *)this + 584) )
{
v13 = GameStatsManager::sharedState((GameStatsManager *)*((unsigned __int8 *)this + 584));
v14 = (GameStatsManager *)GameStatsManager::countUnlockedSecretChests(v13, *((_DWORD *)this + 147));
v15 = (unsigned int)v14;
v16 = GameStatsManager::sharedState(v14);
v17 = GameStatsManager::countSecretChests(v16, *((_DWORD *)this + 147));
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i/%i", (const char *)v15, v17);
v19 = (const char *)cocos2d::CCString::getCString(v18);
v33[0] = 0;
v29 = (char *)v19;
v33[1] = 0;
v34 = nullptr;
v20 = strlen(v19);
std::string::__init(v33, v29, v20);
v21 = *((_QWORD *)this + 56);
if ( v21 )
{
v22 = (char *)v33 + 1;
if ( (v33[0] & 1) != 0 )
v22 = (char *)v34;
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v21 + 928LL))(v21, v22);
}
v23 = cocos2d::CCDictionary::objectForKey(*((cocos2d::CCDictionary **)this + 58), *((int *)this + 147));
v24 = v23;
if ( v23 )
{
v25 = (char *)v33 + 1;
if ( (v33[0] & 1) != 0 )
v25 = (char *)v34;
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v23 + 928LL))(v23, v25);
}
if ( (int)v15 >= (int)v17 )
{
v26 = *((_QWORD *)this + 56);
if ( v26 )
{
v27 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v26 + 1072LL);
v30 = 0;
v31 = -1;
v32 = -1;
v27(v26, &v30);
}
if ( v24 )
{
v28 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v24 + 1072LL);
v30 = 50;
v31 = -1;
v32 = 50;
v28(v24, &v30);
}
}
if ( (v33[0] & 1) != 0 )
operator delete(v34);
}
return _stack_chk_guard;
}