//
// SetupSFXPopup::onPlusButton from 0x1004b3860 to 0x1004b3a77 (535 bytes)
//
// 1 xrefs:
// > ??> @ 0x100b57238
//
// 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 12:30:59 +0000
//
__int64 __fastcall SetupSFXPopup::onPlusButton(_QWORD *a1, __int64 a2)
{
__int64 result; // rax
__int64 v4; // rdi
int NextFreeSFXID; // r14d
_QWORD *v6; // rdi
_QWORD *v7; // r15
void *v8; // rdi
float v9; // xmm0_4
_QWORD *v10; // rdi
unsigned int v11; // esi
__int64 v12; // rdi
int NextFreeSFXGroupID; // r14d
_QWORD *v14; // rdi
_QWORD *v15; // r15
void *v16; // rdi
__int64 v17; // r14
__int64 v18; // r15
_QWORD *v19; // rbx
void *v20[2]; // [rsp+0h] [rbp-40h] BYREF
void *__p[2]; // [rsp+10h] [rbp-30h]
int v22; // [rsp+20h] [rbp-20h]
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
if ( (_DWORD)result == 2 )
{
v17 = a1[85];
v18 = a1[86];
v19 = operator new(0x400u);
SetupTriggerPopup::SetupTriggerPopup((__int64)v19);
*v19 = off_100B56488;
v19[40] = off_100B56A78;
v19[41] = &off_100B56AE8;
v19[42] = off_100B56B00;
v19[43] = off_100B56B20;
v19[44] = off_100B56B48;
v19[51] = off_100B56B78;
v19[54] = off_100B56BF8;
v19[68] = off_100B56C18;
v19[83] = &off_100B56C60;
v19[84] = off_100B56C78;
if ( !(unsigned __int8)SetupReverbPopup::init((__int64)v19, v17, v18) )
sub_1009A64E0(v19);
cocos2d::CCObject::autorelease((__int64)v19);
return (*(__int64 (__fastcall **)(_QWORD *))(*v19 + 1312LL))(v19);
}
else
{
if ( (_DWORD)result == 1 )
{
v12 = *(_QWORD *)(GameManager::sharedState() + 552);
*(_OWORD *)__p = 0;
*(_OWORD *)v20 = 0;
v22 = 1065353216;
NextFreeSFXGroupID = LevelEditorLayer::getNextFreeSFXGroupID(v12, (__int64)v20);
v14 = __p[0];
if ( __p[0] )
{
do
{
v15 = (_QWORD *)*v14;
operator delete(v14);
v14 = v15;
}
while ( v15 );
}
v16 = v20[0];
v20[0] = nullptr;
if ( v16 )
operator delete(v16);
v9 = (float)NextFreeSFXGroupID;
v10 = a1;
v11 = 455;
}
else
{
if ( (_DWORD)result )
return result;
v4 = *(_QWORD *)(GameManager::sharedState() + 552);
*(_OWORD *)__p = 0;
*(_OWORD *)v20 = 0;
v22 = 1065353216;
NextFreeSFXID = LevelEditorLayer::getNextFreeSFXID(v4, (__int64)v20);
v6 = __p[0];
if ( __p[0] )
{
do
{
v7 = (_QWORD *)*v6;
operator delete(v6);
v6 = v7;
}
while ( v7 );
}
v8 = v20[0];
v20[0] = nullptr;
if ( v8 )
operator delete(v8);
v9 = (float)NextFreeSFXID;
v10 = a1;
v11 = 416;
}
return SetupTriggerPopup::updateValue(v10, v11, v9);
}
}