//
// MusicDownloadManager::onTryUpdateSFXLibraryCompleted from 0x14048f6d0 to 0x14048f819 (329 bytes)
//
// 2 xrefs:
// > MusicDownloadManager::tryUpdateSFXLibrary @ 0x14048f5d7
// > ??> @ 0x140928e2c
//
// 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:32:50 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall MusicDownloadManager::onTryUpdateSFXLibraryCompleted(__int64 a1, __int64 a2, __int64 a3)
{
void *v5; // rcx
const char *v6; // rcx
void *Block[2]; // [rsp+30h] [rbp-58h] BYREF
__m128i si128; // [rsp+40h] [rbp-48h]
char *String[4]; // [rsp+50h] [rbp-38h] BYREF
Block[1] = nullptr;
si128 = _mm_load_si128((const __m128i *)&xmmword_140836580);
Block[0] = (void *)0x6C5F7866735F76LL;
cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(a1 + 328), Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v5 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v5);
}
if ( a3 && *(_BYTE *)(a3 + 64) )
{
GameToolbox::getResponse((__int64)String, a3);
v6 = (const char *)String;
if ( String[3] > (char *)0xF )
v6 = String[0];
if ( atoi(v6) <= *(_DWORD *)(a1 + 432) )
MusicDownloadManager::musicActionFailed(a1, 4);
else
MusicDownloadManager::downloadSFXLibrary(a1);
sub_14003D310((__int64)String);
}
else
{
MusicDownloadManager::musicActionFailed(a1, 3);
}
}