//
// GameStatsManager::collectVideoReward from 0x10008c660 to 0x10008c7a4 (324 bytes)
//
// 1 xrefs:
// > GameManager::rewardedVideoHidden @ 0x100380527
//
// 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::collectVideoReward(GameStatsManager *a1, int a2)
{
int v2; // r14d
double v3; // xmm0_8
cocos2d::CCString *v4; // rax
const char *CString; // r12
size_t v6; // rax
size_t v7; // r15
char *v8; // r13
size_t v9; // r14
cocos2d::CCDictionary *m_worldAdvertChests; // r15
__int64 v11; // rax
char v12; // [rsp+0h] [rbp-60h]
char v13; // [rsp+0h] [rbp-60h]
timeb v14; // [rsp+8h] [rbp-58h] BYREF
_QWORD __dst[2]; // [rsp+18h] [rbp-48h] BYREF
void *__p; // [rsp+28h] [rbp-38h]
int v17; // [rsp+34h] [rbp-2Ch]
v2 = a2;
ftime(&v14);
v3 = (double)(v14.millitm + 1000 * (v14.time & 0xFFFFF)) / 1000.0;
v4 = (cocos2d::CCString *)sub_1007AB580("%f", v12);
CString = cocos2d::CCString::getCString(v4);
v6 = strlen(CString);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v3);
v7 = v6;
if ( v6 >= 0x17 )
{
v17 = a2;
v9 = 26;
if ( (v6 | 7) != 0x17 )
v9 = (v6 | 7) + 1;
v8 = (char *)operator new(v9);
__p = v8;
__dst[0] = v9 + 1;
v2 = v17;
__dst[1] = v7;
goto LABEL_8;
}
LOBYTE(__dst[0]) = 2 * v6;
v8 = (char *)__dst + 1;
if ( v6 )
LABEL_8:
memmove(v8, CString, v7);
v8[v7] = 0;
m_worldAdvertChests = a1->m_worldAdvertChests;
v11 = sub_1007AB580("%i", v13);
cocos2d::CCDictionary::setObject_1(m_worldAdvertChests, v11, __dst);
a1->m_skipIncrementChallenge = 1;
GameStatsManager::incrementStat(a1, "14", v2);
a1->m_skipIncrementChallenge = 0;
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
}