//
// CustomSongWidget::loadSongInfoFinished from 0x74946c to 0x7495b0 (324 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'CustomSongWidget::loadSongInfoFinished @ 0x7495b4
// > ??> @ 0xa0950
// > ??> @ 0x1161900
//
// 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
//
void CustomSongWidget::loadSongInfoFinished(CustomSongWidget *a1, SongInfoObject *a2)
{
std::_Rb_tree_node_base *p_M_header; // x4
std::set *p_m_nextSongIDs; // x22
std::_Rb_tree_node_base::_Base_ptr M_parent; // x0
int m_songID; // w3
std::_Rb_tree_node_base *v8; // x1
_QWORD *v9; // x0
_QWORD *v10; // x1
MusicDownloadManager *v11; // x0
cocos2d::CCSequence *v12; // x21
cocos2d::CCFiniteTimeAction *v13; // x0
cocos2d::CCAction *v14; // x0
int v15; // [xsp+34h] [xbp+34h] BYREF
p_M_header = &a1->m_nextSongIDs._M_t._M_impl._M_header;
p_m_nextSongIDs = &a1->m_nextSongIDs;
M_parent = a1->m_nextSongIDs._M_t._M_impl._M_header._M_parent;
m_songID = a2->m_songID;
if ( !M_parent )
goto LABEL_17;
v8 = p_M_header;
do
{
while ( m_songID <= (int)M_parent[1]._M_color )
{
v8 = M_parent;
M_parent = M_parent->_M_left;
if ( !M_parent )
goto LABEL_5;
}
M_parent = M_parent->_M_right;
}
while ( M_parent );
LABEL_5:
if ( v8 == p_M_header || m_songID < (int)v8[1]._M_color )
{
LABEL_17:
if ( CustomSongWidget::verifySongID(a1, m_songID) )
{
CustomSongWidget::updateSongObject(a1, a2);
if ( a1->m_isNotDownloading )
CustomSongWidget::startDownload(a1);
v12 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create(0.0);
v13 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, CustomSongWidget::updateSongInfo, 0);
v14 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v12, v13, 0);
cocos2d::CCNode::runAction(a1, v14);
}
}
else
{
v15 = m_songID;
v9 = (_QWORD *)std::_Rb_tree,std::less,std::allocator>::equal_range(
(__int64)p_m_nextSongIDs,
&v15);
std::_Rb_tree,std::less,std::allocator>::_M_erase_aux(
p_m_nextSongIDs,
v9,
v10);
v11 = MusicDownloadManager::sharedState();
MusicDownloadManager::downloadSong(v11, a2->m_songID);
}
}