//
// SpriteAnimationManager::switchToFirstFrameOfAnimation from 0x6afd38 to 0x6afed0 (408 bytes)
//
// 1 xrefs:
// > ??> @ 0x78b68
//
// 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:50:50 +0000
//
__int64 __fastcall SpriteAnimationManager::switchToFirstFrameOfAnimation(__int64 a1, char *a2)
{
char v4; // w0
__int64 v5; // x0
__int64 v6; // x1
int AnimType; // w1
__int64 v8; // x23
const char *v9; // x1
cocos2d::CCString *v10; // x0
const char *CString; // x0
size_t v12; // x0
__int64 v13; // x1
char *v15; // [xsp+48h] [xbp+48h]
__int64 v16; // [xsp+48h] [xbp+48h]
int v17; // [xsp+48h] [xbp+48h]
__int64 v18; // [xsp+50h] [xbp+50h] BYREF
__int64 v19; // [xsp+58h] [xbp+58h]
void *v20; // [xsp+60h] [xbp+60h]
if ( !*(_DWORD *)(cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 392), a2) + 28) )
{
v4 = *a2;
v18 = 0;
v19 = 0;
v20 = nullptr;
if ( (v4 & 1) != 0 )
{
std::string::__init(&v18, *((void **)a2 + 2), *((_QWORD *)a2 + 1));
}
else
{
v5 = *(_QWORD *)a2;
v6 = *((_QWORD *)a2 + 1);
v20 = *((void **)a2 + 2);
v18 = v5;
v19 = v6;
}
AnimType = SpriteAnimationManager::getAnimType(a1, (__int64)&v18);
if ( (v18 & 1) != 0 )
{
v17 = AnimType;
operator delete(v20);
AnimType = v17;
}
CCAnimatedSprite::switchToMode(*(_QWORD *)(a1 + 320), AnimType);
v8 = *(_QWORD *)(a1 + 392);
v9 = a2 + 1;
if ( (*a2 & 1) != 0 )
v9 = *((const char **)a2 + 2);
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%s_first", v9);
CString = (const char *)cocos2d::CCString::getCString(v10);
v18 = 0;
v15 = (char *)CString;
v19 = 0;
v20 = nullptr;
v12 = strlen(CString);
std::string::__init(&v18, v15, v12);
v13 = cocos2d::CCDictionary::objectForKey(v8, &v18);
if ( (v18 & 1) != 0 )
{
v16 = v13;
operator delete(v20);
v13 = v16;
}
if ( (unsigned int)(*(_DWORD *)(v13 + 28) - 1) <= 1 )
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 320) + 656LL) + 1160LL))(*(_QWORD *)(*(_QWORD *)(a1 + 320) + 656LL));
}
return _stack_chk_guard;
}