//
// GameManager::rewardedVideoHidden from 0x1003697e0 to 0x100369a1b (571 bytes)
//
// 2 xrefs:
// > GameManager::rewardedVideoAdFinished @ 0x100369716
// > GameManager::rewardedVideoHiddenDelayed @ 0x100369794
//
// 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:28:59 +0000
//
void __fastcall GameManager::rewardedVideoHidden(__int64 a1, __m128 a2)
{
__int64 v3; // rax
void (__fastcall ***v4)(_QWORD); // rdi
__int64 v5; // rsi
__int64 v6; // r14
__int64 v7; // rdi
_QWORD *Special; // r14
char *v9; // r15
__int64 v10; // rdi
__int64 v11; // r12
int HighestChildZ; // eax
__int64 v13; // rdx
void (__fastcall ***v14)(_QWORD); // rdi
__int64 v15; // r14
__int64 v16; // rdi
char *v17; // r15
__int64 v18; // r12
int v19; // eax
__int64 v20; // rdx
void (__fastcall ***v21)(_QWORD); // rdi
__m128 v22; // [rsp+20h] [rbp-50h] BYREF
void *__p; // [rsp+30h] [rbp-40h]
__m128 v24; // [rsp+38h] [rbp-38h] BYREF
void *v25; // [rsp+48h] [rbp-28h]
if ( *(int *)(a1 + 1716) > 0 )
{
v3 = GameStatsManager::sharedState();
GameStatsManager::unlockGauntlet(v3, *(_DWORD *)(a1 + 1716));
v4 = *(void (__fastcall ****)(_QWORD))(a1 + 1296);
if ( v4 )
(**v4)(v4);
*(_DWORD *)(a1 + 1716) = 0;
return;
}
v5 = GameStatsManager::sharedState();
GameStatsManager::getNextVideoAdReward((__int64)&v24, v5);
if ( (v24.i8[0] & 1) == 0 )
{
if ( v24.u8[0] >> 1 )
goto LABEL_7;
LABEL_10:
*(_BYTE *)(AchievementManager::sharedState(&v24, v5) + 360) = 1;
v7 = GameStatsManager::sharedState();
GameStatsManager::collectVideoReward(v7, 0x64u, a2);
*(_BYTE *)(AchievementManager::sharedState(v7, 100) + 360) = 0;
Special = GJRewardItem::createSpecial(1, 100, 0, 0, 0, 0, 0, 0, 0);
v9 = RewardUnlockLayer::create(*((_DWORD *)Special + 16), 0);
v10 = *(_QWORD *)(a1 + 1296);
if ( v10 && (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v10 + 8LL))(v10) )
*((_DWORD *)v9 + 184) = -1032847360;
v11 = *(_QWORD *)(cocos2d::CCDirector::sharedDirector(v10, 0) + 272);
HighestChildZ = cocos2d::CCScene::getHighestChildZ(v11);
v13 = 1000;
if ( HighestChildZ >= 1000 )
v13 = (unsigned int)cocos2d::CCScene::getHighestChildZ(v11) + 1;
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)v11 + 464LL))(v11, v9, v13);
RewardUnlockLayer::showCollectReward((__int64)v9, (__int64)Special);
v14 = *(void (__fastcall ****)(_QWORD))(a1 + 1296);
if ( v14 )
(**v14)(v14);
goto LABEL_24;
}
if ( !v24.i64[1] )
goto LABEL_10;
LABEL_7:
v6 = GameStatsManager::sharedState();
if ( (v24.i8[0] & 1) != 0 )
{
sub_10001AD30(&v22, v25, v24.u64[1]);
}
else
{
__p = v25;
a2 = v24;
v22 = v24;
}
v15 = GameStatsManager::unlockSpecialChest(v6, (__int64)&v22, a2);
if ( (v22.i8[0] & 1) != 0 )
operator delete(__p);
v16 = *(unsigned int *)(v15 + 64);
v17 = RewardUnlockLayer::create(v16, 0);
v18 = *(_QWORD *)(cocos2d::CCDirector::sharedDirector(v16, 0) + 272);
v19 = cocos2d::CCScene::getHighestChildZ(v18);
v20 = 1000;
if ( v19 >= 1000 )
v20 = (unsigned int)cocos2d::CCScene::getHighestChildZ(v18) + 1;
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)v18 + 464LL))(v18, v17, v20);
RewardUnlockLayer::showCollectReward((__int64)v17, v15);
v21 = *(void (__fastcall ****)(_QWORD))(a1 + 1296);
if ( v21 )
(**v21)(v21);
LABEL_24:
if ( (v24.i8[0] & 1) != 0 )
operator delete(v25);
}