//
// ObjectManager::loadCopiedAnimations from 0x14007c2a0 to 0x14007c6f3 (1107 bytes)
//
// 2 xrefs:
// > ObjectManager::init @ 0x14007bf79
// > ??> @ 0x140911e04
//
// 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 11:25:53 +0000
//
// Hidden C++ exception states: #wind=3
unsigned int __fastcall ObjectManager::loadCopiedAnimations(__int64 a1)
{
cocos2d::CCArray *v2; // rbx
unsigned int v3; // r12d
unsigned int result; // eax
__m128i si128; // xmm6
__m128i v6; // xmm7
__m128i v7; // xmm8
cocos2d::CCString *v8; // rax
const char *CString; // rax
size_t v10; // r8
__int64 v11; // rbx
void *v12; // rcx
cocos2d::CCDictionary *v13; // r15
void *v14; // rcx
cocos2d::CCArray *v15; // r14
unsigned int i; // edi
cocos2d::CCString *v17; // rsi
const char *v18; // rax
size_t v19; // r8
__int64 v20; // rbx
void *v21; // rcx
cocos2d::CCString *v22; // rbx
void *v23; // rcx
const char *v24; // rax
__int64 v25; // rbx
const char *v26; // rax
size_t v27; // r8
void *v28; // rcx
cocos2d::CCArray *v29; // [rsp+38h] [rbp-69h]
__int128 v30; // [rsp+40h] [rbp-61h] BYREF
__m128i v31; // [rsp+50h] [rbp-51h]
__int128 v32; // [rsp+60h] [rbp-41h] BYREF
__m128i v33; // [rsp+70h] [rbp-31h]
_QWORD v34[2]; // [rsp+80h] [rbp-21h] BYREF
__m128i v35; // [rsp+90h] [rbp-11h]
v2 = cocos2d::CCDictionary::allKeys(*(cocos2d::CCDictionary **)(a1 + 320));
v29 = v2;
v3 = 0;
result = cocos2d::CCArray::count(v2);
if ( result )
{
si128 = _mm_load_si128((const __m128i *)&Size);
v6 = _mm_load_si128((const __m128i *)&xmmword_140836550);
v7 = _mm_load_si128((const __m128i *)&xmmword_1408365B0);
do
{
v8 = cocos2d::CCArray::objectAtIndex(v2, v3);
CString = cocos2d::CCString::getCString(v8);
v30 = 0;
v31 = 0;
v10 = -1;
do
++v10;
while ( CString[v10] );
sub_14003D230(&v30, CString, v10);
v11 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 320), &v30);
if ( v31.m128i_i64[1] > 0xFuLL )
{
v12 = (void *)v30;
if ( (unsigned __int64)(v31.m128i_i64[1] + 1) >= 0x1000 )
{
v12 = *(void **)(v30 - 8);
if ( (unsigned __int64)(v30 - (_QWORD)v12 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v12);
}
v31 = si128;
LOBYTE(v30) = 0;
v34[1] = 29550;
v35 = v7;
v34[0] = 0x6F6974616D696E61LL;
v13 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey(v11, v34);
if ( v35.m128i_i64[1] > 0xFuLL )
{
v14 = (void *)v34[0];
if ( (unsigned __int64)(v35.m128i_i64[1] + 1) >= 0x1000 )
{
v14 = *(void **)(v34[0] - 8LL);
if ( (unsigned __int64)(v34[0] - (_QWORD)v14 - 8LL) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v14);
}
v35 = si128;
LOBYTE(v34[0]) = 0;
if ( v13 )
{
v15 = cocos2d::CCDictionary::allKeys(v13);
for ( i = 0; i < cocos2d::CCArray::count(v15); ++i )
{
v17 = cocos2d::CCArray::objectAtIndex(v15, i);
v18 = cocos2d::CCString::getCString(v17);
v32 = 0;
v33 = 0;
v19 = -1;
do
++v19;
while ( v18[v19] );
sub_14003D230(&v32, v18, v19);
v20 = cocos2d::CCDictionary::objectForKey(v13, &v32);
if ( v33.m128i_i64[1] > 0xFuLL )
{
v21 = (void *)v32;
if ( (unsigned __int64)(v33.m128i_i64[1] + 1) >= 0x1000 )
{
v21 = *(void **)(v32 - 8);
if ( (unsigned __int64)(v32 - (_QWORD)v21 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v21);
}
v33 = si128;
LOBYTE(v32) = 0;
v30 = 0;
v31 = v6;
strcpy((char *)&v30, "copy");
v22 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v20, &v30);
if ( v31.m128i_i64[1] > 0xFuLL )
{
v23 = (void *)v30;
if ( (unsigned __int64)(v31.m128i_i64[1] + 1) >= 0x1000 )
{
v23 = *(void **)(v30 - 8);
if ( (unsigned __int64)(v30 - (_QWORD)v23 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v23);
}
v31 = si128;
LOBYTE(v30) = 0;
if ( v22 )
{
v24 = cocos2d::CCString::getCString(v22);
v25 = sub_14007C700(a1, v24);
v26 = cocos2d::CCString::getCString(v17);
v32 = 0;
v33 = 0;
v27 = -1;
do
++v27;
while ( v26[v27] );
sub_14003D230(&v32, v26, v27);
cocos2d::CCDictionary::setObject(v13, v25, &v32);
if ( v33.m128i_i64[1] > 0xFuLL )
{
v28 = (void *)v32;
if ( (unsigned __int64)(v33.m128i_i64[1] + 1) >= 0x1000 )
{
v28 = *(void **)(v32 - 8);
if ( (unsigned __int64)(v32 - (_QWORD)v28 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v28);
}
}
}
}
++v3;
v2 = v29;
result = cocos2d::CCArray::count(v29);
}
while ( v3 < result );
}
return result;
}