//
// CreatorLayer::onLeaderboards from 0x14009d720 to 0x14009d907 (487 bytes)
//
// 2 xrefs:
// > CreatorLayer::init @ 0x14009c4ac
// > ??> @ 0x1406c7590
//
// 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
//
// Hidden C++ exception states: #wind=3
void CreatorLayer::onLeaderboards(CreatorLayer *a1, cocos2d::CCObject *a2)
{
__int64 v2; // rdi
__int64 v3; // rbx
LeaderboardStat v4; // ebx
LeaderboardType v5; // edi
struct cocos2d::CCScene *v6; // r14
__int64 v7; // rdx
__int64 v8; // rcx
LeaderboardsLayer *v9; // rsi
struct cocos2d::CCTransitionFade *v10; // rbx
__int64 v11; // rcx
cocos2d::CCDirector *v12; // rax
void *v13; // [rsp+50h] [rbp+18h]
void *v14; // [rsp+50h] [rbp+18h]
v2 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v13 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280(v13);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v2 = qword_1406C2EC0;
}
v3 = v2;
if ( !v2 )
{
v14 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280(v14);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v2 = qword_1406C2EC0;
}
v4 = *(_DWORD *)(v3 + 708);
v5 = *(_DWORD *)(v2 + 704);
v6 = (struct cocos2d::CCScene *)cocos2d::CCScene::create(a1, a2);
*(_QWORD *)(cocos2d::CCApplication::sharedApplication(v8, v7) + 224) = v6;
v9 = (LeaderboardsLayer *)operator new(0x200u);
cocos2d::CCLayer::CCLayer(v9);
v9->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (LeaderboardsLayer_vtbl *)&LeaderboardsLayer::`vftable';
v9->cocos2d::CCLayer::cocos2d::CCTouchDelegate::__vftable = (cocos2d::CCTouchDelegate_vtbl *)&LeaderboardsLayer::`vftable';
v9->cocos2d::CCLayer::cocos2d::CCAccelerometerDelegate::__vftable = (cocos2d::CCAccelerometerDelegate_vtbl *)&LeaderboardsLayer::`vftable';
v9->cocos2d::CCLayer::cocos2d::CCKeypadDelegate::__vftable = (cocos2d::CCKeypadDelegate_vtbl *)&LeaderboardsLayer::`vftable';
v9->cocos2d::CCLayer::cocos2d::CCKeyboardDelegate::__vftable = (cocos2d::CCKeyboardDelegate_vtbl *)&LeaderboardsLayer::`vftable';
v9->cocos2d::CCLayer::cocos2d::CCMouseDelegate::__vftable = (cocos2d::CCMouseDelegate_vtbl *)&LeaderboardsLayer::`vftable';
v9->LeaderboardManagerDelegate::__vftable = (LeaderboardManagerDelegate_vtbl *)&LeaderboardsLayer::`vftable';
v9->FLAlertLayerProtocol::__vftable = (FLAlertLayerProtocol_vtbl *)&LeaderboardsLayer::`vftable';
v9->m_list = nullptr;
v9->m_userScores = nullptr;
*(_QWORD *)&v9->m_type = 0;
v9->m_topBtn = nullptr;
v9->m_globalBtn = nullptr;
v9->m_creatorsBtn = nullptr;
v9->m_friendsBtn = nullptr;
v9->m_circle = nullptr;
v9->m_noInternet = nullptr;
v9->m_modeButtons = nullptr;
if ( LeaderboardsLayer::init(v9, v5, v4) )
{
cocos2d::CCObject::autorelease(v9);
}
else
{
((void (__fastcall *)(LeaderboardsLayer *, __int64))v9->~LeaderboardsLayer)(v9, 1);
v9 = nullptr;
}
v6->addChild_1(v6, v9);
v10 = cocos2d::CCTransitionFade::create(0.5, v6);
v12 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v11);
cocos2d::CCDirector::pushScene(v12, v10);
}