//
// GameStatsManager::storeChallenge from 0x100072df0 to 0x100072ed5 (229 bytes)
//
// 1 xrefs:
// > GameStatsManager::processChallengeQueue @ 0x100073a8c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GameStatsManager::storeChallenge(GameStatsManager *a1, int a2, GJChallengeItem *a3)
{
double v3; // xmm0_8
cocos2d::CCDictionary *m_activeChallenges; // r14
cocos2d::CCString *v6; // rax
const char *CString; // r12
size_t v8; // rax
size_t v9; // r15
char *v10; // r13
size_t v11; // r14
char v12; // [rsp+0h] [rbp-50h]
cocos2d::CCDictionary *v13; // [rsp+8h] [rbp-48h]
_QWORD __dst[2]; // [rsp+10h] [rbp-40h] BYREF
void *__p; // [rsp+20h] [rbp-30h]
a3->m_position = a2;
m_activeChallenges = a1->m_activeChallenges;
v6 = (cocos2d::CCString *)sub_1007AB580("%i", v12);
CString = cocos2d::CCString::getCString(v6);
v8 = strlen(CString);
if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v3);
v9 = v8;
if ( v8 >= 0x17 )
{
v13 = m_activeChallenges;
v11 = 26;
if ( (v8 | 7) != 0x17 )
v11 = (v8 | 7) + 1;
v10 = (char *)operator new(v11);
__p = v10;
__dst[0] = v11 + 1;
m_activeChallenges = v13;
__dst[1] = v9;
goto LABEL_8;
}
LOBYTE(__dst[0]) = 2 * v8;
v10 = (char *)__dst + 1;
if ( v8 )
LABEL_8:
memmove(v10, CString, v9);
v10[v9] = 0;
cocos2d::CCDictionary::setObject_1(m_activeChallenges, a3, __dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
}