//
// LevelPage::playStep3 from 0x79b490 to 0x79b5c8 (312 bytes)
//
// 3 xrefs:
// > ??> @ 0x53da8
// > LevelPage::playStep2 @ 0x79b3d4
// > ??> @ 0x122ab18
//
// 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 LevelPage::playStep3(LevelPage *a1)
{
LocalLevelManager *v2; // x0
GJGameLevel *m_level; // x21
void *v4; // x0
cocos2d::CCDirector *v5; // x20
cocos2d::CCScene *v6; // x0
cocos2d::CCTransitionFade *v7; // x0
unsigned int *v8; // x2
int v9; // w1
__int64 v10; // [xsp+40h] [xbp+40h] BYREF
GameManager::sharedState()->m_sceneEnum = 9;
v2 = LocalLevelManager::sharedState();
m_level = a1->m_level;
LocalLevelManager::getMainLevelString(&v10, v2, m_level->m_levelID.random - m_level->m_levelID.seed);
sub_D18EA8(&m_level->m_levelString, &v10);
v4 = (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(v4);
}
v5 = cocos2d::CCDirector::sharedDirector();
v6 = PlayLayer::scene(a1->m_level, 0, 0);
v7 = cocos2d::CCTransitionFade::create(0.5, v6);
cocos2d::CCDirector::replaceScene(v5, v7);
}