//
// SetupArtSwitchPopup::selectArtClosed from 0xa515fc to 0xa51724 (296 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'SetupArtSwitchPopup::selectArtClosed @ 0xa51728
// > ??> @ 0x3d560
// > ??> @ 0x11e94f0
//
// 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 SetupArtSwitchPopup::selectArtClosed(SetupArtSwitchPopup *a1, SelectArtLayer *a2)
{
int m_art; // w22
cocos2d::CCSprite *m_artSprite; // x20
void (__fastcall *setDisplayFrame)(cocos2d::CCSprite *__hidden, cocos2d::CCSpriteFrame *); // x23
cocos2d::CCSpriteFrameCache *v6; // x24
cocos2d::CCSpriteFrame *v7; // x0
char *v8; // x0
unsigned int *v9; // x2
int v10; // w1
char *v11; // [xsp+50h] [xbp+50h] BYREF
m_art = a2->m_art;
SetupTriggerPopup::updateValue(a1, 533, (float)m_art);
m_artSprite = a1->m_artSprite;
setDisplayFrame = m_artSprite->setDisplayFrame;
v6 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
artIconForKey(m_art, a1->m_artType, (__int64)&v11);
v7 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v6, v11);
setDisplayFrame(m_artSprite, v7);
v8 = v11 - 24;
if ( v11 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v9 = (unsigned int *)(v11 - 8);
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *((_DWORD *)v11 - 2);
*((_DWORD *)v11 - 2) = v10 - 1;
}
if ( v10 <= 0 )
operator delete(v8);
}
}