//
// AchievementManager::getAchievementsWithID from 0x140039d70 to 0x140039e20 (176 bytes)
//
// 15 xrefs:
// > CustomSFXWidget::onCancelDownload @ 0x1400c19e1
// > CustomSFXWidget::updateDownloadProgress @ 0x1400c1e62
// > CustomSongWidget::onCancelDownload @ 0x1400caae1
// > CustomSongWidget::updateDownloadProgress @ 0x1400cb3d5
// > GameManager::getUnlockForAchievement @ 0x14017ca00
// > GJGarageLayer::descriptionForUnlock @ 0x140278372
// > ItemInfoPopup::init @ 0x14027bcaf
// > ItemInfoPopup::init @ 0x14027ca05
// > MusicDownloadManager::isRunningActionForSongID @ 0x14033d51b
// > MusicDownloadManager::isRunningActionForSongID @ 0x14033d543
// > MusicDownloadManager::getSongInfo @ 0x14033d694
// > MusicDownloadManager::downloadSong @ 0x14033ea7f
// > MusicDownloadManager::downloadCustomSong @ 0x14034036c
// > MusicDownloadManager::downloadSFX @ 0x14034229c
// > ??> @ 0x1406c3c78
//
// 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
//
// Merged with: AchievementManager::getAchievementsWithID, MusicDownloadManager::getDLObject
// Hidden C++ exception states: #wind=1
__int64 __fastcall AchievementManager::getAchievementsWithID(__int64 a1, __int64 a2)
{
__int64 v3; // r8
__int64 v4; // rbx
void *v5; // rcx
void *Block[2]; // [rsp+20h] [rbp-38h] BYREF
__int128 v8; // [rsp+30h] [rbp-28h]
*(_OWORD *)Block = 0;
v8 = 0;
v3 = -1;
do
++v3;
while ( *(_BYTE *)(a2 + v3) );
sub_14003A930(Block);
v4 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 328), Block);
if ( *((_QWORD *)&v8 + 1) > 0xFu )
{
v5 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v8 + 1) + 1LL) >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v5);
}
return v4;
}