//
// LevelLeaderboard::getSpriteButton from 0x1003c80f0 to 0x1003c829c (428 bytes)
//
// 3 xrefs:
// > LevelLeaderboard::init @ 0x1003c7570
// > LevelLeaderboard::init @ 0x1003c7639
// > LevelLeaderboard::init @ 0x1003c77e6
//
// 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 12:29:35 +0000
//
float *__fastcall LevelLeaderboard::getSpriteButton(
__int64 a1,
__int64 a2,
__int64 a3,
__int64 a4,
__int64 a5,
_QWORD *a6,
double a7)
{
__int64 v8; // rax
const char *CString; // r12
size_t v10; // rax
size_t v11; // r15
char *v12; // r13
__int64 v13; // r14
size_t v14; // rbx
int v15; // eax
char *v16; // r8
char *v17; // r14
float *v18; // r14
char v20; // [rsp+0h] [rbp-80h]
__int64 v21; // [rsp+8h] [rbp-78h] BYREF
_QWORD *v22; // [rsp+10h] [rbp-70h]
__int64 v23; // [rsp+18h] [rbp-68h]
__int64 v24; // [rsp+20h] [rbp-60h]
__int64 v25; // [rsp+28h] [rbp-58h]
__int64 v26; // [rsp+30h] [rbp-50h]
_QWORD __dst[2]; // [rsp+38h] [rbp-48h] BYREF
void *__p; // [rsp+48h] [rbp-38h]
float v29; // [rsp+54h] [rbp-2Ch]
v22 = a6;
v29 = *(float *)&a7;
v23 = a4;
v24 = a3;
v25 = a1;
v8 = sub_10088E820("GJ_button_%02d.png", v20);
CString = (const char *)cocos2d::CCString::getCString(v8);
v10 = strlen(CString);
if ( v10 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v11 = v10;
if ( v10 >= 0x17 )
{
v26 = a5;
v14 = 26;
if ( (v10 | 7) != 0x17 )
v14 = (v10 | 7) + 1;
v12 = (char *)operator new(v14);
__p = v12;
__dst[0] = v14 + 1;
a5 = v26;
__dst[1] = v11;
LABEL_9:
memmove(v12, CString, v11);
v12[v11] = 0;
if ( (*(_BYTE *)a2 & 1) == 0 )
goto LABEL_5;
goto LABEL_10;
}
LOBYTE(__dst[0]) = 2 * v10;
v12 = (char *)__dst + 1;
if ( v10 )
goto LABEL_9;
BYTE1(__dst[0]) = 0;
if ( (*(_BYTE *)a2 & 1) == 0 )
{
LABEL_5:
v13 = a2 + 1;
goto LABEL_11;
}
LABEL_10:
v13 = *(_QWORD *)(a2 + 16);
LABEL_11:
v15 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName(v13, a7);
if ( (__dst[0] & 1) != 0 )
LODWORD(v16) = (_DWORD)__p;
else
v16 = (char *)__dst + 1;
v17 = ButtonSprite::create(v15, 32, 0, 1u, (int)v16, 0, 32.0, 1.0, 0.0);
sub_1002782D0(&v21, v22);
ButtonSprite::updateSpriteOffset((__int64)v17, (__int64)&v21);
v18 = (float *)CCMenuItemSpriteExtra::create((__int64)v17, 0, v25, v24, v23);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v18 + 160LL))(v18, v29);
v18[101] = v29;
if ( a5 )
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)a5 + 456LL))(a5, v18);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
return v18;
}