//
// GJBaseGameLayer::playKeyframeAnimation from 0x10012a2a0 to 0x10012a6a6 (1030 bytes)
//
// 1 xrefs:
// > EffectGameObject::triggerObject @ 0x1001ba2f5
//
// 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 GJBaseGameLayer::playKeyframeAnimation(
GJBaseGameLayer *a1,
KeyframeAnimTriggerObject *a2,
std::vector *const a3)
{
double v3; // xmm1_8
double v4; // xmm2_8
KeyframeAnimTriggerObject *v5; // r14
int m_animationID; // ecx
intptr_t v7; // r12
GJBaseGameLayer *v8; // r13
cocos2d::CCArray *v9; // rbx
__m128 m_positionXMod_low; // xmm0
cocos2d::ccArray *data; // rax
cocos2d::CCObject **arr; // r15
unsigned __int64 v13; // rax
cocos2d::CCObject *v14; // rbx
unsigned __int64 m_uID; // rcx
unsigned __int64 v16; // r9
unsigned __int64 v17; // rsi
__int64 **v18; // rax
__int64 *v19; // r8
unsigned __int64 v20; // rax
unsigned __int64 v21; // rax
KeyframeAnimTriggerObject *v22; // r12
GJBaseGameLayer *v23; // r14
intptr_t m_centerGroupID; // r13
cocos2d::CCDictionary *m_parentGroupsDict; // rdi
intptr_t v26; // rsi
GameObject *v27; // rax
cocos2d::CCArray *v28; // rax
cocos2d::CCObject *v29; // rax
cocos2d::CCDictionary *m_groupDict; // rdi
cocos2d::CCObject *v31; // rcx
cocos2d::CCArray *v32; // r13
int m_targetGroupID; // esi
_QWORD *v34; // rdi
_QWORD *v35; // rbx
void *v36; // rdi
cocos2d::CCArray *v37; // [rsp+18h] [rbp-78h]
unsigned __int64 v39; // [rsp+28h] [rbp-68h]
void *v40[2]; // [rsp+30h] [rbp-60h] BYREF
void *__p[2]; // [rsp+40h] [rbp-50h]
int v42; // [rsp+50h] [rbp-40h]
cocos2d::CCObject *v43; // [rsp+58h] [rbp-38h]
int v44[11]; // [rsp+64h] [rbp-2Ch] BYREF
v5 = a2;
m_animationID = 9999;
if ( a2->m_animationID < 9999 )
m_animationID = a2->m_animationID;
v7 = 0;
if ( m_animationID > 0 )
v7 = (unsigned int)m_animationID;
v8 = a1;
v9 = a1->m_groups.__begin_[v7];
if ( v9 )
{
m_positionXMod_low = 0;
*(_OWORD *)__p = 0;
*(_OWORD *)v40 = 0;
v42 = 1065353216;
}
else
{
v9 = (cocos2d::CCArray *)sub_10071F9E0(a1, a2);
cocos2d::CCDictionary::setObject(a1->m_groupDict, v9, v7);
a1->m_groups.__begin_[v7] = v9;
m_positionXMod_low = 0;
*(_OWORD *)__p = 0;
*(_OWORD *)v40 = 0;
v42 = 1065353216;
if ( !v9 )
return;
}
data = v9->data;
if ( data->num )
{
arr = data->arr;
v13 = (unsigned __int64)&arr[data->num - 1];
v39 = v13;
do
{
v14 = *arr;
if ( !*arr )
break;
if ( v14[18].m_uReference == 3032 )
{
m_uID = (int)v14[33].m_uID;
v44[0] = v14[33].m_uID;
if ( !v40[1] )
goto LABEL_42;
v16 = (0x101010101010101LL
* (((((unsigned __int64)v40[1] - (((unsigned __int64)v40[1] >> 1) & 0x5555555555555555LL))
& 0x3333333333333333LL)
+ ((((unsigned __int64)v40[1] - (((unsigned __int64)v40[1] >> 1) & 0x5555555555555555LL)) >> 2)
& 0x3333333333333333LL)
+ (((((unsigned __int64)v40[1] - (((unsigned __int64)v40[1] >> 1) & 0x5555555555555555LL))
& 0x3333333333333333LL)
+ ((((unsigned __int64)v40[1] - (((unsigned __int64)v40[1] >> 1) & 0x5555555555555555LL)) >> 2)
& 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v16 > 1 )
{
v17 = m_uID;
if ( v40[1] <= (void *)m_uID )
{
if ( !(((unsigned __int64)v40[1] | m_uID) >> 32) )
{
v17 = (unsigned int)m_uID % LODWORD(v40[1]);
v18 = *((__int64 ***)v40[0] + v17);
if ( !v18 )
goto LABEL_42;
goto LABEL_23;
}
v17 = m_uID % (unsigned __int64)v40[1];
}
v18 = *((__int64 ***)v40[0] + v17);
if ( !v18 )
goto LABEL_42;
goto LABEL_23;
}
v17 = m_uID & ((unsigned __int64)v40[1] - 1);
v18 = *((__int64 ***)v40[0] + v17);
if ( !v18 )
{
LABEL_42:
v22 = v5;
sub_100054F50((float *)v40, v44, v44, m_positionXMod_low, v3, v4);
v23 = v8;
v37 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v8->m_keyframeGroups, v44[0]);
m_centerGroupID = v22->m_centerGroupID;
if ( m_centerGroupID <= 0 )
goto LABEL_50;
m_parentGroupsDict = v23->m_parentGroupsDict;
v26 = v22->m_centerGroupID;
v27 = (GameObject *)cocos2d::CCDictionary::objectForKey(m_parentGroupsDict, v26);
if ( v27 )
goto LABEL_51;
if ( (unsigned int)m_centerGroupID >= 0x270F )
m_centerGroupID = 9999;
v28 = v23->m_groups.__begin_[m_centerGroupID];
if ( !v28 )
{
v29 = (cocos2d::CCObject *)sub_10071F9E0(m_parentGroupsDict, v26);
m_groupDict = v23->m_groupDict;
v43 = v29;
cocos2d::CCDictionary::setObject(m_groupDict, v29, m_centerGroupID);
v31 = v43;
v23->m_groups.__begin_[m_centerGroupID] = (cocos2d::CCArray *)v43;
v28 = (cocos2d::CCArray *)v31;
if ( !v31 )
goto LABEL_50;
}
v32 = v28;
if ( (unsigned int)sub_100720070(v28) == 1 )
v27 = (GameObject *)sub_1007200C0(v32, 0);
else
LABEL_50:
v27 = nullptr;
LABEL_51:
m_targetGroupID = v22->m_targetGroupID;
v8 = v23;
if ( !m_targetGroupID )
m_targetGroupID = v14[26].m_uID;
m_positionXMod_low = (__m128)LODWORD(v22->m_positionXMod);
*(_QWORD *)&v3 = LODWORD(v22->m_positionYMod);
*(_QWORD *)&v4 = LODWORD(v22->m_rotationMod);
GJEffectManager::createKeyframeCommand(
v23->m_effectManager,
m_targetGroupID,
v37,
v27,
v22->m_uniqueID,
v22->m_controlID,
0,
m_positionXMod_low.f32[0],
*(float *)&v3,
*(float *)&v4,
v22->m_scaleXMod,
v22->m_scaleYMod,
v22->m_timeMod,
a3);
v5 = v22;
LABEL_11:
v13 = v39;
goto LABEL_12;
}
LABEL_23:
v19 = *v18;
if ( !*v18 )
goto LABEL_42;
if ( (unsigned int)v16 < 2 )
{
while ( 1 )
{
v21 = v19[1];
if ( v21 == m_uID )
{
if ( *((_DWORD *)v19 + 4) == (_DWORD)m_uID )
goto LABEL_11;
}
else if ( (((unsigned __int64)v40[1] - 1) & v21) != v17 )
{
goto LABEL_42;
}
v19 = (__int64 *)*v19;
if ( !v19 )
goto LABEL_42;
}
}
while ( 2 )
{
v20 = v19[1];
if ( v20 == m_uID )
{
if ( *((_DWORD *)v19 + 4) == (_DWORD)m_uID )
goto LABEL_11;
}
else if ( (void *)v20 < v40[1] )
{
LABEL_32:
if ( v20 != v17 )
goto LABEL_42;
}
else
{
if ( ((unsigned __int64)v40[1] | v20) >> 32 )
{
v20 %= (unsigned __int64)v40[1];
goto LABEL_32;
}
if ( (unsigned int)v20 % LODWORD(v40[1]) != v17 )
goto LABEL_42;
}
v19 = (__int64 *)*v19;
if ( !v19 )
goto LABEL_42;
continue;
}
}
LABEL_12:
++arr;
}
while ( (unsigned __int64)arr <= v13 );
v34 = __p[0];
if ( __p[0] )
{
do
{
v35 = (_QWORD *)*v34;
operator delete(v34);
v34 = v35;
}
while ( v35 );
}
}
v36 = v40[0];
v40[0] = nullptr;
if ( v36 )
operator delete(v36);
}