//
// sub_1001DEF68 from 0x1001def68 to 0x1001df064 (252 bytes)
//
// 1 xrefs:
// > sub_1001DED8C @ 0x1001dee64
//
// 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:00:29 +0000
//
void __fastcall sub_1001DEF68(__int64 a1, __int64 a2, __int64 a3)
{
std::string *v5; // x0
FILE *v6; // x21
std::string v7; // [xsp+8h] [xbp-38h] BYREF
sub_1001D2EE4(a1, "dl_sfx_l");
if ( a3 && (*(_BYTE *)(a3 + 64) & 1) != 0 )
{
MusicDownloadManager::pathForSFXFolder(a1, 0, (__int64)&v7);
std::string::append(&v7, "sfxlibrary.dat");
if ( (v7.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v5 = &v7;
else
v5 = (std::string *)v7.__r_.__value_.__r.__words[0];
v6 = fopen((const char *)v5, "wb");
if ( v6 )
{
fwrite(*(const void **)(a3 + 72), 1u, *(_QWORD *)(a3 + 80) - *(_QWORD *)(a3 + 72), v6);
fclose(v6);
sub_1001DF084(a1);
MusicDownloadManager::downloadSFXFinished(a1, 1);
}
else
{
MusicDownloadManager::musicActionFailed(a1, 1);
}
if ( SHIBYTE(v7.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v7.__r_.__value_.__l.__data_);
}
else
{
MusicDownloadManager::musicActionFailed(a1, 1);
}
}