//
// AchievementManager::reportAchievementWithID from 0x553ac8 to 0x553c50 (392 bytes)
//
// 2 xrefs:
// > GameManager::reportAchievementWithID @ 0x5f37a8
// > ??> @ 0x93630
//
// 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 AchievementManager::reportAchievementWithID(AchievementManager *a1, const char *a2, int a3, bool a4)
{
unsigned int v7; // w23
cocos2d::CCDictionary *m_reportedAchievements; // x26
cocos2d::CCObject *v9; // x25
void *v10; // x0
AchievementManager *v11; // x0
unsigned int *v12; // x2
int v13; // w1
__int64 v14; // [xsp+60h] [xbp+60h] BYREF
v7 = a4;
if ( !AchievementManager::isAchievementEarned(a1, a2) )
{
if ( AchievementManager::percentForAchievement(a1, a2) < a3 )
{
if ( a3 > 100 )
a3 = 100;
m_reportedAchievements = a1->m_reportedAchievements;
v9 = (cocos2d::CCObject *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a3);
sub_D153B8((int)&v14, (char *)a2);
cocos2d::CCDictionary::setObject((int)m_reportedAchievements, v9);
v10 = (void *)(v14 - 24);
if ( (__int64 *)(v14 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v12 = (unsigned int *)(v14 - 8);
do
v13 = __ldaxr(v12);
while ( __stlxr(v13 - 1, v12) );
}
else
{
v13 = *(_DWORD *)(v14 - 8);
*(_DWORD *)(v14 - 8) = v13 - 1;
}
if ( v13 <= 0 )
operator delete(v10);
}
AchievementManager::reportPlatformAchievementWithID(a1, a2, a3);
}
if ( (a3 > 99) > v7 )
{
v11 = AchievementManager::sharedState();
AchievementManager::notifyAchievementWithID(v11, a2);
}
}
}