//
// ObjectManager::setup from 0x14006e4f0 to 0x14006e827 (823 bytes)
//
// 2 xrefs:
// > LoadingLayer::loadAssets @ 0x14032f2d6
// > ??> @ 0x1406c6114
//
// 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=2
void ObjectManager::setup(ObjectManager *a1)
{
int v1; // esi
cocos2d::CCArray *v2; // rbx
unsigned int i; // r13d
cocos2d::CCString *v4; // rax
const char *CString; // rax
size_t v6; // r8
char *v7; // r14
int v8; // esi
void **v9; // rdx
size_t v10; // r8
void **v11; // rcx
char *v12; // r12
unsigned __int64 v13; // rbx
size_t v14; // r8
int v15; // eax
unsigned __int64 v16; // r15
void **v17; // rdi
void **v18; // rbx
char *v19; // r14
_BYTE *v20; // rax
bool v21; // cf
int v22; // ecx
char v23; // bl
char *v24; // rax
void **v25; // rdx
size_t v26; // r8
void **v27; // rax
bool v28; // [rsp+20h] [rbp-49h]
cocos2d::CCArray *v29; // [rsp+30h] [rbp-39h]
void *Buf[2]; // [rsp+38h] [rbp-31h] BYREF
unsigned __int64 v31; // [rsp+48h] [rbp-21h]
unsigned __int64 v32; // [rsp+50h] [rbp-19h]
__int128 v33; // [rsp+58h] [rbp-11h] BYREF
__int64 v34; // [rsp+68h] [rbp-1h]
__int64 v35; // [rsp+70h] [rbp+7h]
void *Buf1[2]; // [rsp+78h] [rbp+Fh] BYREF
unsigned __int64 v37; // [rsp+88h] [rbp+1Fh]
unsigned __int64 v38; // [rsp+90h] [rbp+27h]
v1 = 0;
v2 = cocos2d::CCDictionary::allKeys(a1->m_objectDefinitions);
v29 = v2;
for ( i = 0; i < cocos2d::CCArray::count(v29); ++i )
{
v4 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v2, i);
CString = cocos2d::CCString::getCString(v4);
*(_OWORD *)Buf = 0;
v31 = 0;
v32 = 0;
v6 = -1;
do
++v6;
while ( CString[v6] );
sub_14003A930(Buf, CString, v6);
v33 = 0;
v7 = (char *)sub_14003AA10(0x20u);
*(_QWORD *)&v33 = v7;
v34 = 16;
v35 = 31;
strcpy(v7, "GlobalAnimations");
v8 = v1 | 1;
v9 = Buf;
if ( v32 > 0xF )
v9 = (void **)Buf[0];
*(_OWORD *)Buf1 = 0;
v37 = 0;
v38 = 0;
v10 = -1;
do
++v10;
while ( *((_BYTE *)v9 + v10) );
sub_14003A930(Buf1, v9, v10);
v1 = v8 | 2;
v11 = Buf1;
v28 = v38 > 0xF;
v12 = (char *)Buf1[0];
if ( v38 > 0xF )
v11 = (void **)Buf1[0];
v13 = v37;
v14 = v37;
if ( v37 > 0x10 )
v14 = 16;
v15 = memcmp(v11, v7, v14);
v16 = v32;
v17 = (void **)Buf[0];
if ( v15 || v13 != 16 )
{
v18 = Buf;
if ( v32 > 0xF )
v18 = (void **)Buf[0];
if ( v31 < 3 )
goto LABEL_26;
v19 = (char *)v18 + v31;
v20 = memchr(v18, 120, v31 - 2);
if ( !v20 )
{
LABEL_25:
v7 = (char *)v33;
LABEL_26:
v23 = 1;
goto LABEL_27;
}
while ( 1 )
{
v21 = *v20 < 0x78u;
if ( *v20 == 120 && (v21 = v20[1] < 0x79u, v20[1] == 121) && (v21 = v20[2] < 0x7Au, v20[2] == 122) )
v22 = 0;
else
v22 = v21 ? -1 : 1;
if ( !v22 )
break;
v20 = memchr(v20 + 1, 120, v19 - 2 - (v20 + 1));
if ( !v20 )
goto LABEL_25;
}
v7 = (char *)v33;
if ( v20 - (_BYTE *)v18 == -1 )
goto LABEL_26;
}
v23 = 0;
LABEL_27:
if ( (v1 & 2) != 0 )
{
v1 &= ~2u;
if ( v28 )
{
v24 = v12;
if ( v38 + 1 >= 0x1000 )
{
v12 = *((char **)v12 - 1);
if ( (unsigned __int64)(v24 - v12 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v12);
}
}
if ( (v1 & 1) != 0 )
{
v1 &= ~1u;
j_j_free(v7);
}
if ( v23 )
{
v25 = Buf;
if ( v16 > 0xF )
v25 = v17;
v33 = 0;
v34 = 0;
v35 = 0;
v26 = -1;
do
++v26;
while ( *((_BYTE *)v25 + v26) );
sub_14003A930(&v33, v25, v26);
SpriteAnimationManager::createAnimations(&v33);
v16 = v32;
v17 = (void **)Buf[0];
}
if ( v16 > 0xF )
{
v27 = v17;
if ( v16 + 1 >= 0x1000 )
{
v17 = (void **)*(v17 - 1);
if ( (unsigned __int64)((char *)v27 - (char *)v17 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v17);
}
v2 = v29;
}
}