//
// LevelBrowserLayer::onGoToFolder from 0x6e6e80 to 0x6e6fcc (332 bytes)
//
// 3 xrefs:
// > ??> @ 0x556b0
// > LevelBrowserLayer::init @ 0x6eb7b0
// > ??> @ 0x122ac00
//
// 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
//
void LevelBrowserLayer::onGoToFolder(LevelBrowserLayer *a1, cocos2d::CCObject *a2)
{
GJSearchObject *m_searchObject; // x0
unsigned int m_folder; // w23
_BOOL4 v5; // w22
_QWORD *v6; // x20
void *v7; // x0
unsigned int *v8; // x2
int v9; // w1
__int64 v10; // [xsp+50h] [xbp+50h] BYREF
std::string v11; // 0:x3.8
m_searchObject = a1->m_searchObject;
if ( m_searchObject )
{
m_folder = m_searchObject->m_folder;
v5 = m_searchObject->m_searchType == MyLevels;
sub_D153B8((int)&v10, "Go to Folder");
v6 = (_QWORD *)SetFolderPopup::create((SetFolderPopup *)m_folder, v5, (bool)&v10, v11);
v7 = (void *)(v10 - 24);
if ( (__int64 *)(v10 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v10 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *(_DWORD *)(v10 - 8);
*(_DWORD *)(v10 - 8) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v7);
}
(*(void (__fastcall **)(_QWORD *, __int64))(*v6 + 72LL))(v6, 4);
v6[84] = &a1->SetIDPopupDelegate;
(*(void (__fastcall **)(_QWORD *))(*v6 + 1288LL))(v6);
}
}