//
// SpriteAnimationManager::queueAnimation from 0x1400874d0 to 0x1400875a8 (216 bytes)
//
// 3 xrefs:
// > SpriteAnimationManager::runAnimation @ 0x140086e72
// > SpriteAnimationManager::runAnimation @ 0x140086ea4
// > ??> @ 0x14091256c
//
// 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=1
void __fastcall SpriteAnimationManager::queueAnimation(__int64 a1, const void **a2)
{
__int64 v4; // rax
int Prio; // ebp
const void **v6; // rdi
_BYTE *v7; // rdx
size_t v8; // r8
void *v9; // rdx
__int128 v10; // [rsp+28h] [rbp-50h] BYREF
__int64 v11; // [rsp+38h] [rbp-40h]
__int64 v12; // [rsp+40h] [rbp-38h]
const void **v13; // [rsp+48h] [rbp-30h]
v13 = a2;
v4 = sub_14003F4F0((__int64)&v10, (__int64)a2);
Prio = SpriteAnimationManager::getPrio(a1, v4);
v6 = (const void **)(a1 + 352);
v7 = (_BYTE *)(a1 + 352);
if ( *(_QWORD *)(a1 + 376) > 0xFu )
v7 = *v6;
v10 = 0;
v11 = 0;
v12 = 0;
v8 = -1;
do
++v8;
while ( v7[v8] );
sub_14003D230(&v10, v7, v8);
if ( Prio <= (int)SpriteAnimationManager::getPrio(a1, &v10) && v6 != a2 )
{
v9 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v9 = (void *)*a2;
sub_1400405A0((void **)(a1 + 352), v9, (size_t)a2[2]);
}
sub_14003D310((__int64)a2);
}