//
// GameManager::stringForCustomObject from 0x5ed18c to 0x5ed2d0 (324 bytes)
//
// 3 xrefs:
// > EditorUI::createCustomItems @ 0x6975cc
// > EditorUI::onCreateObject @ 0x6bffa4
// > ??> @ 0x51cf0
//
// 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
//
__int64 __usercall GameManager::stringForCustomObject@(
GameManager *this@,
const char *a2@,
__int64 a3@)
{
cocos2d::CCDictionary *m_customObjectDict; // x22
cocos2d::CCString *v5; // x0
char *CString; // x0
cocos2d::CCString *v7; // x22
char *v8; // x0
char *v9; // x0
unsigned int *v11; // x2
int v12; // w1
std::string v13; // [xsp+40h] [xbp+40h] BYREF
m_customObjectDict = this->m_customObjectDict;
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", a2);
CString = (char *)cocos2d::CCString::getCString(v5);
sub_D153B8((int)&v13, CString);
v7 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(m_customObjectDict, &v13);
v8 = (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(v8);
}
if ( v7 )
{
v9 = (char *)cocos2d::CCString::getCString(v7);
sub_D153B8(a3, v9);
}
else
{
sub_D153B8(a3, &byte_F288A0);
}
return a3;
}