//
// sub_1004D8EEC from 0x1004d8eec to 0x1004d905c (368 bytes)
//
// 1 xrefs:
// > sub_1004D8BA4 @ 0x1004d8d8c
//
// 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:32 +0000
//
void __fastcall sub_1004D8EEC(__int64 a1)
{
__int64 v2; // x0
__int64 v3; // x0
void *v4; // x0
void *v5; // x0
void *v6; // x0
_QWORD v7[2]; // [xsp+10h] [xbp-E0h] BYREF
char v8; // [xsp+27h] [xbp-C9h]
void *__p[2]; // [xsp+28h] [xbp-C8h] BYREF
char v10; // [xsp+3Fh] [xbp-B1h]
void *v11; // [xsp+40h] [xbp-B0h] BYREF
_BYTE *v12; // [xsp+48h] [xbp-A8h]
char __str[128]; // [xsp+58h] [xbp-98h] BYREF
v2 = EditorSFXManager::sharedState();
sub_1004CB92C(v2, &v11);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1072LL))(a1, 0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 528LL))(a1, 1);
if ( v11 == v12 )
{
sub_100009900(__p, "No SFX IDs to download.");
v6 = FLAlertLayer::create_1(0, (__int64)"Download", (__int64)__p, (__int64)"OK", 0, 260.0);
(*(void (__fastcall **)(void *))(*(_QWORD *)v6 + 1312LL))(v6);
if ( (v10 & 0x80000000) == 0 )
goto LABEL_7;
v5 = __p[0];
}
else
{
v3 = EditorSFXManager::sharedState();
sub_1004CBA00(v3);
snprintf(
__str,
0x80u,
"Requested download for %u SFX. Missing files will be fetched in the background.",
(unsigned __int64)(v12 - (_BYTE *)v11) >> 2);
sub_100009900(v7, __str);
v4 = FLAlertLayer::create_1(0, (__int64)"Download", (__int64)v7, (__int64)"OK", 0, 320.0);
(*(void (__fastcall **)(void *))(*(_QWORD *)v4 + 1312LL))(v4);
if ( (v8 & 0x80000000) == 0 )
goto LABEL_7;
v5 = (void *)v7[0];
}
operator delete(v5);
LABEL_7:
if ( v11 )
{
v12 = v11;
operator delete(v11);
}
}