//
// SongOptionsLayer::onClose from 0x83bf9c to 0x83c114 (376 bytes)
//
// 4 xrefs:
// > SongOptionsLayer::keyBackClicked @ 0x83c118
// > ??> @ 0xaac10
// > SongOptionsLayer::init @ 0x83d628
// > ??> @ 0x122dea0
//
// 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 SongOptionsLayer::onClose(SongOptionsLayer *a1, cocos2d::CCObject *a2)
{
float m_songOffset; // s8
LevelSettingsObject *v4; // x21
float v5; // s0
char *v6; // x2
char *v7; // x0
unsigned int *v8; // x2
int v9; // w1
char *v10; // [xsp+40h] [xbp+40h] BYREF
a1->m_offsetInput->onClickTrackNode(a1->m_offsetInput, 0);
m_songOffset = a1->m_delegate->getLevelSettings(a1->m_delegate)->m_songOffset;
v4 = a1->m_delegate->getLevelSettings(a1->m_delegate);
CCTextInputNode::getString(a1->m_offsetInput, (__int64)&v10);
v5 = atof(v10);
v6 = v10;
v7 = v10 - 24;
v4->m_songOffset = v5;
if ( v7 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v6 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *((_DWORD *)v6 - 2);
*((_DWORD *)v6 - 2) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v7);
}
if ( m_songOffset != a1->m_delegate->getLevelSettings(a1->m_delegate)->m_songOffset )
a1->m_delegate->getLevelSettings(a1->m_delegate)->m_guidelinesUpdated = 1;
a1->setKeypadEnabled(a1, 0);
a1->removeFromParentAndCleanup(a1, 1);
}