//
// GJBaseGameLayer::playKeyframeAnimation from 0x140217bc0 to 0x140217e31 (625 bytes)
//
// 2 xrefs:
// > EffectGameObject::triggerObject @ 0x1404a7578
// > ??> @ 0x1406cd1e8
//
// 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
//
// Hidden C++ exception states: #wind=1
void GJBaseGameLayer::playKeyframeAnimation(
GJBaseGameLayer *a1,
KeyframeAnimTriggerObject *a2,
std::vector *const a3)
{
cocos2d::CCArray *Group; // rdi
__int64 v7; // r8
cocos2d::ccArray *data; // rdi
__int64 num; // rax
cocos2d::CCObject **arr; // rdi
cocos2d::CCObject **v11; // r15
cocos2d::CCObject *v12; // rsi
unsigned int m_uAutoReleaseCount; // edx
__int64 v14; // rax
cocos2d::CCArray *v15; // r14
GameObject *MainObject; // r9
int m_targetGroupID; // edx
char v18[16]; // [rsp+70h] [rbp-78h] BYREF
char v19[8]; // [rsp+80h] [rbp-68h] BYREF
void *v20; // [rsp+88h] [rbp-60h] BYREF
__int64 v21[3]; // [rsp+98h] [rbp-50h] BYREF
__int64 v22; // [rsp+B0h] [rbp-38h]
unsigned int v23; // [rsp+F8h] [rbp+10h] BYREF
Group = GJBaseGameLayer::getGroup(a1, a2->m_animationID);
v23 = 0;
sub_14005E660((__int64)v19, &v23, v7);
if ( Group )
{
data = Group->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
v11 = &arr[num - 1];
if ( arr <= v11 )
{
while ( 1 )
{
v12 = *arr;
if ( !*arr )
goto LABEL_17;
if ( v12[18].m_eObjType == 3032 )
break;
LABEL_16:
if ( ++arr > v11 )
goto LABEL_17;
}
m_uAutoReleaseCount = v12[33].m_uAutoReleaseCount;
v23 = m_uAutoReleaseCount;
v14 = *(_QWORD *)(v21[0]
+ 16
* (v22
& (0x100000001B3LL
* (((unsigned __int64)m_uAutoReleaseCount >> 24)
^ (0x100000001B3LL
* (BYTE2(m_uAutoReleaseCount)
^ (0x100000001B3LL
* ((0x100000001B3LL * ((unsigned __int8)m_uAutoReleaseCount ^ 0xCBF29CE484222325uLL))
^ BYTE1(m_uAutoReleaseCount))))))))
+ 8);
if ( (void *)v14 != v20 )
{
if ( m_uAutoReleaseCount == *(_DWORD *)(v14 + 16) )
goto LABEL_12;
while ( v14 != *(_QWORD *)(v21[0]
+ 16
* (v22
& (0x100000001B3LL
* (((unsigned __int64)m_uAutoReleaseCount >> 24)
^ (0x100000001B3LL
* (BYTE2(m_uAutoReleaseCount)
^ (0x100000001B3LL
* ((0x100000001B3LL
* ((unsigned __int8)m_uAutoReleaseCount ^ 0xCBF29CE484222325uLL))
^ BYTE1(m_uAutoReleaseCount))))))))) )
{
v14 = *(_QWORD *)(v14 + 8);
if ( m_uAutoReleaseCount == *(_DWORD *)(v14 + 16) )
goto LABEL_12;
}
}
v14 = 0;
LABEL_12:
if ( !v14 )
{
sub_140060D70((__int64)v19, (__int64)v18, (unsigned __int8 *)&v23);
v15 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(a1->m_keyframeGroups, (int)v23);
MainObject = GJBaseGameLayer::tryGetMainObject(a1, a2->m_centerGroupID);
m_targetGroupID = a2->m_targetGroupID;
if ( !m_targetGroupID )
m_targetGroupID = v12[26].m_uAutoReleaseCount;
GJEffectManager::createKeyframeCommand(
a1->m_effectManager,
m_targetGroupID,
v15,
MainObject,
a2->m_uniqueID,
a2->m_controlID,
0,
a2->m_positionXMod,
a2->m_positionYMod,
a2->m_rotationMod,
a2->m_scaleXMod,
a2->m_scaleYMod,
a2->m_timeMod,
a3);
}
goto LABEL_16;
}
}
}
LABEL_17:
sub_14005D100((__int64)v21);
sub_14005D870(&v20);
}