//
// SecretRewardsLayer::updateUnlockedGoldLabel from 0xb9aba4 to 0xb9acb0 (268 bytes)
//
// 3 xrefs:
// > SecretRewardsLayer::onGoldChest @ 0xb9ebf0
// > SecretRewardsLayer::init @ 0xba00d0
// > ??> @ 0x80350
//
// 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:43 +0000
//
__int64 __fastcall SecretRewardsLayer::updateUnlockedGoldLabel(SecretRewardsLayer *this)
{
__int64 v2; // x0
GameStatsManager *v3; // x0
unsigned int v4; // w22
__int64 v5; // x0
unsigned int v6; // w0
__int64 v7; // x23
int v8; // w21
void (__fastcall *v9)(__int64, __int64); // x24
cocos2d::CCString *v10; // x0
__int64 CString; // x0
__int64 v12; // x0
void (__fastcall *v13)(__int64, _BYTE *); // x2
void (__fastcall *v15)(__int64, _BYTE *); // x3
_BYTE v16[8]; // [xsp+40h] [xbp+40h] BYREF
v2 = GameStatsManager::sharedState(_stack_chk_guard);
v3 = (GameStatsManager *)GameStatsManager::countUnlockedSecretChests(v2, 9);
v4 = (unsigned int)v3;
v5 = GameStatsManager::sharedState(v3);
v6 = GameStatsManager::countSecretChests(v5, 9);
v7 = *((_QWORD *)this + 57);
v8 = v6;
v9 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v7 + 928LL);
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i / %i", (const char *)v4, v6);
CString = cocos2d::CCString::getCString(v10);
v9(v7, CString);
v12 = *((_QWORD *)this + 57);
if ( (int)v4 >= v8 )
{
v15 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v12 + 1072LL);
v16[0] = 50;
v16[1] = -1;
v16[2] = 50;
v15(v12, v16);
}
else
{
v13 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v12 + 1072LL);
qmemcpy(v16, "dWp", 3);
v13(v12, v16);
}
return _stack_chk_guard;
}