//
// GJBaseGameLayer::playKeyframeAnimation from 0x100108250 to 0x1001085d6 (902 bytes)
//
// 1 xrefs:
// > EffectGameObject::triggerObject @ 0x10019a97e
//
// 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 12:21:32 +0000
//
void __fastcall GJBaseGameLayer::playKeyframeAnimation(_QWORD *a1, _DWORD *a2, __int64 a3)
{
int v4; // ecx
__int64 v5; // r13
__int64 v6; // r12
__m128 v7; // xmm0
unsigned int *v8; // rax
__int64 v9; // rcx
_QWORD *v10; // rbx
unsigned __int64 v11; // r10
_DWORD *v12; // r13
unsigned __int64 v13; // rcx
unsigned __int64 v14; // r9
unsigned __int64 v15; // rsi
__int64 **v16; // rax
__int64 *v17; // r8
unsigned __int64 v18; // rax
unsigned __int64 v19; // rax
int v20; // r12d
int MainObject; // eax
int v22; // esi
_QWORD *v23; // rdi
_QWORD *v24; // rbx
void *v25; // rdi
unsigned __int64 v27; // [rsp+18h] [rbp-68h]
void *v28[2]; // [rsp+20h] [rbp-60h] BYREF
void *__p[2]; // [rsp+30h] [rbp-50h]
int v30; // [rsp+40h] [rbp-40h]
_QWORD *v31; // [rsp+48h] [rbp-38h]
int v32[11]; // [rsp+54h] [rbp-2Ch] BYREF
v4 = 9999;
if ( (int)a2[413] < 9999 )
v4 = a2[413];
v5 = 0;
if ( v4 > 0 )
v5 = (unsigned int)v4;
v6 = *(_QWORD *)(a1[452] + 8 * v5);
if ( v6 )
{
v7 = 0;
*(_OWORD *)__p = 0;
*(_OWORD *)v28 = 0;
v30 = 1065353216;
}
else
{
v6 = sub_1007FE900(a1);
cocos2d::CCDictionary::setObject_1(a1[449], v6, v5);
*(_QWORD *)(a1[452] + 8 * v5) = v6;
v7 = 0;
*(_OWORD *)__p = 0;
*(_OWORD *)v28 = 0;
v30 = 1065353216;
if ( !v6 )
return;
}
v8 = *(unsigned int **)(v6 + 56);
v9 = *v8;
if ( *v8 )
{
v31 = a1;
v10 = *((_QWORD **)v8 + 2);
v11 = (unsigned __int64)&v10[v9 - 1];
v27 = v11;
do
{
v12 = (_DWORD *)*v10;
if ( !*v10 )
break;
if ( v12[257] == 3032 )
{
v13 = (int)v12[464];
v32[0] = v12[464];
if ( !v28[1] )
goto LABEL_41;
v14 = (0x101010101010101LL
* (((((unsigned __int64)v28[1] - (((unsigned __int64)v28[1] >> 1) & 0x5555555555555555LL))
& 0x3333333333333333LL)
+ ((((unsigned __int64)v28[1] - (((unsigned __int64)v28[1] >> 1) & 0x5555555555555555LL)) >> 2)
& 0x3333333333333333LL)
+ (((((unsigned __int64)v28[1] - (((unsigned __int64)v28[1] >> 1) & 0x5555555555555555LL))
& 0x3333333333333333LL)
+ ((((unsigned __int64)v28[1] - (((unsigned __int64)v28[1] >> 1) & 0x5555555555555555LL)) >> 2)
& 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v14 <= 1 )
{
v15 = v13 & ((unsigned __int64)v28[1] - 1);
v16 = *((__int64 ***)v28[0] + v15);
if ( !v16 )
goto LABEL_41;
LABEL_22:
v17 = *v16;
if ( *v16 )
{
if ( (unsigned int)v14 < 2 )
{
while ( 1 )
{
v19 = v17[1];
if ( v19 == v13 )
{
if ( *((_DWORD *)v17 + 4) == (_DWORD)v13 )
goto LABEL_11;
}
else if ( (((unsigned __int64)v28[1] - 1) & v19) != v15 )
{
goto LABEL_41;
}
v17 = (__int64 *)*v17;
if ( !v17 )
goto LABEL_41;
}
}
while ( 1 )
{
v18 = v17[1];
if ( v18 == v13 )
{
if ( *((_DWORD *)v17 + 4) == (_DWORD)v13 )
goto LABEL_11;
goto LABEL_26;
}
if ( (void *)v18 < v28[1] )
goto LABEL_31;
if ( ((unsigned __int64)v28[1] | v18) >> 32 )
break;
if ( (unsigned int)v18 % LODWORD(v28[1]) != v15 )
goto LABEL_41;
LABEL_26:
v17 = (__int64 *)*v17;
if ( !v17 )
goto LABEL_41;
}
v18 %= (unsigned __int64)v28[1];
LABEL_31:
if ( v18 != v15 )
goto LABEL_41;
goto LABEL_26;
}
LABEL_41:
sub_10001B800((float *)v28, v32, v32, v7);
v20 = cocos2d::CCDictionary::objectForKey_1(a1[1659]);
MainObject = GJBaseGameLayer::tryGetMainObject(a1);
v22 = a2[366];
if ( !v22 )
v22 = v12[366];
v7 = (__m128)(unsigned int)a2[461];
GJEffectManager::createKeyframeCommand(v31[269], v22, v20, MainObject, a2[229], a2[418], 0, a3);
v11 = v27;
goto LABEL_11;
}
v15 = v13;
if ( v28[1] <= (void *)v13 )
{
if ( !(((unsigned __int64)v28[1] | v13) >> 32) )
{
v15 = (unsigned int)v13 % LODWORD(v28[1]);
v16 = *((__int64 ***)v28[0] + v15);
if ( v16 )
goto LABEL_22;
goto LABEL_41;
}
v15 = v13 % (unsigned __int64)v28[1];
}
v16 = *((__int64 ***)v28[0] + v15);
if ( v16 )
goto LABEL_22;
goto LABEL_41;
}
LABEL_11:
++v10;
}
while ( (unsigned __int64)v10 <= v11 );
v23 = __p[0];
if ( __p[0] )
{
do
{
v24 = (_QWORD *)*v23;
operator delete(v23);
v23 = v24;
}
while ( v24 );
}
}
v25 = v28[0];
v28[0] = nullptr;
if ( v25 )
operator delete(v25);
}