//
// GJBaseGameLayer::refreshKeyframeAnims from 0x140233ce0 to 0x140233ebe (478 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::updateSpecialGroupData @ 0x14020e080
// > LevelEditorLayer::init @ 0x1402d2e49
// > ??> @ 0x1406cdfc8
//
// 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::refreshKeyframeAnims(GJBaseGameLayer *a1)
{
__int64 v2; // rcx
__int64 v3; // rax
cocos2d::CCArray *m_objects; // r14
cocos2d::CCDictionary *v5; // r15
cocos2d::ccArray *data; // r14
__int64 num; // rax
cocos2d::CCObject **arr; // r14
cocos2d::CCObject **i; // rbp
cocos2d::CCObject *v10; // rbx
__int64 v11; // rcx
cocos2d::CCArray *v12; // rdi
struct cocos2d::CCArray *v13; // r14
unsigned int j; // ebp
struct cocos2d::CCObject *v15; // rax
cocos2d::CCArray *v16; // rdi
unsigned int k; // ebx
struct cocos2d::CCObject *v18; // rax
cocos2d::CCDictionary::removeAllObjects(a1->m_keyframeGroups);
a1->m_keyframeGroup = 0;
v3 = cocos2d::CCDictionary::create(v2);
m_objects = a1->m_objects;
v5 = (cocos2d::CCDictionary *)v3;
if ( m_objects )
{
data = m_objects->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
for ( i = &arr[num - 1]; arr <= i; ++arr )
{
v10 = *arr;
if ( !*arr )
break;
if ( v10[18].m_eObjType == 3032 )
{
v12 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v5, (int)v10[33].m_uAutoReleaseCount);
if ( !v12 )
{
v12 = (cocos2d::CCArray *)cocos2d::CCArray::create(v11);
v12->setTag(v12, v10[33].m_uAutoReleaseCount);
cocos2d::CCDictionary::setObject(v5, v12, (int)v10[33].m_uAutoReleaseCount);
}
cocos2d::CCArray::addObject(v12, v10);
}
}
}
}
v13 = cocos2d::CCDictionary::allKeys(v5);
qsort(v13->data->arr, v13->data->num, 8u, (_CoreCrtNonSecureSearchSortCompareFunction)sub_1402052C0);
for ( j = 0; j < cocos2d::CCArray::count(v13); ++j )
{
v15 = cocos2d::CCArray::objectAtIndex(v13, j);
v16 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v5, SLODWORD(v15[1].__vftable));
qsort(v16->data->arr, v16->data->num, 8u, (_CoreCrtNonSecureSearchSortCompareFunction)sub_1402052A0);
v16->setTag(v16, a1->m_keyframeGroup);
cocos2d::CCDictionary::setObject(a1->m_keyframeGroups, v16, a1->m_keyframeGroup);
for ( k = 0; k < cocos2d::CCArray::count(v16); ++k )
{
v18 = cocos2d::CCArray::objectAtIndex(v16, k);
v18[33].m_uAutoReleaseCount = a1->m_keyframeGroup;
v18[33].m_eObjType = k;
}
++a1->m_keyframeGroup;
}
}