//
// LevelLeaderboard::setupLeaderboard from 0x14042a960 to 0x14042ab25 (453 bytes)
//
// 5 xrefs:
// > LevelLeaderboard::init @ 0x140429548
// > LevelLeaderboard::loadScores @ 0x140429f06
// > LevelLeaderboard::onUpdate @ 0x14042a509
// > LevelLeaderboard::loadLeaderboardFinished @ 0x14042a7ff
// > ??> @ 0x140926ac8
//
// This function is hookable on this platform (idp: pc, 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 11:32:12 +0000
//
__int64 __fastcall LevelLeaderboard::setupLeaderboard(__int64 a1, cocos2d::CCObject *a2)
{
int v2; // ebp
__int64 v5; // rax
struct cocos2d::CCObject *v6; // rbx
cocos2d::CCTouchDispatcher *v7; // rax
__int64 v8; // rax
int v9; // edx
__int64 v10; // rax
unsigned int *v11; // rcx
__int64 v12; // rax
__int64 *v13; // rcx
__int64 *i; // r8
__int64 v15; // rdx
int v16; // eax
cocos2d::CCLayerColor *v17; // rax
__int64 v18; // rcx
__int64 *v19; // rdi
__int64 v20; // rbx
__int64 v21; // rax
__int64 v23; // [rsp+20h] [rbp-48h]
int v24; // [rsp+30h] [rbp-38h]
float v25; // [rsp+70h] [rbp+8h] BYREF
float v26; // [rsp+74h] [rbp+Ch]
char v27; // [rsp+78h] [rbp+10h] BYREF
v2 = 0;
if ( *(_QWORD *)(a1 + 704) )
{
v5 = cocos2d::CCDirector::sharedDirector(a1);
v6 = *(struct cocos2d::CCObject **)(a1 + 704);
v7 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 144LL))(v5);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v7, v6);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 704) + 528LL))(*(_QWORD *)(a1 + 704));
*(_QWORD *)(a1 + 704) = 0;
}
v8 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v8, &v25);
if ( a2 )
{
v10 = *(_QWORD *)(a1 + 680);
if ( v10 )
{
if ( *(_DWORD *)(v10 + 972) == 5 && *(_DWORD *)(a1 + 688) != 3 )
{
v11 = *((unsigned int **)a2 + 7);
v12 = *v11;
if ( (_DWORD)v12 )
{
v13 = *((__int64 **)v11 + 2);
for ( i = &v13[v12 - 1]; v13 <= i; *(_DWORD *)(v15 + 940) = *(_DWORD *)(a1 + 692) )
{
v15 = *v13;
if ( !*v13 )
break;
++v13;
*(_DWORD *)(v15 + 936) = 1;
}
}
}
}
v16 = 18;
if ( *(_DWORD *)(a1 + 688) == 3 )
v16 = 31;
v24 = 0;
v2 = (unsigned int)CustomListView::create(a2, 0, 220.0, 340.0, v23, v16);
}
v17 = GJCommentListLayer::create(v2, v9, -12684609, 340.0, 1130102784, 1, v24);
v18 = *(_QWORD *)(a1 + 584);
*(_QWORD *)(a1 + 704) = v17;
(*(void (__fastcall **)(__int64, cocos2d::CCLayerColor *))(*(_QWORD *)v18 + 464LL))(v18, v17);
v19 = *(__int64 **)(a1 + 704);
v20 = *v19;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v27,
(float)(v25 - 340.0) * 0.5,
(float)((float)(v26 - 220.0) * 0.5) - 10.0);
return (*(__int64 (__fastcall **)(__int64 *, __int64))(v20 + 184))(v19, v21);
}