//
// LevelLeaderboard::getSpriteButton from 0x931644 to 0x931800 (444 bytes)
//
// 4 xrefs:
// > LevelLeaderboard::init @ 0x932944
// > LevelLeaderboard::init @ 0x9329e4
// > LevelLeaderboard::init @ 0x933278
// > ??> @ 0x4fa10
//
// 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
//
CCMenuItemSpriteExtra *__fastcall LevelLeaderboard::getSpriteButton(
void (__cdecl *a1)(cocos2d::CCObject *),
const char **a2,
size_t a3,
float a4,
__int64 a5,
__int64 a6,
const cocos2d::CCPoint *a7,
unsigned int a8)
{
cocos2d::CCString *v14; // x0
char *CString; // x0
ButtonSprite *v16; // x0
ButtonSprite *v17; // x20
CCMenuItemSpriteExtra *v18; // x20
void *v19; // x0
unsigned int *v21; // x2
int v22; // w1
bool v23[8]; // [xsp+68h] [xbp+68h] BYREF
cocos2d::CCPoint v24; // [xsp+70h] [xbp+70h] BYREF
cocos2d::SEL_MenuHandler v25; // 0:x2.16
cocos2d::CCPoint v26; // 0:s0.4,4:s1.4
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"GJ_button_%02d.png",
(const char *)a8);
CString = (char *)cocos2d::CCString::getCString(v14);
sub_D153B8((int)v23, CString);
v16 = (ButtonSprite *)cocos2d::CCSprite::createWithSpriteFrameName(*a2);
v17 = (ButtonSprite *)ButtonSprite::create(
v16,
(cocos2d::CCSprite *)&qword_20,
0,
1,
32.0,
1.0,
*(cocos2d::CCSprite **)v23,
nullptr);
cocos2d::CCPoint::CCPoint(&v24, a7);
ButtonSprite::updateSpriteOffset(v17, v26);
v25.ptr = a1;
v25.adj = a3;
v18 = CCMenuItemSpriteExtra::create(v17, nullptr, v25);
v18->setScale(v18, a4);
v18->m_baseScale = a4;
if ( a6 )
(*(void (__fastcall **)(__int64, CCMenuItemSpriteExtra *))(*(_QWORD *)a6 + 440LL))(a6, v18);
v19 = (void *)(*(_QWORD *)v23 - 24LL);
if ( (__int64 *)(*(_QWORD *)v23 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v21 = (unsigned int *)(*(_QWORD *)v23 - 8LL);
do
v22 = __ldaxr(v21);
while ( __stlxr(v22 - 1, v21) );
}
else
{
v22 = *(_DWORD *)(*(_QWORD *)v23 - 8LL);
*(_DWORD *)(*(_QWORD *)v23 - 8LL) = v22 - 1;
}
if ( v22 <= 0 )
operator delete(v19);
}
return v18;
}