//
// sub_4DC118 from 0x4dc118 to 0x4dc1e0 (200 bytes)
//
// 16 xrefs:
// > MusicDownloadManager::ProcessHttpRequest @ 0x828d40
// > MusicDownloadManager::ProcessHttpGetRequest @ 0x828f74
// > MusicDownloadManager::createArtistsInfo @ 0x83079c
// > MusicDownloadManager::parseSFXLibrary @ 0x8313a0
// > MusicDownloadManager::parseSFXLibrary @ 0x8313b8
// > MusicDownloadManager::parseSFXLibrary @ 0x8313d0
// > MusicDownloadManager::parseSFXLibrary @ 0x831460
// > MusicDownloadManager::downloadSong @ 0x831f64
// > SongInfoObject::addTags @ 0x8335a4
// > SongInfoObject::getArtistNames @ 0x833aa8
// > SongInfoObject::updateArtists @ 0x8343f0
// > MusicDownloadManager::parseMusicLibrary @ 0x839d88
// > MusicDownloadManager::parseMusicLibrary @ 0x839da0
// > MusicDownloadManager::parseMusicLibrary @ 0x839db8
// > MusicDownloadManager::parseMusicLibrary @ 0x839dd0
// > MusicDownloadManager::parseMusicLibrary @ 0x839f04
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_4DC118(__int64 *a1, __int64 *a2)
{
__int64 v4; // x1
__int64 *v5; // x0
unsigned int *v6; // x1
int v7; // w2
while ( a1 != a2 )
{
v4 = *a1;
v5 = (__int64 *)(*a1 - 24);
if ( v5 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v6 = (unsigned int *)(v4 - 8);
do
v7 = __ldaxr(v6);
while ( __stlxr(v7 - 1, v6) );
}
else
{
v7 = *(_DWORD *)(v4 - 8);
*(_DWORD *)(v4 - 8) = v7 - 1;
}
if ( v7 <= 0 )
operator delete(v5);
}
++a1;
}
return _stack_chk_guard;
}