//
// GameLevelManager::getFolderName from 0x14014aa10 to 0x14014ab35 (293 bytes)
//
// 4 xrefs:
// > SetFolderPopup::valueChanged @ 0x14029c925
// > SetFolderPopup::onSetFolderName @ 0x14029cb39
// > LevelBrowserLayer::getSearchTitle @ 0x1402cbd4f
// > ??> @ 0x1406ca758
//
// 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
//
// Hidden C++ exception states: #wind=1
_QWORD *__fastcall GameLevelManager::getFolderName(__int64 a1, _QWORD *a2, int a3, char a4)
{
__int64 v5; // rsi
cocos2d::CCString *v6; // rax
const char *CString; // rax
size_t v8; // rbx
size_t v9; // r8
cocos2d::CCString *v10; // rax
const char *v11; // rax
void *v12; // rcx
void *Block[2]; // [rsp+30h] [rbp-48h] BYREF
__int128 v15; // [rsp+40h] [rbp-38h]
if ( a4 )
v5 = *(_QWORD *)(a1 + 432);
else
v5 = *(_QWORD *)(a1 + 424);
v6 = cocos2d::CCString::createWithFormat("%i", a3);
CString = cocos2d::CCString::getCString(v6);
*(_OWORD *)Block = 0;
v15 = 0;
v8 = -1;
v9 = -1;
do
++v9;
while ( CString[v9] );
sub_14003A930(Block, CString, v9);
v10 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v5, Block);
v11 = cocos2d::CCString::getCString(v10);
*(_OWORD *)a2 = 0;
a2[2] = 0;
a2[3] = 0;
do
++v8;
while ( v11[v8] );
sub_14003A930(a2, v11, v8);
if ( *((_QWORD *)&v15 + 1) > 0xFu )
{
v12 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v15 + 1) + 1LL) >= 0x1000 )
{
v12 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v12 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v12);
}
return a2;
}