//
// GameLevelManager::getFolderName from 0x140224660 to 0x140224797 (311 bytes)
//
// 4 xrefs:
// > SetFolderPopup::valueChanged @ 0x1403a6abb
// > SetFolderPopup::onSetFolderName @ 0x1403a6cea
// > LevelBrowserLayer::getSearchTitle @ 0x1403e58e5
// > ??> @ 0x14091bcf8
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:28:25 +0000
//
// Hidden C++ exception states: #wind=1
_QWORD *__fastcall GameLevelManager::getFolderName(__int64 a1, _QWORD *a2, unsigned int a3, unsigned __int8 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+40h] [rbp-48h] BYREF
__int128 v15; // [rsp+50h] [rbp-38h]
v5 = *(_QWORD *)(a1 + 8LL * a4 + 928);
v6 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, a3);
CString = cocos2d::CCString::getCString(v6);
*(_OWORD *)Block = 0;
v15 = 0;
v8 = -1;
v9 = -1;
do
++v9;
while ( CString[v9] );
sub_14003D230(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_14003D230(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 )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v12);
}
return a2;
}