//
// SongCell::loadFromObject from 0x1400b4110 to 0x1400b4513 (1027 bytes)
//
// 2 xrefs:
// > CustomListView::loadCell @ 0x1400ab838
// > ??> @ 0x1406c7ad0
//
// 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
//
// Hidden C++ exception states: #wind=3
void SongCell::loadFromObject(SongCell *a1, SongObject *a2)
{
SongObject *v2; // rbx
unsigned int v4; // r15d
__int64 AudioTitle; // rax
struct cocos2d::CCLabelBMFont *v6; // rsi
cocos2d::CCLabelBMFont_vtbl *v7; // rbx
const cocos2d::CCPoint *v8; // rax
cocos2d::CCLabelBMFont_vtbl *v9; // rbx
const cocos2d::CCPoint *v10; // rax
cocos2d::CCLabelBMFont_vtbl *v11; // rbx
ButtonSprite *v12; // r14
CCMenuItemSpriteExtra *v13; // rax
struct cocos2d::CCMenu *v14; // rdi
cocos2d::CCMenu_vtbl *v15; // rbx
float m_height; // xmm6_4
float *v17; // rax
const cocos2d::CCPoint *v18; // rax
__int64 v19; // rax
cocos2d::CCString *v20; // rax
const char *CString; // rbx
struct cocos2d::CCLabelBMFont *v22; // rdi
cocos2d::CCLabelBMFont_vtbl *v23; // rbx
const cocos2d::CCPoint *v24; // rax
__int64 v25; // rax
cocos2d::CCLabelBMFont_vtbl *v26; // rbx
ButtonSprite *v27; // [rsp+50h] [rbp-A8h] BYREF
cocos2d::CCPoint v28; // [rsp+58h] [rbp-A0h] BYREF
_BYTE v29[32]; // [rsp+60h] [rbp-98h] BYREF
_BYTE v30[32]; // [rsp+80h] [rbp-78h] BYREF
v2 = a2;
LOBYTE(a2) = 1;
a1->m_mainLayer->removeAllChildrenWithCleanup(a1->m_mainLayer, (bool)a2);
a1->m_songObject = v2;
v4 = LevelTools::artistForAudio(v2->m_audioID);
AudioTitle = LevelTools::getAudioTitle(v29, (unsigned int)v2->m_audioID);
if ( *(_QWORD *)(AudioTitle + 24) > 0xFu )
AudioTitle = *(_QWORD *)AudioTitle;
v6 = cocos2d::CCLabelBMFont::create((const char *)AudioTitle, (const char *)&qword_14052A4D8);
sub_14003A830((__int64)v29);
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v6);
v7 = v6->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v27, 0.0, 0.5);
v7->setAnchorPoint(v6, v8);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v6->setScale_0)(v6);
v9 = v6->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v27, 10.0, (float)(a1->m_height * 0.5) + 10.0);
v9->setPosition_0(v6, v10);
if ( v6->getContentSize(v6)->width > 240.0 )
{
v11 = v6->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v6->getContentSize(v6);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v11->setScale_0)(v6);
}
v6->getScale(v6);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v6->setScale_0)(v6);
v27 = (ButtonSprite *)operator new(0x2C0u);
v12 = ButtonSprite::ButtonSprite(v27);
if ( v12 )
{
if ( ButtonSprite::init_1(
v12,
"View",
50,
0,
0.60000002,
0,
(const char *)&qword_14052A4D8,
"GJ_button_01.png",
30.0) )
{
cocos2d::CCObject::autorelease(v12);
}
else
{
((void (__fastcall *)(ButtonSprite *, __int64))v12->~ButtonSprite)(v12, 1);
v12 = nullptr;
}
}
v13 = CCMenuItemSpriteExtra::create(v12, nullptr, a1, (cocos2d::SEL_MenuHandler *)SongCell::onClick);
HIDWORD(v13->m_pfnSelector.adj) = 1069547520;
v14 = cocos2d::CCMenu::create(v13, 0);
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v14);
v15 = v14->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
m_height = a1->m_height;
v17 = (float *)v12->getContentSize(v12);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v27, (float)(a1->m_width - (float)(*v17 * 0.5)) - 9.0, m_height * 0.5);
v15->setPosition_0(v14, v18);
v19 = LevelTools::nameForArtist(v30, v4);
if ( *(_QWORD *)(v19 + 24) > 0xFu )
v19 = *(_QWORD *)v19;
v20 = cocos2d::CCString::createWithFormat("By %s", (const char *)v19);
CString = cocos2d::CCString::getCString(v20);
sub_14003A830((__int64)v30);
v22 = cocos2d::CCLabelBMFont::create(CString, "goldFont.fnt");
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v22);
v23 = v22->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v27, 0.0, 0.5);
v23->setAnchorPoint(v22, v24);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v22->setScale_0)(v22);
cocos2d::CCPoint::CCPoint(&v28, 2.0, -21.0);
v25 = (__int64)v6->getPosition_0(v6);
cocos2d::CCPoint::operator+(v25, &v27);
v22->setPosition_0(v22, (const cocos2d::CCPoint *)&v27);
if ( v22->getContentSize(v22)->width > 140.0 )
{
v26 = v22->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v22->getContentSize(v22);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v26->setScale_0)(v22);
}
v22->getScale(v22);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v22->setScale_0)(v22);
}