//
// GameLevelManager::onGetGJSecretRewardCompleted from 0x100530cb0 to 0x100530dd7 (295 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x10052061b
//
// 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:31:50 +0000
//
void __fastcall GameLevelManager::onGetGJSecretRewardCompleted(__int64 a1, __int64 a2)
{
__int64 v2; // rax
__int64 v3; // r14
__int64 v4; // rax
__int64 v5; // r15
__int64 v6; // rdi
void (__fastcall ***v7)(_QWORD, __int128 *); // rbx
__int128 v8; // [rsp+0h] [rbp-70h] BYREF
void *__p; // [rsp+10h] [rbp-60h]
__int128 v10; // [rsp+20h] [rbp-50h] BYREF
void *v11; // [rsp+30h] [rbp-40h]
__int128 v12; // [rsp+38h] [rbp-38h] BYREF
void *v13; // [rsp+48h] [rbp-28h]
int v14[7]; // [rsp+54h] [rbp-1Ch] BYREF
GameLevelManager::removeDLFromActive(a1, "get_sreward");
v14[0] = 0;
v2 = sub_100577350(a1, a2, v14);
if ( v2 )
{
v3 = v2;
v4 = GameStatsManager::sharedState();
GameStatsManager::getSecretOnlineRewardKey((size_t *)&v12, v4, v14[0]);
v5 = GameStatsManager::sharedState();
if ( (v12 & 1) != 0 )
{
sub_10001AD30(&v8, v13, *((unsigned __int64 *)&v12 + 1));
}
else
{
__p = v13;
v8 = v12;
}
GameStatsManager::storeOnlineChest(v5, (__int64)&v8, v3);
if ( (v8 & 1) != 0 )
operator delete(__p);
v7 = *(void (__fastcall ****)(_QWORD, __int128 *))(a1 + 1416);
if ( v7 )
{
if ( (v12 & 1) != 0 )
{
sub_10001AD30(&v10, v13, *((unsigned __int64 *)&v12 + 1));
}
else
{
v11 = v13;
v10 = v12;
}
(**v7)(v7, &v10);
if ( (v10 & 1) != 0 )
operator delete(v11);
}
if ( (v12 & 1) != 0 )
operator delete(v13);
}
else
{
v6 = *(_QWORD *)(a1 + 1416);
if ( v6 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 8LL))(v6);
}
}