//
// LevelEditorLayer::duplicateKeyframeAnimation from 0x671c4c to 0x671db4 (360 bytes)
//
// 2 xrefs:
// > SetupKeyframePopup::onCustomButton @ 0xa3d500
// > ??> @ 0x2c688
//
// 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
//
cocos2d::CCArray *LevelEditorLayer::duplicateKeyframeAnimation(LevelEditorLayer *a1, int a2)
{
cocos2d::CCArray *NewKeyframeAnim; // x21
cocos2d::CCArray *v4; // x0
cocos2d::CCArray *v5; // x22
cocos2d::CCArray *ObjectsFromString; // x0
char *v7; // x0
unsigned int *v9; // x2
int v10; // w1
_DWORD *v12; // [xsp+60h] [xbp+60h] BYREF
NewKeyframeAnim = GJBaseGameLayer::createNewKeyframeAnim(a1);
a1->m_duplicateKeyframeGroup = NewKeyframeAnim->getTag(NewKeyframeAnim);
v4 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(a1->m_keyframeGroups, a2);
v5 = v4;
if ( v4 )
{
if ( (unsigned int)cocos2d::CCArray::count(v4) )
{
EditorUI::copyObjects((__int64 *)&v12, a1->m_editorUI, v5, 0, 1);
a1->m_keepEditorLayer = 1;
ObjectsFromString = LevelEditorLayer::createObjectsFromString(a1, (const void **)&v12, 1u, 1u);
GJBaseGameLayer::assignNewStickyGroups(a1, ObjectsFromString);
a1->m_keepEditorLayer = 0;
v7 = (char *)(v12 - 6);
if ( v12 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v9 = v12 - 2;
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *(v12 - 2);
*(v12 - 2) = v10 - 1;
}
if ( v10 <= 0 )
operator delete(v7);
}
}
}
a1->m_duplicateKeyframeGroup = 0;
return NewKeyframeAnim;
}