//
// SongCell::loadFromObject from 0x10022ca50 to 0x10022ce0a (954 bytes)
//
// 1 xrefs:
// > CustomListView::loadCell @ 0x10022802a
//
// 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:27:07 +0000
//
__int64 __fastcall SongCell::loadFromObject(__int64 a1, __int64 a2)
{
unsigned int v3; // r15d
char *v4; // rdi
__int64 v5; // r14
float *v6; // rax
double v7; // xmm0_8
char *v8; // r12
__int64 v9; // rax
int v10; // r13d
int v11; // edx
int v12; // ecx
int v13; // r8d
int v14; // r9d
__int64 v15; // r13
float v16; // xmm2_4
__int64 v17; // rax
__int64 CString; // r15
__int64 v19; // r15
__int64 v20; // rbx
float *v21; // rax
double v22; // xmm0_8
char v24; // [rsp+0h] [rbp-50h]
_BYTE v25[8]; // [rsp+4h] [rbp-4Ch] BYREF
float v26; // [rsp+Ch] [rbp-44h]
char v27; // [rsp+10h] [rbp-40h] BYREF
char v28; // [rsp+11h] [rbp-3Fh] BYREF
void *__p; // [rsp+20h] [rbp-30h]
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 536) + 584LL))(*(_QWORD *)(a1 + 536), 1);
*(_QWORD *)(a1 + 552) = a2;
v3 = LevelTools::artistForAudio(*(unsigned int *)(a2 + 56));
LevelTools::getAudioTitle(&v27, *(unsigned int *)(a2 + 56));
if ( (v27 & 1) != 0 )
v4 = (char *)__p;
else
v4 = &v28;
v5 = cocos2d::CCLabelBMFont::create_3(v4, "bigFont.fnt");
if ( (v27 & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 536) + 456LL))(*(_QWORD *)(a1 + 536), v5);
sub_100278250(&v27, 0.0, 0.5);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v5 + 296LL))(v5, &v27);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v5 + 160LL))(v5, 1.0);
sub_100278250(&v27, 10.0, (float)(*(float *)(a1 + 524) * 0.5) + 10.0);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v5 + 184LL))(v5, &v27);
if ( *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 328LL))(v5) > 240.0 )
{
v6 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 328LL))(v5);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v5 + 160LL))(v5, 240.0 / *v6);
}
v7 = (*(double (__fastcall **)(__int64))(*(_QWORD *)v5 + 168LL))(v5);
if ( *(float *)&v7 <= 0.69999999 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 168LL))(v5);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 160LL))(v5);
v8 = ButtonSprite::create_1(
(__int64)"View",
0x32u,
0,
0,
(__int64)"bigFont.fnt",
(__int64)"GJ_button_01.png",
0.60000002,
30.0);
v9 = CCMenuItemSpriteExtra::create(v8, 0, a1, SongCell::onClick, 0);
v10 = v9;
CCMenuItemSpriteExtra::setSizeMult(v9, 1.5);
v15 = sub_1008735E0(v10, 0, v11, v12, v13, v14);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 536) + 456LL))(*(_QWORD *)(a1 + 536), v15);
v26 = *(float *)(a1 + 520);
v16 = (float)(v26 - (float)(*(float *)(*(__int64 (__fastcall **)(char *))(*(_QWORD *)v8 + 328LL))(v8) * 0.5)) + -9.0;
sub_100278250(&v27, v16, 0.5 * *(float *)(a1 + 524));
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v15 + 184LL))(v15, &v27);
LevelTools::nameForArtist(&v27, v3);
v17 = sub_10088E820("By %s", v24);
CString = cocos2d::CCString::getCString(v17);
if ( (v27 & 1) != 0 )
operator delete(__p);
v19 = cocos2d::CCLabelBMFont::create_3(CString, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 536) + 456LL))(*(_QWORD *)(a1 + 536), v19);
sub_100278250(&v27, 0.0, 0.5);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v19 + 296LL))(v19, &v27);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v19 + 160LL))(v19, 1.0);
v20 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 192LL))(v5);
sub_100278250(v25, 2.0, -21.0);
sub_100278350(&v27, v20, v25);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v19 + 184LL))(v19, &v27);
if ( *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v19 + 328LL))(v19) > 140.0 )
{
v21 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v19 + 328LL))(v19);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v19 + 160LL))(v19, 140.0 / *v21);
}
v22 = (*(double (__fastcall **)(__int64))(*(_QWORD *)v19 + 168LL))(v19);
if ( *(float *)&v22 <= 0.69999999 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v19 + 168LL))(v19);
return (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v19 + 160LL))(v19);
}