//
// ObjectManager::getGlobalAnimCopy from 0x58bad8 to 0x58bc88 (432 bytes)
//
// 2 xrefs:
// > ObjectManager::loadCopiedAnimations @ 0x58be34
// > ??> @ 0x3d7a0
//
// 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
//
cocos2d::CCDictionary *ObjectManager::getGlobalAnimCopy(ObjectManager *a1, const char *a2)
{
cocos2d::CCDictionary *m_objectDefinitions; // x19
cocos2d::CCDictionary *v4; // x23
char *v5; // x0
cocos2d::CCDictionary *v6; // x20
char *v7; // x0
unsigned int *v9; // x1
int v10; // w2
unsigned int *v11; // x1
int v12; // w2
std::string v13; // [xsp+50h] [xbp+50h] BYREF
m_objectDefinitions = a1->m_objectDefinitions;
sub_D153B8((int)&v13, "GlobalAnimations");
v4 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey(m_objectDefinitions, &v13);
v5 = (char *)v13.m_data.m_data - 24;
if ( (__int64 *)v13.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v9 = (unsigned int *)((char *)v13.m_data.m_data - 8);
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *((_DWORD *)v13.m_data.m_data - 2);
*((_DWORD *)v13.m_data.m_data - 2) = v10 - 1;
}
if ( v10 <= 0 )
operator delete(v5);
}
sub_D153B8((int)&v13, (char *)a2);
v6 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey(v4, &v13);
v7 = (char *)v13.m_data.m_data - 24;
if ( (__int64 *)v13.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v11 = (unsigned int *)((char *)v13.m_data.m_data - 8);
do
v12 = __ldaxr(v11);
while ( __stlxr(v12 - 1, v11) );
}
else
{
v12 = *((_DWORD *)v13.m_data.m_data - 2);
*((_DWORD *)v13.m_data.m_data - 2) = v12 - 1;
}
if ( v12 <= 0 )
operator delete(v7);
}
return v6;
}