//
// EditorSoundConfigInfoLayer::downloadMissingSFX from 0xcd3340 to 0xcd3534 (500 bytes)
//
// 3 xrefs:
// > EditorSoundConfigInfoLayer::startSFXDownload @ 0xcd3570
// > EditorSoundConfigInfoLayer::musicActionFinished @ 0xcd3c0c
// > ??> @ 0x8c518
//
// 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 13:06:28 +0000
//
__int64 __fastcall EditorSoundConfigInfoLayer::downloadMissingSFX(EditorSoundConfigInfoLayer *this)
{
__int64 v2; // x0
unsigned __int64 v3; // x19
MusicDownloadManager *v4; // x0
unsigned __int64 v5; // x1
cocos2d::CCString *v6; // x0
const char *CString; // x0
__int64 v8; // x2
void (__fastcall *v9)(EditorSoundConfigInfoLayer *, __int64, __int64); // x23
size_t v10; // x0
__int64 v11; // x0
char *v13; // [xsp+48h] [xbp+48h]
void *v14; // [xsp+50h] [xbp+50h] BYREF
_BYTE *v15; // [xsp+58h] [xbp+58h]
__int64 v16[2]; // [xsp+68h] [xbp+68h] BYREF
void *v17; // [xsp+78h] [xbp+78h]
__int64 v18[2]; // [xsp+80h] [xbp+80h] BYREF
void *v19; // [xsp+90h] [xbp+90h]
EditorSoundConfigInfoLayer::missingSFXIDs(this, &v14);
v2 = (v15 - (_BYTE *)v14) >> 2;
if ( v2 )
{
v3 = 0;
do
{
v4 = (MusicDownloadManager *)MusicDownloadManager::sharedState((MusicDownloadManager *)v2);
MusicDownloadManager::downloadSFX(v4, *((_DWORD *)v14 + v3++));
v2 = (__int64)v15;
v5 = (v15 - (_BYTE *)v14) >> 2;
}
while ( v3 < v5 );
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Downloading %i SFX",
(const char *)v5);
}
else
{
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Downloading %i SFX", nullptr);
}
CString = (const char *)cocos2d::CCString::getCString(v6);
v8 = *(_QWORD *)this;
v13 = (char *)CString;
v16[0] = 0;
v9 = *(void (__fastcall **)(EditorSoundConfigInfoLayer *, __int64, __int64))(v8 + 464);
v16[1] = 0;
v17 = nullptr;
v10 = strlen(CString);
std::string::__init(v16, v13, v10);
v18[0] = 0;
v18[1] = 0;
v19 = nullptr;
std::string::__init(v18, &byte_11B8890, 0);
v11 = TextAlertPopup::create((char *)v16, 150, (char *)v18, 0.5, 0.6);
v9(this, v11, 100);
if ( (v18[0] & 1) != 0 )
{
operator delete(v19);
if ( (v16[0] & 1) == 0 )
goto LABEL_7;
}
else if ( (v16[0] & 1) == 0 )
{
goto LABEL_7;
}
operator delete(v17);
LABEL_7:
if ( v14 )
{
if ( v14 != v15 )
v15 += 4 * ~((unsigned __int64)(v15 - 4 - (_BYTE *)v14) >> 2);
operator delete(v14);
}
return _stack_chk_guard;
}