//
// GJPathPage::onUnlock from 0x6d4770 to 0x6d4810 (160 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:57:05 +0000
//
int __fastcall GJPathPage::onUnlock(GJPathPage *this, cocos2d::CCObject *a2)
{
int v3; // r4
GameStatsManager *v4; // r0
GameStatsManager *StoreItem; // r4
int v6; // r8
GameStatsManager *v7; // r9
char *v8; // r1
int Stat; // r9
GJStoreItem *v10; // r1
int *v12; // r0
char v13; // [sp+0h] [bp+0h] BYREF
char v14; // [sp+1h] [bp+1h] BYREF
char *v15; // [sp+8h] [bp+8h]
v3 = *((_DWORD *)this + 133) + 5;
v4 = (GameStatsManager *)GameStatsManager::sharedState(this);
StoreItem = (GameStatsManager *)GameStatsManager::getStoreItem(v4, v3, 12);
v6 = *((_DWORD *)StoreItem + 75) - *((_DWORD *)StoreItem + 76);
v7 = (GameStatsManager *)GameStatsManager::sharedState(StoreItem);
GJStoreItem::getCurrencyKey((GJStoreItem *)&v13, (int)StoreItem);
if ( (v13 & 1) != 0 )
v8 = v15;
else
v8 = &v14;
Stat = GameStatsManager::getStat(v7, v8);
std::string::~string((int)&v13);
if ( v6 > Stat )
return GJPathPage::showCantAffordMessage(this, StoreItem);
v12 = PurchaseItemPopup::create(StoreItem, v10);
v12[131] = (int)this + 524;
return (*(int (__fastcall **)(int *))(*v12 + 656))(v12);
}