//
// SongCell::loadFromObject from 0x14014fde0 to 0x1401501f1 (1041 bytes)
//
// 2 xrefs:
// > CustomListView::loadCell @ 0x140145c6c
// > ??> @ 0x140917708
//
// 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:27:17 +0000
//
// Hidden C++ exception states: #wind=3
__int64 __fastcall SongCell::loadFromObject(__int64 a1, __int64 a2)
{
__int64 v2; // rbx
unsigned int v4; // r15d
__int64 AudioTitle; // rax
struct cocos2d::CCLabelBMFont *v6; // rsi
__int64 v7; // rbx
__int64 v8; // rax
__int64 v9; // rbx
__int64 v10; // rax
__int64 v11; // rbx
cocos2d::CCObject *v12; // r14
cocos2d::CCObject *v13; // rax
struct cocos2d::CCMenu *v14; // rdi
__int64 v15; // rbx
float v16; // xmm6_4
float *v17; // rax
__int64 v18; // rax
__int64 v19; // rax
cocos2d::CCString *v20; // rax
const char *CString; // rbx
struct cocos2d::CCLabelBMFont *v22; // rdi
__int64 v23; // rbx
__int64 v24; // rax
__int64 v25; // rax
__int64 v26; // rbx
__int64 v27; // rax
__int64 v28; // rbx
void *v30; // [rsp+50h] [rbp-A8h] BYREF
_BYTE v31[8]; // [rsp+58h] [rbp-A0h] BYREF
_BYTE v32[32]; // [rsp+60h] [rbp-98h] BYREF
_BYTE v33[32]; // [rsp+80h] [rbp-78h] BYREF
v2 = a2;
LOBYTE(a2) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 544) + 576LL))(*(_QWORD *)(a1 + 544), a2);
*(_QWORD *)(a1 + 560) = v2;
v4 = LevelTools::artistForAudio(*(unsigned int *)(v2 + 56));
AudioTitle = LevelTools::getAudioTitle(v32, *(unsigned int *)(v2 + 56));
if ( *(_QWORD *)(AudioTitle + 24) > 0xFu )
AudioTitle = *(_QWORD *)AudioTitle;
v6 = cocos2d::CCLabelBMFont::create((const char *)AudioTitle, (const char *)&qword_140704F78);
sub_14003D310((__int64)v32);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 544) + 464LL))(
*(_QWORD *)(a1 + 544),
v6);
v7 = *(_QWORD *)v6;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v30, 0.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v7 + 288))(v6, v8);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v6 + 160LL))(v6);
v9 = *(_QWORD *)v6;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v30, 10.0, (float)(*(float *)(a1 + 532) * 0.5) + 10.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v9 + 184))(v6, v10);
if ( *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v6 + 320LL))(v6) > 240.0 )
{
v11 = *(_QWORD *)v6;
(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v6 + 320LL))(v6);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(v11 + 160))(v6);
}
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v6 + 168LL))(v6);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v6 + 160LL))(v6);
v30 = operator new(0x2C8u);
v12 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v30);
if ( v12 )
{
if ( ButtonSprite::init_1(
(__int64)v12,
(__int64)"View",
50,
0,
1058642330,
0,
&qword_140704F78,
(__int64)"GJ_button_01.png",
1106247680) )
{
cocos2d::CCObject::autorelease(v12);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v12 + 8LL))(v12, 1);
v12 = nullptr;
}
}
v13 = CCMenuItemSpriteExtra::create((int)v12, 0, a1, (__int64)SongCell::onClick);
*((_DWORD *)v13 + 93) = 1069547520;
v14 = cocos2d::CCMenu::create(v13, 0);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCMenu *))(**(_QWORD **)(a1 + 544) + 464LL))(
*(_QWORD *)(a1 + 544),
v14);
v15 = *(_QWORD *)v14;
v16 = *(float *)(a1 + 532) * 0.5;
v17 = (float *)(*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v12 + 320LL))(v12);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v30, (float)(*(float *)(a1 + 528) - (float)(*v17 * 0.5)) - 9.0, v16);
(*(void (__fastcall **)(struct cocos2d::CCMenu *, __int64))(v15 + 184))(v14, v18);
v19 = LevelTools::nameForArtist(v33, v4);
if ( *(_QWORD *)(v19 + 24) > 0xFu )
v19 = *(_QWORD *)v19;
v20 = cocos2d::CCString::createWithFormat("By %s", (const char *)v19);
CString = cocos2d::CCString::getCString(v20);
sub_14003D310((__int64)v33);
v22 = cocos2d::CCLabelBMFont::create(CString, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 544) + 464LL))(
*(_QWORD *)(a1 + 544),
v22);
v23 = *(_QWORD *)v22;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v30, 0.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v23 + 288))(v22, v24);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v22 + 160LL))(v22);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v31, 2.0, -21.0);
v26 = v25;
v27 = (*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v6 + 200LL))(v6);
cocos2d::CCPoint::operator+(v27, &v30, v26);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, void **))(*(_QWORD *)v22 + 184LL))(v22, &v30);
if ( *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v22 + 320LL))(v22) > 140.0 )
{
v28 = *(_QWORD *)v22;
(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v22 + 320LL))(v22);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(v28 + 160))(v22);
}
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v22 + 168LL))(v22);
return (*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v22 + 160LL))(v22);
}