//
// sub_1004D3A2C from 0x1004d3a2c to 0x1004d3bfc (464 bytes)
//
// 1 xrefs:
// > EditorSoundConfigInfoLayer::FLAlert_Clicked @ 0x1004d3f74
//
// This function is hookable on this platform (idp: arm, 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:06:30 +0000
//
void __fastcall sub_1004D3A2C(__int64 a1, int a2, int a3)
{
__int64 v3; // x8
_QWORD *v7; // x0
unsigned __int8 v8; // w0
_QWORD *v9; // x0
char *v10; // x1
__int64 v11; // x0
std::string *p_dst; // x1
__int64 v13; // x0
void *v14[2]; // [xsp+0h] [xbp-80h] BYREF
char v15; // [xsp+17h] [xbp-69h]
void *__p[2]; // [xsp+18h] [xbp-68h] BYREF
char v17; // [xsp+2Fh] [xbp-51h]
std::string __dst; // [xsp+30h] [xbp-50h] BYREF
std::string v19; // [xsp+48h] [xbp-38h] BYREF
v3 = *(_QWORD *)(a1 + 1088);
if ( v3 )
{
memset(&v19, 0, sizeof(v19));
if ( *(_DWORD *)(a1 + 1096) == 2 && *(int *)(v3 + 320) >= 1 )
{
v7 = (_QWORD *)EditorSFXManager::sharedState();
v8 = (unsigned __int8)sub_1004CB79C(v7, *(_DWORD *)(*(_QWORD *)(a1 + 1088) + 320LL), a2, &v19);
}
else
{
v9 = (_QWORD *)EditorSFXManager::sharedState();
v8 = (unsigned __int8)sub_1004CAE9C(v9, *(_QWORD *)(a1 + 1088), a2, &v19);
}
if ( (v8 & 1) != 0 )
{
if ( a2 )
v10 = "Sound pack merged into your current sounds.";
else
v10 = "Current sounds replaced with this pack.";
sub_100009900(v14, v10);
v11 = sub_10034A8F8(0, (__int64)"Applied", (__int64)v14, (__int64)"OK", 0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v11 + 1312LL))(v11);
if ( v15 < 0 )
{
operator delete(v14[0]);
if ( !a3 )
goto LABEL_28;
}
else if ( !a3 )
{
LABEL_28:
if ( SHIBYTE(v19.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v19.__r_.__value_.__l.__data_);
return;
}
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1368LL))(a1, 0);
goto LABEL_28;
}
if ( SHIBYTE(v19.__r_.__value_.__r.__words[2]) < 0 )
{
if ( v19.__r_.__value_.__l.__size_ )
{
sub_1000097D0(&__dst, v19.__r_.__value_.__l.__data_, v19.__r_.__value_.__l.__size_);
goto LABEL_19;
}
}
else if ( *((_BYTE *)&v19.__r_.__value_.__s + 23) )
{
__dst = v19;
LABEL_19:
if ( (__dst.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_dst = &__dst;
else
p_dst = (std::string *)__dst.__r_.__value_.__r.__words[0];
sub_100009900(__p, (char *)p_dst);
v13 = sub_10034A8F8(0, (__int64)"Error", (__int64)__p, (__int64)"OK", 0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v13 + 1312LL))(v13);
if ( v17 < 0 )
operator delete(__p[0]);
if ( SHIBYTE(__dst.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
goto LABEL_28;
}
sub_100009900(&__dst, "Failed to apply sound pack.");
goto LABEL_19;
}
}