//
// RewardsPage::onReward from 0x140562be0 to 0x140562d1c (316 bytes)
//
// 2 xrefs:
// > RewardsPage::init @ 0x140562744
// > ??> @ 0x14092c4b0
//
// 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 11:34:15 +0000
//
// Hidden C++ exception states: #wind=1
char __fastcall RewardsPage::onReward(__int64 a1, __int64 a2)
{
unsigned int v4; // eax
cocos2d::CCNode *v5; // rbx
struct cocos2d::CCAction *v6; // rax
__int64 v7; // rax
__int64 v8; // rbx
int v9; // eax
void *v11; // [rsp+38h] [rbp+10h] BYREF
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
if ( v4 == 1 )
{
if ( !*(_BYTE *)(a1 + 712) )
{
v5 = *(cocos2d::CCNode **)(a1 + 680);
goto LABEL_7;
}
}
else if ( v4 == 2 && !*(_BYTE *)(a1 + 713) )
{
v5 = *(cocos2d::CCNode **)(a1 + 688);
LABEL_7:
if ( v5 )
{
cocos2d::CCNode::stopAllActions(v5);
LOWORD(v11) = 19455;
BYTE2(v11) = 0;
(**((void (__fastcall ***)(__int64, void **))v5 + 46))((__int64)v5 + 368, &v11);
v6 = cocos2d::CCTintTo::create(1.0, 0xFFu, 0xFFu, 0xFFu);
LOBYTE(v4) = (unsigned __int8)cocos2d::CCNode::runAction(v5, v6);
}
return v4;
}
if ( !*(_QWORD *)(a1 + 720) )
{
v7 = RewardUnlockLayer::create(v4, a1);
*(_QWORD *)(a1 + 720) = v7;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v7);
v8 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v11 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v11);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v8 = *(_QWORD *)&qword_14090BFB0;
}
v9 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
LOBYTE(v4) = GameLevelManager::getGJRewards(v8, v9);
}
return v4;
}