//
// GJBaseGameLayer::pickupItem from 0x85a1d4 to 0x85a2e4 (272 bytes)
//
// 4 xrefs:
// > PlayLayer::loadFromCheckpoint @ 0x5e4f98
// > GJBaseGameLayer::collisionCheckObjects @ 0x88bee4
// > GJBaseGameLayer::collisionCheckObjects @ 0x88c198
// > ??> @ 0x2c898
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void GJBaseGameLayer::pickupItem(GJBaseGameLayer *a1, EffectGameObject *a2)
{
cocos2d::CCDictionary *m_collectedItems; // x22
cocos2d::CCString *v4; // x0
char *CString; // x0
void *v6; // x0
unsigned int *v7; // x2
int v8; // w1
__int64 v9; // [xsp+40h] [xbp+40h] BYREF
m_collectedItems = a1->m_collectedItems;
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a2->m_secretCoinID);
CString = (char *)cocos2d::CCString::getCString(v4);
sub_D153B8((int)&v9, CString);
cocos2d::CCDictionary::setObject((int)m_collectedItems, a2);
v6 = (void *)(v9 - 24);
if ( (__int64 *)(v9 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v9 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *(_DWORD *)(v9 - 8);
*(_DWORD *)(v9 - 8) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v6);
}
}