//
// cocos2d::CCTMXObjectGroup::objectNamed from 0xb3a200 to 0xb3a37c (380 bytes)
//
// 1 xrefs:
// > ??> @ 0xb20b0
//
// 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 *cocos2d::CCTMXObjectGroup::objectNamed(cocos2d::CCTMXObjectGroup *a1, const char *a2)
{
cocos2d::CCArray *v4; // x0
__int64 v5; // x0
unsigned int *v6; // x1
cocos2d::CCDictionary **v7; // x28
__int64 v8; // x0
char *v9; // x21
cocos2d::CCDictionary *v10; // x20
__int64 v11; // x2
char *v12; // x0
unsigned int *v14; // x1
int v15; // w4
__int64 v16; // [xsp+60h] [xbp+60h]
const char *v17; // [xsp+80h] [xbp+80h] BYREF
v4 = *(cocos2d::CCArray **)&a1[1].m_nTag;
if ( !v4 )
return nullptr;
if ( !(unsigned int)cocos2d::CCArray::count(v4) )
return nullptr;
v5 = *(_QWORD *)&a1[1].m_nTag;
if ( !v5 )
return nullptr;
v6 = *(unsigned int **)(v5 + 56);
if ( !*v6 )
return nullptr;
v7 = *((cocos2d::CCDictionary ***)v6 + 2);
v8 = 8LL * *v6 - 8;
v9 = (char *)v7 + v8;
if ( v7 > (cocos2d::CCDictionary **)((char *)v7 + v8) )
return nullptr;
v10 = *v7;
if ( !*v7 )
return nullptr;
while ( 1 )
{
sub_D153B8((int)&v17, "name");
v11 = cocos2d::CCDictionary::objectForKey((__int64)v10, &v17);
v12 = (char *)(v17 - 24);
if ( v17 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v14 = (unsigned int *)(v17 - 8);
do
v15 = __ldaxr(v14);
while ( __stlxr(v15 - 1, v14) );
}
else
{
v15 = *((_DWORD *)v17 - 2);
*((_DWORD *)v17 - 2) = v15 - 1;
}
if ( v15 <= 0 )
{
v16 = v11;
operator delete(v12);
v11 = v16;
}
}
if ( v11 && !(unsigned int)sub_D171E0((int)v11 + 56, (char *)a2) )
break;
if ( v9 >= (char *)++v7 )
{
v10 = *v7;
if ( *v7 )
continue;
}
return nullptr;
}
return v10;
}