//
// sub_1004D268C from 0x1004d268c to 0x1004d27b0 (292 bytes)
//
// 2 xrefs:
// > EditorSoundConfigInfoLayer::downloadEditorSoundFinished @ 0x1004d4470
// > sub_1004CF9C0 @ 0x1004d102c
//
// 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:29 +0000
//
void __fastcall sub_1004D268C(__int64 a1)
{
__int64 v2; // x0
__int64 v3; // x0
__int64 v4; // x0
__int64 v5; // x0
__int64 v6; // x0
__int64 v7; // x0
__int64 v8; // x0
void *__p[2]; // [xsp+8h] [xbp-28h] BYREF
char v10; // [xsp+1Fh] [xbp-11h]
if ( *(_QWORD *)(a1 + 1088) )
{
if ( EditorSFXManager::sharedState()
&& (v2 = EditorSFXManager::sharedState(), sub_1004CAD00(v2, *(_DWORD *)(*(_QWORD *)(a1 + 1088) + 316LL))) )
{
v3 = EditorSFXManager::sharedState();
sub_1004CAE14(v3, *(_DWORD *)(*(_QWORD *)(a1 + 1088) + 316LL));
sub_1004D2A34(a1);
v4 = *(_QWORD *)(a1 + 1104);
if ( v4 )
j_FLAlertLayer::requestRebuild(v4);
}
else if ( (*(_BYTE *)(*(_QWORD *)(a1 + 1088) + 496LL) & 1) != 0 )
{
v5 = EditorSFXManager::sharedState();
v6 = sub_1004CACCC(v5);
if ( v6 && (unsigned int)sub_1002E757C(v6) >= 0x32 )
{
sub_100009900(__p, "You have reached the maximum of 50 favorites. Remove some first.");
v7 = sub_10034A8F8(0, (__int64)"Limit Reached", (__int64)__p, (__int64)"OK", 0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v7 + 1312LL))(v7);
if ( v10 < 0 )
operator delete(__p[0]);
}
else
{
v8 = EditorSFXManager::sharedState();
sub_1004CAD70(v8, *(_QWORD *)(a1 + 1088));
sub_1004D2A34(a1);
}
}
else
{
*(_BYTE *)(a1 + 1121) = 1;
sub_1004D2CAC(a1);
}
}
}