//
// ObjectManager::loadCopiedSets from 0x14006ed80 to 0x14006f1ce (1102 bytes)
//
// 2 xrefs:
// > ObjectManager::init @ 0x14006e4c1
// > ??> @ 0x1406c612c
//
// 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=4
void ObjectManager::loadCopiedSets(ObjectManager *a1)
{
cocos2d::CCArray *v2; // r12
cocos2d::CCString *v3; // rsi
unsigned int i; // r14d
cocos2d::CCString *v5; // r15
const char *CString; // rax
size_t v7; // r8
cocos2d::CCDictionary *v8; // rdi
void *v9; // rcx
cocos2d::CCString *v10; // rbx
void *v11; // rcx
void *v12; // rcx
const char *v13; // rax
size_t v14; // r8
void *v15; // rcx
cocos2d::CCString *v16; // rax
cocos2d::CCDictionary *v17; // rbx
void *v18; // rcx
const char *v19; // rax
size_t v20; // r8
void *v21; // rcx
__int128 v22; // [rsp+20h] [rbp-59h] BYREF
__int64 v23; // [rsp+30h] [rbp-49h]
unsigned __int64 v24; // [rsp+38h] [rbp-41h]
__int128 v25; // [rsp+40h] [rbp-39h] BYREF
__int64 v26; // [rsp+50h] [rbp-29h]
unsigned __int64 v27; // [rsp+58h] [rbp-21h]
_QWORD v28[2]; // [rsp+60h] [rbp-19h] BYREF
__int64 v29; // [rsp+70h] [rbp-9h]
unsigned __int64 v30; // [rsp+78h] [rbp-1h]
__int128 v31; // [rsp+80h] [rbp+7h] BYREF
cocos2d::CCString *v32; // [rsp+90h] [rbp+17h]
unsigned __int64 v33; // [rsp+98h] [rbp+1Fh]
v2 = cocos2d::CCDictionary::allKeys(a1->m_objectDefinitions);
v3 = nullptr;
for ( i = 0; i < cocos2d::CCArray::count(v2); ++i )
{
v5 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v2, i);
CString = cocos2d::CCString::getCString(v5);
v31 = 0;
v32 = v3;
v33 = (unsigned __int64)v3;
v7 = -1;
do
++v7;
while ( CString[v7] );
sub_14003A930(&v31, CString, v7);
v8 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey(a1->m_objectDefinitions, &v31);
if ( v33 > 0xF )
{
v9 = (void *)v31;
if ( v33 + 1 >= 0x1000 )
{
v9 = *(void **)(v31 - 8);
if ( (unsigned __int64)(v31 - (_QWORD)v9 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v9);
}
v32 = v3;
v33 = 15;
LOBYTE(v31) = 0;
v22 = 0;
v23 = 4;
v24 = 15;
strcpy((char *)&v22, "copy");
v10 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v8, &v22);
if ( v24 > 0xF )
{
v11 = (void *)v22;
if ( v24 + 1 >= 0x1000 )
{
v11 = *(void **)(v22 - 8);
if ( (unsigned __int64)(v22 - (_QWORD)v11 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v11);
}
v23 = (__int64)v3;
v24 = 15;
LOBYTE(v22) = 0;
v28[1] = 26465;
v29 = 10;
v30 = 15;
v28[0] = 0x546563616C706572LL;
v3 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v8, v28);
if ( v30 > 0xF )
{
v12 = (void *)v28[0];
if ( v30 + 1 >= 0x1000 )
{
v12 = *(void **)(v28[0] - 8LL);
if ( (unsigned __int64)(v28[0] - (_QWORD)v12 - 8LL) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v12);
}
v29 = 0;
v30 = 15;
LOBYTE(v28[0]) = 0;
if ( v3 )
{
if ( v10 )
{
v13 = cocos2d::CCString::getCString(v10);
v25 = 0;
v26 = 0;
v27 = 0;
v14 = -1;
do
++v14;
while ( v13[v14] );
sub_14003A930(&v25, v13, v14);
v8 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey(a1->m_objectDefinitions, &v25);
if ( v27 > 0xF )
{
v15 = (void *)v25;
if ( v27 + 1 >= 0x1000 )
{
v15 = *(void **)(v25 - 8);
if ( (unsigned __int64)(v25 - (_QWORD)v15 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v15);
}
v26 = 0;
v27 = 15;
LOBYTE(v25) = 0;
}
v22 = 0;
v23 = 3;
v24 = 15;
LODWORD(v22) = 8026488;
v16 = (cocos2d::CCString *)cocos2d::CCString::create(&v22);
v17 = ObjectManager::replaceAllOccurencesOfString(v16, v3, v8);
if ( v24 > 0xF )
{
v18 = (void *)v22;
if ( v24 + 1 >= 0x1000 )
{
v18 = *(void **)(v22 - 8);
if ( (unsigned __int64)(v22 - (_QWORD)v18 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v18);
}
v3 = nullptr;
v23 = 0;
v24 = 15;
LOBYTE(v22) = 0;
v19 = cocos2d::CCString::getCString(v5);
v25 = 0;
v26 = 0;
v27 = 0;
v20 = -1;
do
++v20;
while ( v19[v20] );
sub_14003A930(&v25, v19, v20);
cocos2d::CCDictionary::setObject(a1->m_objectDefinitions, v17, &v25);
if ( v27 > 0xF )
{
v21 = (void *)v25;
if ( v27 + 1 >= 0x1000 )
{
v21 = *(void **)(v25 - 8);
if ( (unsigned __int64)(v25 - (_QWORD)v21 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v21);
}
}
}
}