//
// cocos2d::CCComponentContainer::get from 0xb2f21c to 0xb2f31c (256 bytes)
//
// 2 xrefs:
// > ??> @ 0x61cc8
// > ??> @ 0x1219a30
//
// 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::CCComponent *cocos2d::CCComponentContainer::get(cocos2d::CCComponentContainer *a1, const char *a2)
{
cocos2d::CCDictionary *m_pComponents; // x21
const void *v3; // x0
cocos2d::CCComponent *v4; // x20
char *v5; // x0
unsigned int *v7; // x2
int v8; // w1
const char *v9; // [xsp+40h] [xbp+40h] BYREF
if ( !a2 )
return nullptr;
m_pComponents = a1->m_pComponents;
if ( !m_pComponents )
return nullptr;
sub_D153B8((int)&v9, (char *)a2);
v3 = (const void *)cocos2d::CCDictionary::objectForKey((__int64)m_pComponents, &v9);
if ( v3 )
v4 = (cocos2d::CCComponent *)_dynamic_cast(
v3,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCComponent,
0);
else
v4 = nullptr;
v5 = (char *)(v9 - 24);
if ( v9 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v9 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *((_DWORD *)v9 - 2);
*((_DWORD *)v9 - 2) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v5);
}
return v4;
}