//
// SongOptionsLayer::onClose from 0x1401665b0 to 0x140166736 (390 bytes)
//
// 4 xrefs:
// > SongOptionsLayer::keyBackClicked @ 0x140166749
// > SongOptionsLayer::init @ 0x140165b9b
// > ??> @ 0x140917f3c
// > ??> @ 0x140917f48
//
// 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:27 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall SongOptionsLayer::onClose(_QWORD **a1)
{
float v2; // xmm7_4
__int64 v3; // rcx
_BYTE *v4; // rax
size_t v5; // r8
const char *v6; // rcx
float v7; // xmm6_4
char *v8; // rcx
__int64 v9; // rdx
char *String[2]; // [rsp+38h] [rbp-50h] BYREF
__int128 v12; // [rsp+48h] [rbp-40h]
(*(void (__fastcall **)(_QWORD *, _QWORD))(*a1[84] + 1032LL))(a1[84], 0);
v2 = *(float *)((*(__int64 (__fastcall **)(_QWORD *))(*a1[83] + 24LL))(a1[83]) + 344);
v3 = a1[84][74] + 600LL;
v4 = (_BYTE *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 8LL))(v3);
*(_OWORD *)String = 0;
v12 = 0;
v5 = -1;
do
++v5;
while ( v4[v5] );
sub_14003D230(String, v4, v5);
v6 = (const char *)String;
if ( *((_QWORD *)&v12 + 1) > 0xFu )
v6 = String[0];
v7 = atof(v6);
*(float *)((*(__int64 (__fastcall **)(_QWORD *))(*a1[83] + 24LL))(a1[83]) + 344) = v7;
if ( *((_QWORD *)&v12 + 1) > 0xFu )
{
v8 = String[0];
if ( (unsigned __int64)(*((_QWORD *)&v12 + 1) + 1LL) >= 0x1000 )
{
v8 = *((char **)String[0] - 1);
if ( (unsigned __int64)(String[0] - v8 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v8);
}
if ( v2 != *(float *)((*(__int64 (__fastcall **)(_QWORD *))(*a1[83] + 24LL))(a1[83]) + 344) )
*(_BYTE *)((*(__int64 (__fastcall **)(_QWORD *))(*a1[83] + 24LL))(a1[83]) + 424) = 1;
((void (__fastcall *)(_QWORD **, _QWORD))(*a1)[124])(a1, 0);
LOBYTE(v9) = 1;
return ((__int64 (__fastcall *)(_QWORD **, __int64))(*a1)[65])(a1, v9);
}