//
// SecretRewardsLayer::updateUnlockedGoldLabel from 0x10070f3a0 to 0x10070f451 (177 bytes)
//
// 2 xrefs:
// > SecretRewardsLayer::init @ 0x10070e466
// > SecretRewardsLayer::onGoldChest @ 0x10070f228
//
// 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:36:05 +0000
//
__int64 __fastcall SecretRewardsLayer::updateUnlockedGoldLabel(__int64 a1)
{
__int64 v1; // rax
int v2; // r14d
__int64 v3; // rax
int v4; // r15d
__int64 v5; // r12
__int64 v6; // rax
__int64 CString; // rax
__int64 *v8; // rdi
__int64 v9; // rax
__int16 *v10; // rsi
char v12; // [rsp+0h] [rbp-30h]
__int16 v13; // [rsp+8h] [rbp-28h] BYREF
char v14; // [rsp+Ah] [rbp-26h]
_WORD v15[18]; // [rsp+Ch] [rbp-24h] BYREF
v1 = GameStatsManager::sharedState();
v2 = GameStatsManager::countUnlockedSecretChests(v1, 9);
v3 = GameStatsManager::sharedState();
v4 = GameStatsManager::countSecretChests(v3, 9);
v5 = *(_QWORD *)(a1 + 456);
v6 = sub_10088E820("%i / %i", v12);
CString = cocos2d::CCString::getCString(v6);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v5 + 928LL))(v5, CString);
v8 = *(__int64 **)(a1 + 456);
if ( v2 >= v4 )
{
v14 = 50;
v13 = -206;
v9 = *v8;
v10 = &v13;
}
else
{
qmemcpy(v15, "dWp", 3);
v9 = *v8;
v10 = v15;
}
return (*(__int64 (__fastcall **)(__int64 *, __int16 *))(v9 + 1072))(v8, v10);
}