//
// SongOptionsLayer::onClose from 0x1002171e0 to 0x1002172d6 (246 bytes)
//
// 3 xrefs:
// > SongOptionsLayer::keyBackClicked @ 0x100217555
// > sub_100217560 @ 0x10021756c
// > SongOptionsLayer::init @ 0x100216b39
//
// 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 __fastcall SongOptionsLayer::onClose(SongOptionsLayer *a1, cocos2d::CCObject *a2)
{
__int64 v3; // r14
float v4; // xmm0_4
char *v5; // r15
float v6; // xmm0_4
__int64 v7; // rax
char *v8[2]; // [rsp+8h] [rbp-38h] BYREF
char *v9; // [rsp+18h] [rbp-28h]
float v10; // [rsp+24h] [rbp-1Ch]
((void (__fastcall *)(CCTextInputNode *, _QWORD))a1->m_offsetInput->onClickTrackNode)(a1->m_offsetInput, 0);
v10 = *(float *)(((__int64 (__fastcall *)(CustomSongDelegate *))a1->m_delegate->getLevelSettings)(a1->m_delegate) + 344);
v3 = ((__int64 (__fastcall *)(CustomSongDelegate *))a1->m_delegate->getLevelSettings)(a1->m_delegate);
CCTextInputNode::getString(v8, (__int64)a1->m_offsetInput, COERCE_DOUBLE((unsigned __int64)LODWORD(v10)));
if ( ((__int64)v8[0] & 1) != 0 )
{
v5 = v9;
v6 = atof(v9);
*(float *)(v3 + 344) = v6;
operator delete(v5);
}
else
{
v4 = atof((const char *)v8 + 1);
*(float *)(v3 + 344) = v4;
}
v7 = ((__int64 (__fastcall *)(CustomSongDelegate *))a1->m_delegate->getLevelSettings)(a1->m_delegate);
if ( v10 != *(float *)(v7 + 344) )
*(_BYTE *)(((__int64 (__fastcall *)(CustomSongDelegate *))a1->m_delegate->getLevelSettings)(a1->m_delegate) + 416) = 1;
((void (__fastcall *)(SongOptionsLayer *, _QWORD))a1->setKeypadEnabled)(a1, 0);
((void (__fastcall *)(SongOptionsLayer *, __int64))a1->removeFromParentAndCleanup)(a1, 1);
}