//
// LevelInfoLayer::onSetFolder from 0x6d5ab4 to 0x6d5be4 (304 bytes)
//
// 3 xrefs:
// > ??> @ 0x7d2c8
// > LevelInfoLayer::init @ 0x6dc74c
// > ??> @ 0x122c370
//
// 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 LevelInfoLayer::onSetFolder(LevelInfoLayer *a1, cocos2d::CCObject *a2)
{
GJGameLevel *m_level; // x0
unsigned int m_levelFolder; // w22
__int64 *v5; // x21
void *v6; // x0
__int64 v7; // x1
unsigned int *v8; // x2
int v9; // w1
__int64 v10; // [xsp+40h] [xbp+40h] BYREF
std::string v11; // 0:x3.8
m_level = a1->m_level;
if ( m_level && !a1->m_isBusy )
{
m_levelFolder = m_level->m_levelFolder;
sub_D153B8((int)&v10, "Set Folder");
v5 = (__int64 *)SetFolderPopup::create((SetFolderPopup *)m_levelFolder, 0, (bool)&v10, v11);
v6 = (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(v6);
}
v7 = *v5;
v5[84] = (__int64)&a1->SetIDPopupDelegate;
(*(void (__fastcall **)(__int64 *))(v7 + 1288))(v5);
}
}