//
// AchievementManager::notifyAchievementWithID from 0x100785890 to 0x100785a2e (414 bytes)
//
// 1 xrefs:
// > AchievementManager::reportAchievementWithID @ 0x100785c30
//
// 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 __fastcall AchievementManager::notifyAchievementWithID(AchievementManager *a1, const char *a2)
{
double v2; // xmm0_8
cocos2d::CCDictionary *m_platformAchievements; // rbx
size_t v4; // rax
size_t v5; // r14
_BYTE *v6; // r15
size_t v7; // r12
__int64 v8; // rbx
cocos2d::CCString *v9; // rax
const char *CString; // r14
cocos2d::CCString *v11; // rax
const char *v12; // r15
cocos2d::CCString *v13; // rax
const char *v14; // rbx
AchievementNotifier *v15; // rax
_BYTE __dst[48]; // [rsp+0h] [rbp-40h] BYREF
if ( a1->m_dontNotify )
return;
m_platformAchievements = a1->m_platformAchievements;
v4 = strlen(a2);
if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v2);
v5 = v4;
if ( v4 >= 0x17 )
{
v7 = 26;
if ( (v4 | 7) != 0x17 )
v7 = (v4 | 7) + 1;
v6 = operator new(v7);
*(_QWORD *)&__dst[16] = v6;
*(_QWORD *)__dst = v7 + 1;
*(_QWORD *)&__dst[8] = v5;
}
else
{
__dst[0] = 2 * v4;
v6 = &__dst[1];
if ( !v4 )
goto LABEL_10;
}
memcpy(v6, a2, v5);
LABEL_10:
v6[v5] = 0;
v8 = cocos2d::CCDictionary::objectForKey_1((__int64)m_platformAchievements, __dst);
if ( (__dst[0] & 1) != 0 )
operator delete(*(void **)&__dst[16]);
if ( v8 )
{
strcpy(__dst, "\ntitle");
v9 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v8, (__int64)__dst);
CString = cocos2d::CCString::getCString(v9);
if ( (__dst[0] & 1) != 0 )
operator delete(*(void **)&__dst[16]);
strcpy(__dst, "&achievedDescription");
v11 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v8, (__int64)__dst);
v12 = cocos2d::CCString::getCString(v11);
if ( (__dst[0] & 1) != 0 )
operator delete(*(void **)&__dst[16]);
__dst[0] = 8;
strcpy(&__dst[1], "icon");
v13 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v8, (__int64)__dst);
v14 = cocos2d::CCString::getCString(v13);
if ( (__dst[0] & 1) != 0 )
operator delete(*(void **)&__dst[16]);
v15 = AchievementNotifier::sharedState();
AchievementNotifier::notifyAchievement(v15, CString, v12, v14, 0);
}
}