//
// SpriteAnimationManager::runAnimation from 0x6b0418 to 0x6b0674 (604 bytes)
//
// 8 xrefs:
// > CCAnimatedSprite::runAnimation @ 0x68c924
// > CCAnimatedSprite::runAnimationForced @ 0x68c9f4
// > CCAnimatedSprite::loadType @ 0x68ccf0
// > AnimatedGameObject::updateObjectAnimation @ 0x888940
// > AnimatedGameObject::updateObjectAnimation @ 0x8889c8
// > GJMapObject::createMonster @ 0xac2dbc
// > GJMapObject::startMonsterJumpLoop @ 0xac3030
// > ??> @ 0xc2fb0
//
// 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::runAnimation(__int64 a1, __int64 a2)
{
__int64 v2; // x23
char v5; // w0
__int64 v6; // x0
__int64 v7; // x1
int Prio; // w25
const char *v9; // x1
size_t v10; // x0
int v11; // w24
const char *v12; // x1
size_t v13; // x0
char v14; // w0
__int64 v15; // x0
__int64 v16; // x1
char v18; // w0
__int64 v19; // x0
__int64 v20; // x1
char *v21; // [xsp+58h] [xbp+58h]
char *v22; // [xsp+58h] [xbp+58h]
__int64 v23; // [xsp+60h] [xbp+60h] BYREF
__int64 v24; // [xsp+68h] [xbp+68h]
void *v25; // [xsp+70h] [xbp+70h]
v2 = a1 + 400;
if ( !sub_6AF58C(a1 + 400, a2) )
{
v5 = *(_BYTE *)a2;
v23 = 0;
v24 = 0;
v25 = nullptr;
if ( (v5 & 1) != 0 )
{
std::string::__init(&v23, *(void **)(a2 + 16), *(_QWORD *)(a2 + 8));
}
else
{
v6 = *(_QWORD *)a2;
v7 = *(_QWORD *)(a2 + 8);
v25 = *(void **)(a2 + 16);
v23 = v6;
v24 = v7;
}
Prio = SpriteAnimationManager::getPrio(a1, (__int64)&v23);
if ( (v23 & 1) != 0 )
operator delete(v25);
v9 = (const char *)(a1 + 401);
if ( (*(_BYTE *)(a1 + 400) & 1) != 0 )
v9 = *(const char **)(v2 + 16);
v21 = (char *)v9;
v23 = 0;
v24 = 0;
v25 = nullptr;
v10 = strlen(v9);
std::string::__init(&v23, v21, v10);
v11 = SpriteAnimationManager::getPrio(a1, (__int64)&v23);
if ( (v23 & 1) != 0 )
operator delete(v25);
if ( Prio > v11 )
{
v18 = *(_BYTE *)a2;
v23 = 0;
v24 = 0;
v25 = nullptr;
if ( (v18 & 1) != 0 )
{
std::string::__init(&v23, *(void **)(a2 + 16), *(_QWORD *)(a2 + 8));
}
else
{
v19 = *(_QWORD *)a2;
v20 = *(_QWORD *)(a2 + 8);
v25 = *(void **)(a2 + 16);
v23 = v19;
v24 = v20;
}
SpriteAnimationManager::queueAnimation(a1, (char *)&v23);
}
else
{
v12 = (const char *)(a1 + 401);
if ( (*(_BYTE *)(a1 + 400) & 1) != 0 )
v12 = *(const char **)(v2 + 16);
v22 = (char *)v12;
v23 = 0;
v24 = 0;
v25 = nullptr;
v13 = strlen(v12);
std::string::__init(&v23, v22, v13);
SpriteAnimationManager::queueAnimation(a1, (char *)&v23);
if ( (v23 & 1) != 0 )
operator delete(v25);
v14 = *(_BYTE *)a2;
v23 = 0;
v24 = 0;
v25 = nullptr;
if ( (v14 & 1) != 0 )
{
std::string::__init(&v23, *(void **)(a2 + 16), *(_QWORD *)(a2 + 8));
}
else
{
v15 = *(_QWORD *)a2;
v16 = *(_QWORD *)(a2 + 8);
v25 = *(void **)(a2 + 16);
v23 = v15;
v24 = v16;
}
SpriteAnimationManager::executeAnimation(a1, (__int64)&v23);
}
if ( (v23 & 1) != 0 )
operator delete(v25);
}
return _stack_chk_guard;
}