//
// cocos2d::CCDictionary::valueForKey from 0xacfc04 to 0xacfcf0 (236 bytes)
//
// 4 xrefs:
// > GameManager::recountUserStats @ 0x5fa018
// > GameLevelManager::accountIDForUserID @ 0x6f1610
// > GameLevelManager::userIDForAccountID @ 0x6f162c
// > ??> @ 0xa5450
//
// 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
//
const cocos2d::CCString *cocos2d::CCDictionary::valueForKey(cocos2d::CCDictionary *a1, intptr_t a2)
{
cocos2d::CCObject *v2; // x0
const cocos2d::CCString *v3; // x20
const std::string *v5; // x1
void *v6; // x0
unsigned int *v7; // x2
int v8; // w1
__int64 v9; // [xsp+30h] [xbp+30h] BYREF
v2 = cocos2d::CCDictionary::objectForKey(a1, a2);
if ( !v2
|| (v3 = (const cocos2d::CCString *)_dynamic_cast(
v2,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCString,
0)) == nullptr )
{
sub_D153B8((int)&v9, &byte_F288A0);
v3 = (const cocos2d::CCString *)cocos2d::CCString::create((cocos2d::CCString *)&v9, v5);
v6 = (void *)(v9 - 24);
if ( (__int64 *)(v9 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v9 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *(_DWORD *)(v9 - 8);
*(_DWORD *)(v9 - 8) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v6);
}
}
return v3;
}