//
// AnimatedShopKeeper::playReactAnimation from 0x100327410 to 0x10032759b (395 bytes)
//
// 1 xrefs:
// > GJShopLayer::ccTouchBegan @ 0x1003273ad
//
// 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::playReactAnimation(AnimatedShopKeeper *a1)
{
double v1; // xmm0_8
int m_gruntIndex; // eax
int v3; // esi
cocos2d::CCString *v4; // rax
const char *CString; // r15
size_t v6; // rax
size_t v7; // r14
char *v8; // r12
size_t v9; // r13
FMODAudioEngine *v10; // r14
char v11; // r15
__int128 v12; // [rsp+0h] [rbp-70h] BYREF
void *__p; // [rsp+10h] [rbp-60h]
char v14; // [rsp+18h] [rbp-58h] BYREF
char v15[15]; // [rsp+19h] [rbp-57h] BYREF
void *v16; // [rsp+28h] [rbp-48h]
__int128 __dst; // [rsp+30h] [rbp-40h] BYREF
void *v18; // [rsp+40h] [rbp-30h]
if ( a1->m_reacting )
return;
m_gruntIndex = a1->m_gruntIndex;
v3 = 1;
if ( m_gruntIndex < 3 )
v3 = m_gruntIndex + 1;
a1->m_gruntIndex = v3;
v4 = (cocos2d::CCString *)sub_1007AB580("grunt0%i.ogg", v12);
CString = cocos2d::CCString::getCString(v4);
v6 = strlen(CString);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v1);
v7 = v6;
if ( v6 >= 0x17 )
{
v9 = 26;
if ( (v6 | 7) != 0x17 )
v9 = (v6 | 7) + 1;
v8 = (char *)operator new(v9);
v18 = v8;
*(_QWORD *)&__dst = v9 + 1;
*((_QWORD *)&__dst + 1) = v7;
}
else
{
LOBYTE(__dst) = 2 * v6;
v8 = (char *)&__dst + 1;
if ( !v6 )
goto LABEL_12;
}
memmove(v8, CString, v7);
LABEL_12:
v8[v7] = 0;
v10 = FMODAudioEngine::sharedEngine();
v11 = __dst & 1;
if ( (__dst & 1) != 0 )
{
sub_100006B70(&v12, v18, *((unsigned __int64 *)&__dst + 1), v1);
}
else
{
__p = v18;
v12 = __dst;
}
FMODAudioEngine::playEffect(v10, &v12, 1.0, 0.0, 0.64999998);
if ( (v12 & 1) != 0 )
operator delete(__p);
v14 = 14;
strcpy(v15, "react01");
CCAnimatedSprite::runAnimationForced(a1, &v14);
if ( (v14 & 1) != 0 )
operator delete(v16);
++a1->m_reactCount;
a1->m_reacting = 1;
if ( v11 )
operator delete(v18);
}