//
// AchievementManager::percentForAchievement from 0x14003c250 to 0x14003c31d (205 bytes)
//
// 16 xrefs:
// > AchievementManager::isAchievementEarned @ 0x14003c234
// > AchievementManager::reportAchievementWithID @ 0x14003d010
// > AchievementManager::reportAchievementWithID @ 0x14003d024
// > GameManager::syncPlatformAchievements @ 0x14008b3c7
// > AchievementCell::loadFromDict @ 0x140147221
// > AchievementCell::loadFromDict @ 0x14014859d
// > GameLevelManager::onGetNotificationsCompleted @ 0x140250b43
// > GameManager::resetAchievement @ 0x140278341
// > GameManager::reportAchievementWithID @ 0x140279103
// > GameManager::dataLoaded @ 0x140283ecb
// > GameStatsManager::verifyUserCoins @ 0x1402e35e5
// > GameStatsManager::recountSpecialStats @ 0x1402e8c5d
// > GJGarageLayer::dialogClosed @ 0x140381046
// > GJPathPage::init @ 0x1403943d3
// > GJPathPage::unlockAnimationStep3 @ 0x140396b04
// > ??> @ 0x14090eff0
//
// 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=1
__int64 __fastcall AchievementManager::percentForAchievement(__int64 a1, __int64 a2)
{
__int64 v3; // r8
cocos2d::CCString *v4; // rax
unsigned int v5; // ebx
void *v6; // r8
void *Block[2]; // [rsp+30h] [rbp-38h] BYREF
__int128 v9; // [rsp+40h] [rbp-28h]
*(_OWORD *)Block = 0;
v9 = 0;
v3 = -1;
do
++v3;
while ( *(_BYTE *)(a2 + v3) );
sub_14003D230(Block);
v4 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(a1 + 352), Block);
v5 = cocos2d::CCString::intValue(v4);
if ( *((_QWORD *)&v9 + 1) > 0xFu )
{
v6 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v9 + 1) + 1LL) >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v6);
}
return v5;
}