//
// GameLevelManager::setFolderName from 0x6f4118 to 0x6f4248 (304 bytes)
//
// 2 xrefs:
// > SetFolderPopup::setTextPopupClosed @ 0x8c4c0c
// > ??> @ 0x538e0
//
// 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 __fastcall GameLevelManager::setFolderName(__int64 a1, const std::string *a2, cocos2d::CCString *a3, char a4)
{
__int64 v4; // x21
cocos2d::CCObject *v5; // x22
cocos2d::CCString *v6; // x0
char *CString; // x0
void *v8; // x0
unsigned int *v10; // x2
int v11; // w1
__int64 v13; // [xsp+50h] [xbp+50h] BYREF
v4 = *(_QWORD *)(a1 + 464);
if ( !a4 )
LODWORD(v4) = *(_QWORD *)(a1 + 456);
v5 = (cocos2d::CCObject *)cocos2d::CCString::create(a3, a2);
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)a2);
CString = (char *)cocos2d::CCString::getCString(v6);
sub_D153B8((int)&v13, CString);
cocos2d::CCDictionary::setObject(v4, v5);
v8 = (void *)(v13 - 24);
if ( (__int64 *)(v13 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v10 = (unsigned int *)(v13 - 8);
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
}
else
{
v11 = *(_DWORD *)(v13 - 8);
*(_DWORD *)(v13 - 8) = v11 - 1;
}
if ( v11 <= 0 )
operator delete(v8);
}
return _stack_chk_guard;
}