//
// GJBaseGameLayer::refreshKeyframeAnims from 0x595558 to 0x59567e (294 bytes)
//
// 2 xrefs:
// > LevelEditorLayer::init @ 0x47660c
// > GJBaseGameLayer::updateSpecialGroupData @ 0x5c1532
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:53:08 +0000
//
unsigned int __fastcall GJBaseGameLayer::refreshKeyframeAnims(cocos2d::CCDictionary **this)
{
cocos2d::CCDictionary *v2; // r0
cocos2d::CCDictionary *v3; // r0
int v4; // r3
cocos2d::CCDictionary *v5; // r8
unsigned int v6; // r9
int *v7; // r5
cocos2d::CCDictionary **v8; // r4
size_t **v9; // r10
_DWORD *v10; // r2
cocos2d::CCObject **v11; // r5
cocos2d::CCObject **v12; // r7
cocos2d::CCObject *v13; // r6
cocos2d::CCObject *v14; // t1
unsigned int result; // r0
int v16; // r0
unsigned int v17; // r7
size_t **v18; // r6
int v19; // r0
int v20; // r3
cocos2d::CCObject *v21; // r9
v2 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::removeAllObjects(*(this + 2808));
*(this + 2809) = nullptr;
v3 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v2);
v4 = (int)*(this + 522);
v5 = v3;
if ( v4 )
{
v10 = *(_DWORD **)(v4 + 52);
if ( *v10 )
{
v11 = (cocos2d::CCObject **)v10[3];
v12 = &v11[*v10] + 0x3FFFFFFF;
while ( v11 <= v12 )
{
v14 = *v11++;
v13 = v14;
if ( !v14 )
break;
if ( *((_DWORD *)v13 + 223) == 3032 )
{
v21 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(v5, *((_DWORD *)v13 + 414));
if ( !v21 )
{
v21 = (cocos2d::CCObject *)cocos2d::CCArray::create(nullptr);
(*(void (__fastcall **)(cocos2d::CCObject *, _DWORD))(*(_DWORD *)v21 + 36))(v21, *((_DWORD *)v13 + 414));
cocos2d::CCDictionary::setObject(v5, v21, *((_DWORD *)v13 + 414));
}
cocos2d::CCArray::addObject(v21, v13);
}
}
}
}
v6 = 0;
v7 = (int *)(this + 2809);
v8 = this + 2808;
v9 = (size_t **)cocos2d::CCDictionary::allKeys(v5);
qsort((void *)v9[13][3], *v9[13], 4u, compKeyframeID);
while ( 1 )
{
result = cocos2d::CCArray::count((cocos2d::CCArray *)v9);
if ( v6 >= result )
break;
v16 = cocos2d::CCArray::objectAtIndex((cocos2d::CCArray *)v9, v6);
v17 = 0;
v18 = (size_t **)cocos2d::CCDictionary::objectForKey(v5, *(_DWORD *)(v16 + 52));
qsort((void *)v18[13][3], *v18[13], 4u, compShadowCopy);
((void (__fastcall *)(size_t **, int))(*v18)[9])(v18, *v7);
cocos2d::CCDictionary::setObject(*v8, (cocos2d::CCObject *)v18, *v7);
while ( v17 < cocos2d::CCArray::count((cocos2d::CCArray *)v18) )
{
v19 = cocos2d::CCArray::objectAtIndex((cocos2d::CCArray *)v18, v17);
v20 = *v7;
*(_DWORD *)(v19 + 1660) = v17++;
*(_DWORD *)(v19 + 1656) = v20;
}
++v6;
++*v7;
}
return result;
}