//
// EditorSFXManager::downloadAllMissing from 0x14018c130 to 0x14018c2f3 (451 bytes)
//
// 2 xrefs:
// > EditorSoundsSettingsPopup::onDownloadAll @ 0x1403d4eed
// > ??> @ 0x140918fb0
//
// 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 11:27:41 +0000
//
// Hidden C++ exception states: #wind=5
void __fastcall EditorSFXManager::downloadAllMissing(__int64 a1)
{
unsigned int v1; // edi
unsigned int *v2; // rbx
unsigned int *i; // rbp
unsigned int v4; // esi
__int64 v5; // rcx
int v6; // edi
void **v7; // rax
void *v8; // rdx
__int64 v9; // rcx
__int64 v10; // rax
__int64 v11; // rcx
unsigned int *v12; // [rsp+28h] [rbp-80h] BYREF
unsigned int *v13; // [rsp+30h] [rbp-78h]
void *v14; // [rsp+40h] [rbp-68h]
void *v15; // [rsp+48h] [rbp-60h]
_QWORD Src[4]; // [rsp+50h] [rbp-58h] BYREF
_QWORD v17[4]; // [rsp+70h] [rbp-38h] BYREF
v1 = 0;
EditorSFXManager::collectAllSFXIDs(a1, (__int64)&v12);
v2 = v12;
for ( i = v13; v2 != i; ++v2 )
{
v4 = *v2;
v5 = qword_14090C070;
if ( !qword_14090C070 )
{
v14 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v14);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
v5 = qword_14090C070;
}
MusicDownloadManager::pathForSFXFolder(v5, Src, v4);
v6 = v1 | 1;
sub_140044D80(Src, &unk_14070D03C, 1u);
v7 = (void **)GameToolbox::intToString(v17, v4);
v8 = v7;
if ( (unsigned __int64)v7[3] > 0xF )
v8 = *v7;
sub_140044D80(Src, v8, (size_t)v7[2]);
sub_14003D310((__int64)v17);
sub_140044D80(Src, ".ogg", 4u);
if ( !Src[2]
|| (v10 = cocos2d::CCFileUtils::sharedFileUtils(v9),
!(*(unsigned __int8 (__fastcall **)(__int64, _QWORD *))(*(_QWORD *)v10 + 152LL))(v10, Src)) )
{
v11 = qword_14090C070;
if ( !qword_14090C070 )
{
v15 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v15);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
v11 = qword_14090C070;
}
MusicDownloadManager::downloadSFX(v11, v4);
}
v1 = v6 & 0xFFFFFFFE;
sub_14003D310((__int64)Src);
}
sub_140069730((__int64)&v12);
}