//
// GJAccountManager::removeDLFromActive from 0x8456a4 to 0x845794 (240 bytes)
//
// 8 xrefs:
// > GJAccountManager::onRegisterAccountCompleted @ 0x845ab0
// > GJAccountManager::onLoginAccountCompleted @ 0x84604c
// > GJAccountManager::onGetAccountBackupURLCompleted @ 0x846d1c
// > GJAccountManager::onBackupAccountCompleted @ 0x846fec
// > GJAccountManager::onGetAccountSyncURLCompleted @ 0x847a30
// > GJAccountManager::onUpdateAccountSettingsCompleted @ 0x847f28
// > GJAccountManager::onSyncAccountCompleted @ 0x8486c8
// > ??> @ 0x7b720
//
// 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
//
void GJAccountManager::removeDLFromActive(GJAccountManager *a1, const char *a2)
{
cocos2d::CCDictionary *m_activeDownloads; // x21
char *v3; // x0
unsigned int *v4; // x2
int v5; // w1
std::string v6; // [xsp+40h] [xbp+40h] BYREF
m_activeDownloads = a1->m_activeDownloads;
sub_D153B8((int)&v6, (char *)a2);
cocos2d::CCDictionary::removeObjectForKey(m_activeDownloads, &v6);
v3 = (char *)v6.m_data.m_data - 24;
if ( (__int64 *)v6.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v4 = (unsigned int *)((char *)v6.m_data.m_data - 8);
do
v5 = __ldaxr(v4);
while ( __stlxr(v5 - 1, v4) );
}
else
{
v5 = *((_DWORD *)v6.m_data.m_data - 2);
*((_DWORD *)v6.m_data.m_data - 2) = v5 - 1;
}
if ( v5 <= 0 )
operator delete(v3);
}
}