//
// GameLevelManager::getFolderName from 0x6f3fe0 to 0x6f4118 (312 bytes)
//
// 4 xrefs:
// > LevelBrowserLayer::getSearchTitle @ 0x6e8200
// > SetFolderPopup::valueChanged @ 0x8c51b4
// > SetFolderPopup::onSetFolderName @ 0x8d4060
// > ??> @ 0x38388
//
// 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 GameLevelManager::getFolderName@(
GameLevelManager *this@,
const char *a2@,
char a3@,
__int64 a4@)
{
cocos2d::CCDictionary *m_localLevelsFolders; // x21
cocos2d::CCString *v6; // x0
char *CString; // x0
cocos2d::CCString *v8; // x0
char *v9; // x0
char *v10; // x0
unsigned int *v12; // x2
int v13; // w1
std::string v14; // [xsp+40h] [xbp+40h] BYREF
m_localLevelsFolders = this->m_localLevelsFolders;
if ( !a3 )
m_localLevelsFolders = this->m_onlineFolders;
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", a2);
CString = (char *)cocos2d::CCString::getCString(v6);
sub_D153B8((int)&v14, CString);
v8 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(m_localLevelsFolders, &v14);
v9 = (char *)cocos2d::CCString::getCString(v8);
sub_D153B8(a4, v9);
v10 = (char *)v14.m_data.m_data - 24;
if ( (__int64 *)v14.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v12 = (unsigned int *)((char *)v14.m_data.m_data - 8);
do
v13 = __ldaxr(v12);
while ( __stlxr(v13 - 1, v12) );
}
else
{
v13 = *((_DWORD *)v14.m_data.m_data - 2);
*((_DWORD *)v14.m_data.m_data - 2) = v13 - 1;
}
if ( v13 <= 0 )
operator delete(v10);
}
return a4;
}