//
// EditorUI::createNewKeyframeAnim from 0x1000165d0 to 0x100016852 (642 bytes)
//
// 1 xrefs:
// > SetGroupIDLayer::onAnim @ 0x10030134c
//
// 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:18:54 +0000
//
__int64 __fastcall EditorUI::createNewKeyframeAnim(_QWORD *a1)
{
_QWORD *v1; // rbx
__int64 result; // rax
__int64 v3; // rax
__int64 v4; // r14
__int64 v5; // rsi
__int64 v6; // rdi
unsigned int *v7; // rax
__int64 v8; // rcx
_QWORD *v9; // rax
__int64 v10; // rcx
__int64 v11; // r14
__int64 v12; // rsi
__int64 v13; // rax
unsigned int *v14; // rax
__int64 v15; // rdi
unsigned __int64 v16; // r12
__int64 NewKeyframeAnim; // rax
__int64 v18; // rax
__int64 v19; // r14
__int64 Object; // rax
__int64 v21; // r14
char v22[8]; // [rsp+8h] [rbp-68h] BYREF
char v23[8]; // [rsp+10h] [rbp-60h] BYREF
__int64 v24; // [rsp+18h] [rbp-58h]
unsigned __int64 v25; // [rsp+20h] [rbp-50h]
_QWORD *v26; // [rsp+28h] [rbp-48h]
unsigned __int64 v27; // [rsp+30h] [rbp-40h]
__int64 v28; // [rsp+38h] [rbp-38h]
unsigned int v29; // [rsp+44h] [rbp-2Ch]
v1 = a1;
if ( a1[187] || (a1 = (_QWORD *)a1[112], result = sub_1007FEF90(a1), (_DWORD)result) )
{
v3 = sub_1007FE900(a1);
v4 = v3;
v5 = v1[187];
if ( v5 )
sub_1007FEBF0(v3, v5);
else
sub_1007FEF70(v3, v1[112]);
EditorUI::deselectAll(v1);
v6 = v1[180];
(*(void (__fastcall **)(__int64, double))(*(_QWORD *)v6 + 1192LL))(v6, 0.0);
v28 = sub_1007FE900(v6);
if ( v4 )
{
v7 = *(unsigned int **)(v4 + 56);
v8 = *v7;
if ( *v7 )
{
v9 = *((_QWORD **)v7 + 2);
v27 = (unsigned __int64)&v9[v8 - 1];
do
{
v10 = *v9;
if ( !*v9 )
break;
v26 = v9;
if ( *(_BYTE *)(v10 + 1170) == 1 )
{
v11 = v10;
v12 = *(unsigned int *)(v10 + 916);
v13 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(v1[180] + 3696LL));
if ( v13 )
{
v14 = *(unsigned int **)(v13 + 56);
if ( *v14 )
{
v15 = v11;
v16 = *((_QWORD *)v14 + 2);
v25 = v16 + 8LL * *v14 - 8;
v24 = v11;
do
{
if ( !*(_QWORD *)v16 )
break;
v29 = *(_DWORD *)(*(_QWORD *)v16 + 56LL);
v18 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v15 + 192LL))(v15, v12);
sub_1002782D0(v23, v18);
v19 = v1[180];
sub_1002782D0(v22, v23);
Object = LevelEditorLayer::createObject(v19, 3032, v22, 0);
v21 = Object;
if ( Object && (*(float *)(Object + 1312) != 1.0 || *(float *)(Object + 1316) != 1.0) )
{
GameObject::updateCustomScaleX(Object);
GameObject::updateCustomScaleY(v21, *(float *)(v21 + 1316));
}
LevelEditorLayer::removeSpecial(v1[180], v21);
sub_1007FEBF0(v28, v21);
EffectGameObject::setTargetID(v21, v29);
KeyframeGameObject::updateShadowObjects(v21, v1[180], v1);
NewKeyframeAnim = GJBaseGameLayer::createNewKeyframeAnim(v1[180]);
*(_DWORD *)(v21 + 1856) = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)NewKeyframeAnim + 64LL))(NewKeyframeAnim);
*(_DWORD *)(v21 + 1860) = 0;
v12 = v21;
LevelEditorLayer::addSpecial(v1[180], v21);
v16 += 8LL;
v15 = v24;
}
while ( v16 <= v25 );
}
}
}
v9 = v26 + 1;
}
while ( (unsigned __int64)(v26 + 1) <= v27 );
}
}
return EditorUI::selectObjects(v1, v28, 0);
}
return result;
}