//
// LevelLeaderboard::setupLeaderboard from 0xa81d9c to 0xa81f98 (508 bytes)
//
// 5 xrefs:
// > LevelLeaderboard::onUpdate @ 0xa82054
// > LevelLeaderboard::loadScores @ 0xa8224c
// > LevelLeaderboard::loadLeaderboardFinished @ 0xa82870
// > LevelLeaderboard::init @ 0xa835ec
// > ??> @ 0xf17b0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:00:32 +0000
//
__int64 __fastcall LevelLeaderboard::setupLeaderboard(LevelLeaderboard *this, cocos2d::CCArray *a2)
{
cocos2d::CCDirector *v4; // x0
__int64 v5; // x0
cocos2d::CCTouchDispatcher *v6; // x0
cocos2d::CCDirector *v7; // x0
GJGameLevel *v8; // x0
unsigned int *v9; // x0
unsigned int v10; // w1
__int64 *v11; // x0
int v12; // w3
__int64 *v13; // x4
__int64 v14; // x1
__int64 v15; // x0
cocos2d::CCLayerColor *v16; // x0
__int64 v17; // x19
void (__fastcall *v18)(__int64, _BYTE *); // x21
__int64 v20; // [xsp+58h] [xbp+58h] BYREF
_BYTE v21[8]; // [xsp+60h] [xbp+60h] BYREF
v4 = *((cocos2d::CCDirector **)this + 88);
if ( v4 )
{
v5 = cocos2d::CCDirector::sharedDirector(v4);
v6 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 160LL))(v5);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v6, *((cocos2d::CCObject **)this + 88));
v4 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 88) + 536LL))(*((_QWORD *)this + 88));
*((_QWORD *)this + 88) = 0;
}
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v4);
cocos2d::CCDirector::getWinSize(&v20, v7);
if ( !a2 )
{
v15 = 0;
goto LABEL_15;
}
v8 = *((GJGameLevel **)this + 85);
if ( !v8 || !GJGameLevel::isPlatformer(v8) )
goto LABEL_12;
if ( *((_DWORD *)this + 172) == 3 )
goto LABEL_16;
v9 = *((unsigned int **)a2 + 7);
v10 = *v9;
if ( *v9 )
{
v11 = *((__int64 **)v9 + 2);
v12 = 18;
v13 = &v11[v10 - 1];
if ( v11 > v13 )
goto LABEL_14;
v14 = *v11;
if ( !*v11 )
goto LABEL_14;
do
{
*(_DWORD *)(v14 + 832) = 1;
++v11;
*(_DWORD *)(v14 + 836) = *((_DWORD *)this + 173);
if ( v13 < v11 )
break;
v14 = *v11;
}
while ( *v11 );
LABEL_12:
if ( *((_DWORD *)this + 172) != 3 )
goto LABEL_13;
LABEL_16:
v12 = 31;
goto LABEL_14;
}
LABEL_13:
v12 = 18;
LABEL_14:
v15 = CustomListView::create(a2, 0, 0, v12, 220.0, 340.0, 0.0);
LABEL_15:
v16 = GJCommentListLayer::create(v15, (__int64)"Scores", -12684609, 1u, 340.0, 220.0);
*((_QWORD *)this + 88) = v16;
(*(void (__fastcall **)(_QWORD, cocos2d::CCLayerColor *))(**((_QWORD **)this + 73) + 456LL))(
*((_QWORD *)this + 73),
v16);
v17 = *((_QWORD *)this + 88);
v18 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v17 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v21,
(float)(*(float *)&v20 - 340.0) * 0.5,
(float)((float)(*((float *)&v20 + 1) - 220.0) * 0.5) + -10.0);
v18(v17, v21);
return _stack_chk_guard;
}