//
// GameStatsManager::storeSecretCoin from 0x8cb5d8 to 0x8cb6f8 (288 bytes)
//
// 5 xrefs:
// > LevelPage::ccTouchBegan @ 0x8c6300
// > GJBaseGameLayer::processItems @ 0x9aea54
// > SecretLayer::onSubmit @ 0xa607a4
// > SecretLayer2::onSubmit @ 0xa91784
// > ??> @ 0x61d38
//
// 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 12:56:36 +0000
//
__int64 __fastcall GameStatsManager::storeSecretCoin(GameStatsManager *this, const char *a2)
{
__int64 v2; // x23
cocos2d::CCObject *v3; // x24
const char *SecretCoinKey; // x25
size_t v5; // x0
size_t v6; // x19
unsigned __int64 v7; // x0
char *v8; // x3
__int64 v10; // [xsp+50h] [xbp+50h] BYREF
size_t v11; // [xsp+58h] [xbp+58h]
void *v12; // [xsp+60h] [xbp+60h]
v2 = *((_QWORD *)this + 65);
v3 = *((cocos2d::CCObject **)this + 40);
v10 = 0;
SecretCoinKey = (const char *)GameStatsManager::getSecretCoinKey(this, a2);
v11 = 0;
v12 = nullptr;
v5 = strlen(SecretCoinKey);
v6 = v5;
if ( v5 > 0xFFFFFFFFFFFFFFEFLL )
sub_62CC1C();
if ( v5 > 0x16 )
{
v7 = (v5 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v10 = v7 | 1;
v8 = (char *)operator new(v7);
v12 = v8;
v11 = v6;
LABEL_4:
v8 = (char *)memcpy(v8, SecretCoinKey, v6);
goto LABEL_5;
}
LOBYTE(v10) = 2 * v5;
v8 = (char *)&v10 + 1;
if ( v5 )
goto LABEL_4;
LABEL_5:
v8[v6] = 0;
cocos2d::CCDictionary::setObject(v2, v3);
if ( (v10 & 1) != 0 )
operator delete(v12);
return _stack_chk_guard;
}