//
// SpriteAnimationManager::executeAnimation from 0x100324100 to 0x100324384 (644 bytes)
//
// 1 xrefs:
// > SpriteAnimationManager::runAnimation @ 0x100323f3c
//
// 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
//
cocos2d::CCAction *__fastcall SpriteAnimationManager::executeAnimation(__int64 a1, std::string *a2)
{
std::string *v2; // x21
cocos2d::CCAction *result; // x0
__int64 v5; // x20
int v6; // w23
cocos2d::CCString *v7; // x0
spriteMode v8; // w21
cocos2d::CCString *v9; // x0
spriteMode v10; // w22
_BOOL4 v11; // w0
_BOOL4 v12; // w22
__int64 v13; // x22
cocos2d::CCString *v14; // x0
char *CString; // x0
__int64 v16; // x21
void *__p[2]; // [xsp+10h] [xbp-A0h] BYREF
std::string::size_type v18; // [xsp+20h] [xbp-90h]
void *v19[2]; // [xsp+28h] [xbp-88h] BYREF
char v20; // [xsp+3Fh] [xbp-71h]
void *v21[2]; // [xsp+40h] [xbp-70h] BYREF
std::string::size_type v22; // [xsp+50h] [xbp-60h]
__int128 __dst; // [xsp+60h] [xbp-50h] BYREF
std::string::size_type v24; // [xsp+70h] [xbp-40h]
v2 = a2;
result = (cocos2d::CCAction *)sub_1000045BC((_QWORD *)(a1 + 400), a2);
if ( ((unsigned __int8)result & 1) != 0 )
return result;
cocos2d::CCNode::stopAllActions(*(cocos2d::CCNode **)(*(_QWORD *)(a1 + 320) + 656LL));
std::string::operator=((std::string *)(a1 + 400), v2);
if ( SHIBYTE(v2->__r_.__value_.__r.__words[2]) < 0 )
{
sub_1000097D0(&__dst, v2->__r_.__value_.__l.__data_, v2->__r_.__value_.__l.__size_);
}
else
{
__dst = *(_OWORD *)&v2->__r_.__value_.__l.__data_;
v24 = v2->__r_.__value_.__r.__words[2];
}
SpriteAnimationManager::playSoundForAnimation(a1, (const char *)&__dst);
if ( SHIBYTE(v24) < 0 )
operator delete((void *)__dst);
v5 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(a1 + 392), v2);
if ( !*(_DWORD *)(v5 + 28) )
{
v6 = *(_DWORD *)(*(_QWORD *)(a1 + 320) + 680LL);
if ( SHIBYTE(v2->__r_.__value_.__r.__words[2]) < 0 )
{
sub_1000097D0(v21, v2->__r_.__value_.__l.__data_, v2->__r_.__value_.__l.__size_);
}
else
{
*(_OWORD *)v21 = *(_OWORD *)&v2->__r_.__value_.__l.__data_;
v22 = v2->__r_.__value_.__r.__words[2];
}
v9 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(*(_QWORD *)(a1 + 336), v21);
v10 = cocos2d::CCString::intValue(v9);
if ( SHIBYTE(v22) < 0 )
operator delete(v21[0]);
CCAnimatedSprite::willPlayAnimation(*(CCAnimatedSprite **)(a1 + 320));
CCAnimatedSprite::switchToMode(*(CCAnimatedSprite **)(a1 + 320), v10);
if ( v6 == *(_DWORD *)(*(_QWORD *)(a1 + 320) + 680LL) )
{
sub_100009900(v19, "spawn");
v11 = sub_1000045BC(v2, v19);
v12 = v11;
if ( v20 < 0 )
{
operator delete(v19[0]);
if ( !v12 )
{
LABEL_30:
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v5 + 72LL))(v5, 1);
return cocos2d::CCNode::runAction(
*(cocos2d::CCNode **)(*(_QWORD *)(a1 + 320) + 656LL),
(cocos2d::CCAction *)v5);
}
}
else if ( !v11 )
{
goto LABEL_30;
}
}
v13 = *(_QWORD *)(a1 + 392);
if ( SHIBYTE(v2->__r_.__value_.__r.__words[2]) < 0 )
v2 = (std::string *)v2->__r_.__value_.__r.__words[0];
v14 = (cocos2d::CCString *)sub_100268F4C("%s_first", (const char *)v2);
CString = (char *)cocos2d::CCString::getCString(v14);
sub_100009900(v19, CString);
v16 = cocos2d::CCDictionary::objectForKey_1(v13, v19);
if ( v20 < 0 )
operator delete(v19[0]);
if ( (unsigned int)(*(_DWORD *)(v16 + 28) - 1) <= 1 )
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(*(_QWORD *)(a1 + 320) + 656LL) + 1144LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 320) + 656LL),
v16);
goto LABEL_30;
}
if ( SHIBYTE(v2->__r_.__value_.__r.__words[2]) < 0 )
{
sub_1000097D0(__p, v2->__r_.__value_.__l.__data_, v2->__r_.__value_.__l.__size_);
}
else
{
*(_OWORD *)__p = *(_OWORD *)&v2->__r_.__value_.__l.__data_;
v18 = v2->__r_.__value_.__r.__words[2];
}
v7 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(*(_QWORD *)(a1 + 336), __p);
v8 = cocos2d::CCString::intValue(v7);
if ( SHIBYTE(v18) < 0 )
operator delete(__p[0]);
CCAnimatedSprite::willPlayAnimation(*(CCAnimatedSprite **)(a1 + 320));
CCAnimatedSprite::switchToMode(*(CCAnimatedSprite **)(a1 + 320), v8);
return (cocos2d::CCAction *)(*(__int64 (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(*(_QWORD *)(a1 + 320) + 656LL)
+ 1144LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 320) + 656LL),
v5);
}