//
// GJPathPage::onUnlock from 0x1002eba60 to 0x1002ebb29 (201 bytes)
//
// 1 xrefs:
// > GJPathPage::init @ 0x1002eb3cf
//
// 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:23 +0000
//
__int64 __fastcall GJPathPage::onUnlock(__int64 a1, __m128 a2)
{
unsigned int v2; // r14d
__int64 v3; // rax
__int64 StoreItem; // r14
int v5; // r12d
int v6; // r13d
__int64 v7; // r15
const char *v8; // rsi
int Stat; // r15d
int v10; // r12d
_QWORD *v12; // rax
char v13; // [rsp+0h] [rbp-40h] BYREF
char v14; // [rsp+1h] [rbp-3Fh] BYREF
void *__p; // [rsp+10h] [rbp-30h]
v2 = *(_DWORD *)(a1 + 688) + 5;
v3 = GameStatsManager::sharedState();
StoreItem = GameStatsManager::getStoreItem(v3, v2, 0xCu);
v5 = *(_DWORD *)(StoreItem + 352);
v6 = *(_DWORD *)(StoreItem + 356);
v7 = GameStatsManager::sharedState();
GJStoreItem::getCurrencyKey((__int64)&v13, StoreItem);
if ( (v13 & 1) != 0 )
v8 = (const char *)__p;
else
v8 = &v14;
Stat = GameStatsManager::getStat(v7, v8, a2);
v10 = v5 - v6;
if ( (v13 & 1) != 0 )
operator delete(__p);
if ( v10 > Stat )
return sub_1002EC240(a1, StoreItem);
v12 = (_QWORD *)PurchaseItemPopup::create(StoreItem);
v12[84] = a1 + 672;
return (*(__int64 (__fastcall **)(_QWORD *))(*v12 + 1312LL))(v12);
}