//
// ProfilePage::onMyLevels from 0x1007be240 to 0x1007be3fa (442 bytes)
//
// 1 xrefs:
// > ProfilePage::loadPageFromUserInfo @ 0x1007bbfc1
//
// 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 __fastcall ProfilePage::onMyLevels(ProfilePage *a1, cocos2d::CCObject *a2)
{
double v2; // xmm0_8
bool m_ownProfile; // r15
cocos2d::CCDirector *v4; // rax
cocos2d::CCDirector *v5; // r14
GJSearchObject *v6; // rax
cocos2d::CCScene *v7; // rax
cocos2d::CCTransitionFade *v8; // rax
cocos2d::CCScene *m_pSceneReference; // r15
cocos2d::CCDirector *v10; // r14
cocos2d::CCDirector *v11; // rax
GameLevelManager *v12; // rax
int v13; // r14d
cocos2d::CCDirector *v14; // rbx
char *v15; // rax
const char *CString; // r15
size_t v17; // rax
size_t v18; // r14
char *v19; // r12
size_t v20; // r13
char *v21; // rax
cocos2d::CCScene *v22; // rax
cocos2d::CCTransitionFade *v23; // rax
_QWORD __dst[2]; // [rsp+0h] [rbp-40h] BYREF
void *__p; // [rsp+10h] [rbp-30h]
m_ownProfile = a1->m_ownProfile;
v4 = cocos2d::CCDirector::sharedDirector();
v5 = v4;
if ( m_ownProfile )
{
v6 = GJSearchObject::create_2(MyLevels);
v7 = LevelBrowserLayer::scene(v6);
v8 = cocos2d::CCTransitionFade::create_1(0.5, v7);
cocos2d::CCDirector::pushScene(v5, v8);
return;
}
if ( !v4->m_bIsTransitioning )
{
if ( cocos2d::CCDirector::sharedDirector()->m_pRunningScene->m_eObjType != MenuLayerObjectType )
{
m_pSceneReference = cocos2d::CCDirector::sharedDirector()->m_pSceneReference;
v10 = cocos2d::CCDirector::sharedDirector();
v11 = cocos2d::CCDirector::sharedDirector();
if ( m_pSceneReference )
cocos2d::CCDirector::popToSceneInStack(v10, v11->m_pSceneReference);
else
v10->m_pSceneReference = v11->m_pRunningScene;
}
v12 = GameLevelManager::sharedState();
v13 = GameLevelManager::userIDForAccountID(v12, a1->m_accountID);
v14 = cocos2d::CCDirector::sharedDirector();
v15 = sub_1007AB580("%i", v13);
CString = cocos2d::CCString::getCString((cocos2d::CCString *)v15);
v17 = strlen(CString);
if ( v17 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v2);
v18 = v17;
if ( v17 >= 0x17 )
{
v20 = 26;
if ( (v17 | 7) != 0x17 )
v20 = (v17 | 7) + 1;
v19 = (char *)operator new(v20);
__p = v19;
__dst[0] = v20 + 1;
__dst[1] = v18;
}
else
{
LOBYTE(__dst[0]) = 2 * v17;
v19 = (char *)__dst + 1;
if ( !v17 )
{
LABEL_16:
v19[v18] = 0;
v21 = GJSearchObject::create_1(5, (__int64)__dst, v2);
v22 = LevelBrowserLayer::scene((GJSearchObject *)v21);
v23 = cocos2d::CCTransitionFade::create_1(0.5, v22);
cocos2d::CCDirector::pushScene(v14, v23);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
return;
}
}
memmove(v19, CString, v18);
goto LABEL_16;
}
}