//
// GJBaseGameLayer::refreshKeyframeAnims from 0x9a79dc to 0x9a7bb0 (468 bytes)
//
// 3 xrefs:
// > LevelEditorLayer::init @ 0x7af3c4
// > GJBaseGameLayer::updateSpecialGroupData @ 0x9f3ca0
// > ??> @ 0x42c58
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:58:10 +0000
//
__int64 __fastcall GJBaseGameLayer::refreshKeyframeAnims(cocos2d::CCDictionary **this)
{
cocos2d::CCDictionary *v2; // x0
cocos2d::CCDictionary *v3; // x24
__int64 v4; // x0
unsigned int *v5; // x1
unsigned int v6; // w22
cocos2d::CCArray *v7; // x23
__int64 result; // x0
unsigned int v9; // w19
__int64 v10; // x0
cocos2d::CCObject *v11; // x20
__int64 v12; // x0
cocos2d::CCObject **v13; // x19
cocos2d::CCObject **i; // x22
cocos2d::CCObject *v15; // x20
cocos2d::CCObject *v16; // x23
v2 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::removeAllObjects(*(this + 1659));
*((_DWORD *)this + 3320) = 0;
v3 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v2);
v4 = (__int64)*(this + 410);
if ( v4 )
{
v5 = *(unsigned int **)(v4 + 56);
if ( *v5 )
{
v13 = *((cocos2d::CCObject ***)v5 + 2);
for ( i = &v13[*v5 - 1]; i >= v13; ++v13 )
{
v15 = *v13;
if ( !*v13 )
break;
if ( *((_DWORD *)v15 + 257) == 3032 )
{
v16 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(v3, *((int *)v15 + 464));
if ( !v16 )
{
v16 = (cocos2d::CCObject *)cocos2d::CCArray::create(nullptr);
(*(void (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)v16 + 72LL))(
v16,
*((unsigned int *)v15 + 464));
cocos2d::CCDictionary::setObject(v3, v16, *((int *)v15 + 464));
}
cocos2d::CCArray::addObject(v16, v15);
}
}
}
}
v6 = 0;
v7 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(v3);
qsort(
*(void **)(*((_QWORD *)v7 + 7) + 16LL),
**((unsigned int **)v7 + 7),
8u,
(int (*)(const void *, const void *))compKeyframeID);
result = cocos2d::CCArray::count(v7);
if ( (_DWORD)result )
{
do
{
v9 = 0;
v10 = cocos2d::CCArray::objectAtIndex(v7, v6);
v11 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(v3, *(int *)(v10 + 56));
qsort(
*(void **)(*((_QWORD *)v11 + 7) + 16LL),
**((unsigned int **)v11 + 7),
8u,
(int (*)(const void *, const void *))compShadowCopy);
(*(void (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)v11 + 72LL))(v11, *((unsigned int *)this + 3320));
cocos2d::CCDictionary::setObject(*(this + 1659), v11, *((int *)this + 3320));
while ( v9 < (unsigned int)cocos2d::CCArray::count(v11) )
{
v12 = cocos2d::CCArray::objectAtIndex(v11, v9);
*(_DWORD *)(v12 + 1856) = *((_DWORD *)this + 3320);
*(_DWORD *)(v12 + 1860) = v9++;
}
++v6;
++*((_DWORD *)this + 3320);
result = cocos2d::CCArray::count(v7);
}
while ( v6 < (unsigned int)result );
}
return result;
}