//
// AchievementManager::notifyAchievementWithID from 0x14003ccb0 to 0x14003cfe1 (817 bytes)
//
// 2 xrefs:
// > AchievementManager::reportAchievementWithID @ 0x14003d13c
// > ??> @ 0x14090f02c
//
// 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 11:25:27 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall AchievementManager::notifyAchievementWithID(__int64 a1, __int64 a2)
{
__int64 v3; // r8
__int64 v4; // rbx
void *v5; // r8
cocos2d::CCString *v6; // rax
unsigned int CString; // edi
void *v8; // r8
cocos2d::CCString *v9; // rax
unsigned int v10; // esi
void *v11; // r8
cocos2d::CCString *v12; // rax
unsigned int v13; // ebx
void *v14; // r8
int v15; // eax
void *v16[2]; // [rsp+30h] [rbp-49h] BYREF
__m128i v17; // [rsp+40h] [rbp-39h]
void *v18[2]; // [rsp+50h] [rbp-29h] BYREF
__m128i v19; // [rsp+60h] [rbp-19h]
void *v20[2]; // [rsp+70h] [rbp-9h] BYREF
__m128i v21; // [rsp+80h] [rbp+7h]
void *Block[2]; // [rsp+90h] [rbp+17h] BYREF
__m128i si128; // [rsp+A0h] [rbp+27h]
if ( !*(_BYTE *)(a1 + 360) )
{
*(_OWORD *)Block = 0;
si128 = 0;
v3 = -1;
do
++v3;
while ( *(_BYTE *)(a2 + v3) );
sub_14003D230(Block);
v4 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 328), Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v5 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v5);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
if ( v4 )
{
*(_OWORD *)v16 = 0;
v17 = _mm_load_si128((const __m128i *)&xmmword_140836560);
strcpy((char *)v16, "title");
v6 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v4, v16);
CString = (unsigned int)cocos2d::CCString::getCString(v6);
if ( v17.m128i_i64[1] > 0xFuLL )
{
v8 = v16[0];
if ( (unsigned __int64)(v17.m128i_i64[1] + 1) >= 0x1000 )
{
v8 = *((void **)v16[0] - 1);
if ( (unsigned __int64)((char *)v16[0] - (char *)v8 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v8);
}
v17 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(v16[0]) = 0;
*(_OWORD *)v18 = 0;
v19 = 0;
v18[0] = (void *)sub_14003D460(32);
v19 = _mm_load_si128((const __m128i *)&xmmword_140836640);
strcpy((char *)v18[0], "achievedDescription");
v9 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v4, v18);
v10 = (unsigned int)cocos2d::CCString::getCString(v9);
if ( v19.m128i_i64[1] > 0xFuLL )
{
v11 = v18[0];
if ( (unsigned __int64)(v19.m128i_i64[1] + 1) >= 0x1000 )
{
v11 = *((void **)v18[0] - 1);
if ( (unsigned __int64)((char *)v18[0] - (char *)v11 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v11);
}
v19 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(v18[0]) = 0;
*(_OWORD *)v20 = 0;
v21 = _mm_load_si128((const __m128i *)&xmmword_140836550);
strcpy((char *)v20, "icon");
v12 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v4, v20);
v13 = (unsigned int)cocos2d::CCString::getCString(v12);
if ( v21.m128i_i64[1] > 0xFuLL )
{
v14 = v20[0];
if ( (unsigned __int64)(v21.m128i_i64[1] + 1) >= 0x1000 )
{
v14 = *((void **)v20[0] - 1);
if ( (unsigned __int64)((char *)v20[0] - (char *)v14 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v14);
}
v21 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(v20[0]) = 0;
v15 = AchievementNotifier::sharedState();
AchievementNotifier::notifyAchievement(v15, CString, v10, v13, 0);
}
}
}