//
// AnimatedShopKeeper::animationFinished from 0x10014e69c to 0x10014ea24 (904 bytes)
//
// 1 xrefs:
// > ??> @ 0x100799a88
//
// 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
//
void __fastcall AnimatedShopKeeper::animationFinished(AnimatedShopKeeper *a1, const char *a2)
{
int *p_m_idleInt1; // x22
_BOOL4 v5; // w21
ShopType m_type; // w21
int v7; // w21
void **v8; // x8
unsigned int v9; // w20
float v10; // s8
void *v11; // x0
void *v12[2]; // [xsp+8h] [xbp-D8h] BYREF
char v13; // [xsp+1Fh] [xbp-C1h]
void *__p[2]; // [xsp+20h] [xbp-C0h] BYREF
char v15; // [xsp+37h] [xbp-A9h]
_QWORD v16[2]; // [xsp+38h] [xbp-A8h] BYREF
char v17; // [xsp+4Fh] [xbp-91h]
_QWORD v18[2]; // [xsp+50h] [xbp-90h] BYREF
char v19; // [xsp+67h] [xbp-79h]
_QWORD v20[2]; // [xsp+68h] [xbp-78h] BYREF
char v21; // [xsp+7Fh] [xbp-61h]
void *v22[2]; // [xsp+80h] [xbp-60h] BYREF
char v23; // [xsp+97h] [xbp-49h]
void *v24[2]; // [xsp+98h] [xbp-48h] BYREF
char v25; // [xsp+AFh] [xbp-31h]
p_m_idleInt1 = &a1->m_idleInt1;
*(int32x2_t *)&a1->m_idleInt1 = vadd_s32(*(int32x2_t *)&a1->m_idleInt1, (int32x2_t)-1LL);
sub_100009900(v24, (char *)a2);
sub_100009900(v22, "react01");
v5 = sub_1000045BC(v24, v22);
if ( v23 < 0 )
operator delete(v22[0]);
if ( v25 < 0 )
{
operator delete(v24[0]);
if ( !v5 )
goto LABEL_6;
goto LABEL_5;
}
if ( v5 )
LABEL_5:
a1->m_reacting = 0;
LABEL_6:
sub_100009900(v24, (char *)a2);
sub_100009900(v22, "idle03");
if ( sub_1000045BC(v24, v22) || a1->m_idleInt2 > 0 )
{
if ( v23 < 0 )
operator delete(v22[0]);
if ( v25 < 0 )
operator delete(v24[0]);
}
else
{
m_type = a1->m_type;
if ( v23 < 0 )
operator delete(v22[0]);
if ( v25 < 0 )
operator delete(v24[0]);
if ( m_type != Diamond )
{
a1->m_looking = 0;
a1->m_idleInt2 = (int)(float)((float)(vcvts_n_f32_s32(rand(), 0x1Fu) * 5.0) + 10.0);
sub_100009900(v20, "idle03");
CCAnimatedSprite::runAnimationForced(a1, v20);
if ( (v21 & 0x80000000) == 0 )
return;
v11 = (void *)v20[0];
LABEL_49:
operator delete(v11);
return;
}
}
sub_100009900(v24, (char *)a2);
sub_100009900(v22, "idle00");
if ( sub_1000045BC(v24, v22) )
{
v7 = *p_m_idleInt1;
if ( v23 < 0 )
operator delete(v22[0]);
if ( v25 < 0 )
operator delete(v24[0]);
if ( v7 <= 0 )
{
if ( vcvts_n_f32_s32(rand(), 0x1Fu) <= 0.9 || a1->m_type == Diamond )
{
sub_100009900(v16, "idle02");
CCAnimatedSprite::runAnimationForced(a1, v16);
if ( v17 < 0 )
{
v8 = (void **)v16;
LABEL_54:
operator delete(*v8);
}
}
else
{
sub_100009900(v18, "idle01");
CCAnimatedSprite::runAnimationForced(a1, v18);
if ( v19 < 0 )
{
v8 = (void **)v18;
goto LABEL_54;
}
}
*p_m_idleInt1 = (int)(float)((float)(vcvts_n_f32_s32(rand(), 0x1Fu) * 3.0) + 2.0);
return;
}
}
else
{
if ( v23 < 0 )
operator delete(v22[0]);
if ( v25 < 0 )
operator delete(v24[0]);
}
sub_100009900(v24, (char *)a2);
sub_100009900(v22, "idle03");
if ( !sub_1000045BC(v24, v22) || a1->m_looking )
{
if ( v23 < 0 )
operator delete(v22[0]);
if ( v25 < 0 )
operator delete(v24[0]);
LABEL_47:
sub_100009900(v12, "idle00");
CCAnimatedSprite::runAnimationForced(a1, v12);
if ( (v13 & 0x80000000) == 0 )
return;
v11 = v12[0];
goto LABEL_49;
}
v9 = rand();
if ( v23 < 0 )
operator delete(v22[0]);
v10 = vcvts_n_f32_s32(v9, 0x1Fu);
if ( v25 < 0 )
operator delete(v24[0]);
if ( v10 <= 0.6 )
goto LABEL_47;
sub_100009900(__p, "idle03");
CCAnimatedSprite::runAnimationForced(a1, __p);
if ( v15 < 0 )
operator delete(__p[0]);
a1->m_looking = 1;
}