//
// SpriteAnimationManager::executeAnimation from 0x140086ee0 to 0x1400873f9 (1305 bytes)
//
// 2 xrefs:
// > SpriteAnimationManager::runAnimation @ 0x140086e8a
// > ??> @ 0x140912554
//
// This function is hookable on this platform (idp: pc, 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 11:25:57 +0000
//
// Hidden C++ exception states: #wind=5
void __fastcall SpriteAnimationManager::executeAnimation(__int64 *a1, void **a2)
{
void **v4; // rbx
void *v5; // rdx
const char *v6; // rbx
cocos2d::CCString *v7; // rdi
size_t v8; // r15
const char *v9; // rdx
cocos2d::CCString *v10; // rax
const char *CString; // rax
size_t v12; // r8
cocos2d::CCString *v13; // rax
float v14; // xmm6_4
void *v15; // rcx
const char *v16; // rax
size_t v17; // r8
struct cocos2d::CCAction *v18; // r12
int v19; // esi
cocos2d::CCString *v20; // rax
int v21; // edi
void **v22; // rbx
unsigned __int64 v23; // rbx
char v24; // si
const void *v25; // rcx
unsigned __int64 v26; // rdi
size_t v27; // r8
char v28; // di
void *v29; // rcx
const char *v30; // rdx
cocos2d::CCString *v31; // rax
const char *v32; // rax
__int64 v33; // rbx
void *v34; // r8
int v35; // eax
cocos2d::CCString *v36; // rax
int v37; // edi
void **v38; // rbx
__int64 v39; // [rsp+30h] [rbp-59h]
__int64 v40; // [rsp+30h] [rbp-59h]
_BYTE v41[32]; // [rsp+48h] [rbp-41h] BYREF
void **v42; // [rsp+68h] [rbp-21h]
void *Block[2]; // [rsp+70h] [rbp-19h] BYREF
__m128i si128; // [rsp+80h] [rbp-9h]
v42 = a2;
v4 = (void **)(a1 + 51);
if ( !sub_14003D160(a1 + 51, a2) )
goto LABEL_52;
cocos2d::CCNode::stopAllActions(*(cocos2d::CCNode **)(a1[40] + 672));
if ( v4 != a2 )
{
v5 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v5 = *a2;
sub_1400405A0(v4, v5, (size_t)a2[2]);
}
v6 = (const char *)sub_14003F4F0((__int64)v41, (__int64)a2);
v7 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(a1[43], v6);
v8 = -1;
if ( v7 )
{
v9 = v6;
if ( *((_QWORD *)v6 + 3) > 0xFu )
v9 = *(const char **)v6;
v10 = cocos2d::CCString::createWithFormat("%s%s", v9, (const char *)&dword_140714180);
CString = cocos2d::CCString::getCString(v10);
*(_OWORD *)Block = 0;
si128 = 0;
v12 = -1;
do
++v12;
while ( CString[v12] );
sub_14003D230(Block, CString, v12);
v13 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(a1[43], Block);
v14 = cocos2d::CCString::floatValue(v13);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v15 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v15 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v15 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v15);
}
if ( v14 == 0.0 )
{
v16 = cocos2d::CCString::getCString(v7);
*(_OWORD *)Block = 0;
si128 = 0u;
v17 = -1;
do
++v17;
while ( v16[v17] );
sub_14003D230(Block, v16, v17);
sub_14003D310((__int64)Block);
}
}
sub_14003D310((__int64)v6);
v18 = (struct cocos2d::CCAction *)cocos2d::CCDictionary::objectForKey(a1[50], a2);
if ( *((_DWORD *)v18 + 7) )
{
v40 = sub_14003F4F0((__int64)v41, (__int64)a2);
v36 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(a1[42], v40);
v37 = cocos2d::CCString::intValue(v36);
sub_14003D310(v40);
v38 = (void **)a1[40];
cocos2d::CCNode::stopActionByTag((cocos2d::CCNode *)v38, 1);
sub_1400405A0(v38 + 79, &byte_1406ED6E0, 0);
CCAnimatedSprite::switchToMode(a1[40], v37);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCAction *))(**(_QWORD **)(a1[40] + 672) + 1008LL))(
*(_QWORD *)(a1[40] + 672),
v18);
goto LABEL_52;
}
v19 = *(_DWORD *)(a1[40] + 696);
v39 = sub_14003F4F0((__int64)v41, (__int64)a2);
v20 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(a1[42], v39);
v21 = cocos2d::CCString::intValue(v20);
sub_14003D310(v39);
v22 = (void **)a1[40];
cocos2d::CCNode::stopActionByTag((cocos2d::CCNode *)v22, 1);
sub_1400405A0(v22 + 79, &byte_1406ED6E0, 0);
CCAnimatedSprite::switchToMode(a1[40], v21);
if ( v19 == *(_DWORD *)(a1[40] + 696) )
{
*(_OWORD *)Block = 0;
si128.m128i_i64[0] = 5;
v23 = 15;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "spawn");
v24 = 1;
v25 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v25 = *a2;
v26 = (unsigned __int64)a2[2];
v27 = v26;
if ( v26 > 5 )
v27 = 5;
if ( memcmp(v25, Block, v27) || v26 != 5 )
{
v28 = 0;
goto LABEL_31;
}
}
else
{
v23 = si128.m128i_u64[1];
v24 = 0;
}
v28 = 1;
LABEL_31:
if ( (v24 & 1) != 0 && v23 > 0xF )
{
v29 = Block[0];
if ( v23 + 1 >= 0x1000 )
{
v29 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v29 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v29);
}
if ( v28 )
{
v30 = (const char *)a2;
if ( (unsigned __int64)a2[3] > 0xF )
v30 = (const char *)*a2;
v31 = cocos2d::CCString::createWithFormat("%s_first", v30);
v32 = cocos2d::CCString::getCString(v31);
*(_OWORD *)Block = 0;
si128 = 0;
do
++v8;
while ( v32[v8] );
sub_14003D230(Block, v32, v8);
v33 = cocos2d::CCDictionary::objectForKey(a1[50], Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v34 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v34 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v34 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v34);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
v35 = *(_DWORD *)(v33 + 28);
if ( v35 == 2 || v35 == 1 )
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1[40] + 672) + 1008LL))(*(_QWORD *)(a1[40] + 672), v33);
}
(*(void (__fastcall **)(struct cocos2d::CCAction *, __int64))(*(_QWORD *)v18 + 64LL))(v18, 1);
cocos2d::CCNode::runAction(*(cocos2d::CCNode **)(a1[40] + 672), v18);
LABEL_52:
sub_14003D310((__int64)a2);
}