//
// AchievementManager::reportAchievementWithID from 0x100864de0 to 0x100864f38 (344 bytes)
//
// 1 xrefs:
// > GameManager::reportAchievementWithID @ 0x1003632bd
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:36:43 +0000
//
void __fastcall AchievementManager::reportAchievementWithID(__int64 a1, const char *a2, int a3, int a4)
{
size_t v4; // r14
int v6; // r15d
__int64 v7; // r13
size_t v8; // rax
size_t v9; // r12
char *v10; // r13
__int64 v11; // rax
char v12; // [rsp+0h] [rbp-60h]
__int64 v13; // [rsp+8h] [rbp-58h]
__int64 v14; // [rsp+10h] [rbp-50h]
_QWORD __dst[2]; // [rsp+18h] [rbp-48h] BYREF
void *__p; // [rsp+28h] [rbp-38h]
int v17; // [rsp+34h] [rbp-2Ch]
LODWORD(v4) = a4;
if ( (int)AchievementManager::percentForAchievement(a1, a2) > 99 )
return;
if ( (int)AchievementManager::percentForAchievement(a1, a2) >= a3 )
{
if ( (unsigned __int8)v4 | (a3 < 100) )
return;
goto LABEL_10;
}
v6 = 100;
if ( a3 < 100 )
v6 = a3;
v7 = *(_QWORD *)(a1 + 352);
v13 = sub_10088E820("%i", v12);
v8 = strlen(a2);
if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v9 = v8;
v14 = v7;
if ( v8 >= 0x17 )
{
v17 = v4;
v4 = 26;
if ( (v8 | 7) != 0x17 )
v4 = (v8 | 7) + 1;
v10 = (char *)operator new(v4);
__p = v10;
__dst[0] = v4 + 1;
LOBYTE(v4) = v17;
__dst[1] = v9;
goto LABEL_15;
}
LOBYTE(__dst[0]) = 2 * v8;
v10 = (char *)__dst + 1;
if ( v8 )
LABEL_15:
memcpy(v10, a2, v9);
v10[v9] = 0;
cocos2d::CCDictionary::setObject(v14, v13, (char *)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
PlatformToolbox::reportAchievementWithID((__int64)a2, (unsigned int)v6);
if ( !((unsigned __int8)v4 | (v6 < 100)) )
{
LABEL_10:
v11 = AchievementManager::sharedState();
AchievementManager::notifyAchievementWithID(v11, a2);
}
}