//
// SetupKeyframePopup::refreshPreviewArt from 0xa3cf60 to 0xa3d124 (452 bytes)
//
// 3 xrefs:
// > SetupKeyframePopup::valueDidChange @ 0xa3d148
// > SetupKeyframePopup::onCustomButton @ 0xa3d4d0
// > ??> @ 0x68cd0
//
// 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 SetupKeyframePopup::refreshPreviewArt(SetupKeyframePopup *a1)
{
EffectGameObject *m_gameObject; // x0
cocos2d::CCArray *m_gameObjects; // x19
int *i; // x19
cocos2d::CCObject *v5; // x0
cocos2d::CCObject_vtbl *v6; // x0
unsigned int copyWithZone; // w2
void (__fastcall *v8)(cocos2d::CCObject *__hidden); // x0
void (__fastcall *j)(cocos2d::CCObject *__hidden); // x2
__int64 v10; // x1
__int64 v11; // x19
void *v12; // x0
cocos2d::ccArray *data; // x1
cocos2d::CCObject **arr; // x19
__int64 v15; // x0
unsigned __int64 v16; // x20
__int64 v17; // [xsp+58h] [xbp+58h] BYREF
int v18; // [xsp+60h] [xbp+60h] BYREF
__int64 v19; // [xsp+68h] [xbp+68h]
int *v20; // [xsp+70h] [xbp+70h]
int *v21; // [xsp+78h] [xbp+78h]
__int64 v22; // [xsp+80h] [xbp+80h]
if ( a1->m_editorLayer )
{
m_gameObject = a1->m_gameObject;
v18 = 0;
v19 = 0;
v22 = 0;
v20 = &v18;
v21 = &v18;
if ( m_gameObject )
m_gameObjects = (cocos2d::CCArray *)cocos2d::CCArray::createWithObject(
(cocos2d::CCArray *)m_gameObject,
(cocos2d::CCObject *)&v18);
else
m_gameObjects = a1->m_gameObjects;
if ( m_gameObjects )
{
if ( (unsigned int)cocos2d::CCArray::count(m_gameObjects) )
{
data = m_gameObjects->data;
if ( data->num )
{
arr = data->arr;
v15 = 8LL * data->num - 8;
v16 = (unsigned __int64)arr + v15;
if ( arr <= (cocos2d::CCObject **)((char *)arr + v15) )
{
do
{
if ( !*arr )
break;
std::_Rb_tree,std::less,std::allocator>::_M_insert_unique(
&v17,
&(*arr++)[32].m_uOrderOfArrival);
}
while ( v16 >= (unsigned __int64)arr );
}
}
}
}
for ( i = v20; i != &v18; i = (int *)sub_CFAB74(i) )
{
v5 = cocos2d::CCDictionary::objectForKey(a1->m_editorLayer->m_keyframeGroups, i[8]);
if ( v5 )
{
v6 = v5[1].__vftable;
copyWithZone = (unsigned int)v6->copyWithZone;
if ( LODWORD(v6->copyWithZone) )
{
v8 = v6->~CCObject_0;
for ( j = (void (__fastcall *)(cocos2d::CCObject *__hidden))((char *)v8 + 8 * copyWithZone - 8);
(unsigned __int64)j >= (unsigned __int64)v8;
*(_BYTE *)(v10 + 1865) = 1 )
{
v10 = *(_QWORD *)v8;
if ( !*(_QWORD *)v8 )
break;
v8 = (void (__fastcall *)(cocos2d::CCObject *__hidden))((char *)v8 + 8);
}
}
}
}
v11 = v19;
while ( v11 )
{
std::_Rb_tree,std::less,std::allocator>::_M_erase(
(__int64)&v17,
*(_QWORD **)(v11 + 24));
v12 = (void *)v11;
v11 = *(_QWORD *)(v11 + 16);
operator delete(v12);
}
}
}